示例#1
0
        public void RemoveSpecialization(int idx, string specialization)
        {
            var text = Languages[idx];

            if (specialization == "Any" || !text.Contains("[i2s_" + specialization + "]"))
            {
                return;
            }

            var dict = SpecializationManager.GetSpecializations(text);

            dict.Remove(specialization);
            Languages[idx] = SpecializationManager.SetSpecializedText(dict);
        }
        public static string RebuildTranslation(string text, TranslationDictionary dict, string LanguageCodeTo)
        {
            if (!text.Contains("[i2s_"))
            {
                return(RebuildTranslation_Plural(text, dict, LanguageCodeTo));
            }

            var variants = SpecializationManager.GetSpecializations(text);
            var results  = new Dictionary <string, string>();

            foreach (var kvp in variants)
            {
                results[kvp.Key] = RebuildTranslation_Plural(kvp.Value, dict, LanguageCodeTo);
            }
            return(SpecializationManager.SetSpecializedText(results));
        }
示例#3
0
 public void SetTranslation(int idx, string translation, string specialization = null)
 {
     Languages[idx] = SpecializationManager.SetSpecializedText(Languages[idx], translation, specialization);
 }