AddPhrase() public method

public AddPhrase ( string phraseName ) : LeanPhrase
phraseName string
return LeanPhrase
Example #1
0
        private static void MergeLocalizations(LeanLocalization oldLocalization, LeanLocalization newLocalization)
        {
            // Go through all old phrases
            for (var i = oldLocalization.Phrases.Count - 1; i >= 0; i--)
            {
                var oldPhrase = oldLocalization.Phrases[i];
                var newPhrase = newLocalization.AddPhrase(oldPhrase.Name);

                // Go through all old translations
                for (var j = oldPhrase.Translations.Count - 1; j >= 0; j--)
                {
                    var oldTranslation = oldPhrase.Translations[j];
                    var newTranslation = newPhrase.AddTranslation(oldTranslation.Language);

                    newTranslation.Text   = oldTranslation.Text;
                    newTranslation.Object = oldTranslation.Object;
                }
            }
        }
        private static void MergeLocalizations(LeanLocalization oldLocalization, LeanLocalization newLocalization)
        {
            // Go through all old phrases
            for (var i = oldLocalization.Phrases.Count - 1; i >= 0; i--)
            {
                var oldPhrase = oldLocalization.Phrases[i];
                var newPhrase = newLocalization.AddPhrase(oldPhrase.Name);

                // Go through all old translations
                for (var j = oldPhrase.Translations.Count - 1; j >= 0; j--)
                {
                    var oldTranslation = oldPhrase.Translations[j];
                    var newTranslation = newPhrase.AddTranslation(oldTranslation.Language);

                    newTranslation.Text   = oldTranslation.Text;
                    newTranslation.Object = oldTranslation.Object;
                }
            }
        }