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)); }
public void SetTranslation(int idx, string translation, string specialization = null) { Languages[idx] = SpecializationManager.SetSpecializedText(Languages[idx], translation, specialization); }