/// <summary>
        /// Returns message for the specified resource name.
        /// </summary>
        /// <param name="name">Resource name.</param>
        /// <returns>Message text.</returns>
        public string GetProgramMessage(string name)
        {
            if (this.EnableInsertControlCache)
            {
                this.CheckTranslateSymbolAndSaveToDatabase(name);
            }

            name = string.Format("{0}|;;|{1}", this.ProgramCode, name);
            return(MessageSource.GetMessage(name, UserCulture));
        }
        public static void loadLanguageStringFromFile()
        {
            s_messageSource = new MessageSource("Assets/Decentraland/Editor/Localization", "language");

            int length = (int)LanguageStringValue.LastType;

            languageString = new string[length];
            for (int i = 0; i < length; ++i)
            {
                LanguageStringValue l = (LanguageStringValue)i;
                languageString [i] = s_messageSource.GetMessage(l.ToString(), null, Language.ToString());
            }
        }
Beispiel #3
0
        /// <summary>
        /// Translate cargo status.
        /// </summary>
        /// <returns>A translated string describing the cargo status.</returns>
        public string GetStatusText()
        {
            Delivery delivery = cargo.Delivery;
            string   code     = "cargo.status." + delivery.TransportStatus.DisplayName;

            object[] args = null;

            if (delivery.TransportStatus == TransportStatus.IN_PORT)
            {
                args = new object[] { GetDisplayText(delivery.LastKnownLocation) };
            }
            else if (delivery.TransportStatus == TransportStatus.ONBOARD_CARRIER)
            {
                args = new object[] { delivery.CurrentVoyage.VoyageNumber.IdString };
            }
            else if (delivery.TransportStatus == TransportStatus.CLAIMED ||
                     delivery.TransportStatus == TransportStatus.NOT_RECEIVED ||
                     delivery.TransportStatus == TransportStatus.UNKNOWN)
            {
                args = null;
            }

            return(MessageSource.GetMessage(code, args, "[Unknown status]"));
        }
Beispiel #4
0
 public void Show()
 {
     if (MsgType.Equals(MessageTypeEnum.AlertMessage.Information))
     {
         ctlAlertImg.ImageUrl          = "~/App_Themes/" + this.Page.StyleSheetTheme.ToString() + "/images/ok.png";
         ctlMessageInformation.Text    = MessageSource.GetMessage(Symbol);
         ctlMessageInformation.Visible = true;
         ctlMessageError.Visible       = false;
     }
     else if (MsgType.Equals(MessageTypeEnum.AlertMessage.Error))
     {
         ctlAlertImg.ImageUrl          = "~/App_Themes/" + this.Page.StyleSheetTheme.ToString() + "/images/cancel.png";
         ctlMessageError.Text          = MessageSource.GetMessage(Symbol);
         ctlMessageError.Visible       = true;
         ctlMessageInformation.Visible = false;
     }
     else
     {
         ctlAlertImg.ImageUrl          = "~/App_Themes/" + this.Page.StyleSheetTheme.ToString() + "/images/alert.png";
         ctlMessageInformation.Text    = MessageSource.GetMessage(Symbol);
         ctlMessageInformation.Visible = true;
         ctlMessageError.Visible       = false;
     }
 }
 public virtual void SetMessage(string msgId)
 {
     TempData["Message"] = MessageSource.GetMessage(msgId);
 }
Beispiel #6
0
 public void Write()
 {
     Console.WriteLine(_messageSource.GetMessage());
 }