Ejemplo n.º 1
0
        public void Create_PreferredUiLanguageIsGenericVariant_CreatesLocalizationManagerForSpecificVariant(
            string genericLocaleId, string countrySpecificLocalId)
        {
            LocalizationManager.ClearLoadedManagers();
            var dir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
            var lm  = LocalizationManager.Create(TranslationMemory.XLiff, genericLocaleId, "Test", "Test", "1.0",
                                                 Path.Combine(dir, "../../../src/L10NSharpTests/TestXliff2"), "", null, "");

            Assert.AreEqual($"Protección de configuraciones ({genericLocaleId})...",
                            lm.GetLocalizedString("SettingsProtection.LauncherButtonLabel", "don't use this"));
            // The next two lines prove that the test data was not changed in a way that nullifies the expected pre-conditions
            Assert.IsFalse(lm.GetAvailableUILanguageTags().Contains(genericLocaleId));
            Assert.IsTrue(lm.GetAvailableUILanguageTags().Contains(countrySpecificLocalId));
        }
 public virtual void Setup()
 {
     LocalizationManager.ClearLoadedManagers();
 }