コード例 #1
0
        /// <summary>
        /// Set for the UserDefined cultureCode a new text matching a stringCode.
        /// </summary>
        /// <param name="stringCode"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public bool SetUserDefinedTranslatedText(StringCode stringCode, string text)
        {
            if (string.IsNullOrWhiteSpace(text))
            {
                return(false);
            }

            TranslatedTextPage page = null;

            // get the page of the default cultureCode
            if (!_dictTextTranslatedPage.ContainsKey(CultureCode.UserDefined))
            {
                // the culture code does not exists!
                return(false);
            }

            page = _dictTextTranslatedPage[CultureCode.UserDefined];

            // now get the translated text matching the code
            TranslatedText translatedText = page.FindTranslatedTextByStringCode(stringCode);

            // the translated not yet exists, create it
            if (translatedText == null)
            {
                page.Add(stringCode, text);
                return(true);
            }

            // exists, set the new text
            translatedText.ReplaceText(text);
            return(true);
        }
コード例 #2
0
        /// <summary>
        /// create all translations.
        /// </summary>
        private void CreateTranslation_fr_FR()
        {
            // create the page for the cultureInfo
            TranslatedTextPage textTranslatedPage = new TranslatedTextPage(CultureCode.fr_FR);

            _dictTextTranslatedPage.Add(CultureCode.fr_FR, textTranslatedPage);

            textTranslatedPage.Add(StringCode.Ok, "Ok");
            textTranslatedPage.Add(StringCode.Cancel, "Annuler");

            textTranslatedPage.Add(StringCode.No, "Non");
            textTranslatedPage.Add(StringCode.Yes, "Oui");
            textTranslatedPage.Add(StringCode.Close, "Fermer");

            textTranslatedPage.Add(StringCode.DlgInformationTitle, "Information");
            textTranslatedPage.Add(StringCode.DlgWarningTitle, "Alerte");
            textTranslatedPage.Add(StringCode.DlgErrorTitle, "Erreur");
            textTranslatedPage.Add(StringCode.DlgQuestionTitle, "Question");
        }
コード例 #3
0
        /// <summary>
        /// create all translations.
        /// </summary>
        private void CreateTranslation_es_ES()
        {
            // create the page for the cultureInfo
            TranslatedTextPage textTranslatedPage = new TranslatedTextPage(CultureCode.es_ES);

            _dictTextTranslatedPage.Add(CultureCode.es_ES, textTranslatedPage);

            textTranslatedPage.Add(StringCode.Ok, "Ok");
            textTranslatedPage.Add(StringCode.Cancel, "Cancelar");

            textTranslatedPage.Add(StringCode.No, "No");
            textTranslatedPage.Add(StringCode.Yes, "Si");
            textTranslatedPage.Add(StringCode.Close, "Cerrar");

            textTranslatedPage.Add(StringCode.DlgInformationTitle, "Informacion");
            textTranslatedPage.Add(StringCode.DlgWarningTitle, "Atencion");
            textTranslatedPage.Add(StringCode.DlgErrorTitle, "Error");
            textTranslatedPage.Add(StringCode.DlgQuestionTitle, "cuestion");
        }
コード例 #4
0
        /// <summary>
        /// create all translations.
        /// </summary>
        private void CreateTranslation_en_GB()
        {
            // create the page for the cultureInfo
            TranslatedTextPage textTranslatedPage = new TranslatedTextPage(CultureCode.en_GB);

            _dictTextTranslatedPage.Add(CultureCode.en_GB, textTranslatedPage);

            textTranslatedPage.Add(StringCode.Ok, "Ok");
            textTranslatedPage.Add(StringCode.Cancel, "Cancel");

            textTranslatedPage.Add(StringCode.No, "No");
            textTranslatedPage.Add(StringCode.Yes, "Yes");
            textTranslatedPage.Add(StringCode.Close, "Close");

            textTranslatedPage.Add(StringCode.DlgInformationTitle, "Information");
            textTranslatedPage.Add(StringCode.DlgWarningTitle, "Warning");
            textTranslatedPage.Add(StringCode.DlgErrorTitle, "Error");
            textTranslatedPage.Add(StringCode.DlgQuestionTitle, "Question");
        }