public static string Get(string englishText) { string language = UserSettings.Instance.get("Language"); if (language == null) { language = "en"; UserSettings.Instance.set("Language", "en"); } string pathToTranslationsFolder = "Translations"; // Fall back to english if translation data isn't available if (!StaticData.Instance.DirectoryExists(pathToTranslationsFolder)) { return(englishText); } if (MatterControlTranslationMap == null) { MatterControlTranslationMap = new TranslationMap(pathToTranslationsFolder, language); } #if DEBUG_SHOW_TRANSLATED_STRINGS && DEBUG return("El " + englishText + " o"); #endif return(MatterControlTranslationMap.Translate(englishText)); }
static LocalizedString() { lock (syncRoot) { if (MatterControlTranslationMap == null) { #if DEBUG && !__ANDROID__ // In debug builds we load a translation map capable of generating/updating master.txt MatterControlTranslationMap = new AutoGeneratingTranslationMap("Translations", UserSettings.Instance.Language); #else MatterControlTranslationMap = new TranslationMap("Translations", UserSettings.Instance.Language); #endif } } }
static LocalizedString() { lock(syncRoot) { if (MatterControlTranslationMap == null) { #if DEBUG && !__ANDROID__ // In debug builds we load a translation map capable of generating/updating master.txt MatterControlTranslationMap = new AutoGeneratingTranslationMap("Translations", UserSettings.Instance.Language); #else MatterControlTranslationMap = new TranslationMap("Translations", UserSettings.Instance.Language); #endif } } }
public static string Get(string englishText) { string language = UserSettings.Instance.get("Language"); if (language == null) { language = "en"; UserSettings.Instance.set("Language", "en"); } if (MatterControlTranslationMap == null) { string pathToTranslationsFolder = "Translations"; MatterControlTranslationMap = new TranslationMap(pathToTranslationsFolder, language); } #if DEBUG_SHOW_TRANSLATED_STRINGS && DEBUG return "El " + englishText + " o"; #endif return MatterControlTranslationMap.Translate(englishText); }
public static string Get(string englishText) { string language = UserSettings.Instance.get("Language"); if (language == null) { language = "en"; UserSettings.Instance.set("Language", "en"); } if (MatterControlTranslationMap == null) { string pathToTranslationsFolder = "Translations"; MatterControlTranslationMap = new TranslationMap(pathToTranslationsFolder, language); } #if DEBUG_SHOW_TRANSLATED_STRINGS && DEBUG return("El " + englishText + " o"); #endif return(MatterControlTranslationMap.Translate(englishText)); }
public static void ResetTranslationMap() { MatterControlTranslationMap = null; }
public static void ResetTranslationMap() { MatterControlTranslationMap = new TranslationMap("Translations", UserSettings.Instance.Language); }