Exemple #1
0
 public void Teardown()
 {
     // Delete GameObject first as it will call into LocalizationSettings during cleanup.
     Object.DestroyImmediate(m_GameObject);
     Object.DestroyImmediate(LocalizationSettings.Instance);
     LocalizationSettingsHelper.RestoreSettings();
 }
Exemple #2
0
 public void CreateTestLocalizationSettings()
 {
     m_Settings        = LocalizationSettingsHelper.CreateEmpty();
     m_LocalesProvider = m_Settings.GetAvailableLocales();
     m_LocalesProvider.AddLocale(Locale.CreateLocale(SystemLanguage.Arabic));
     m_LocalesProvider.AddLocale(Locale.CreateLocale(SystemLanguage.English));
     m_LocalesProvider.AddLocale(Locale.CreateLocale(SystemLanguage.French));
     m_LocalesProvider.AddLocale(Locale.CreateLocale(SystemLanguage.German));
     m_LocalesProvider.AddLocale(Locale.CreateLocale(SystemLanguage.Japanese));
 }
Exemple #3
0
        public void CreateTestLocalizationSettings()
        {
            LocalizationSettingsHelper.SaveCurrentSettings();

            m_Settings           = ScriptableObject.CreateInstance <LocalizationSettings>();
            m_TempAssetDatabase  = new LocalizedAssetDatabase();
            m_TempStringDatabase = new LocalizedStringDatabase();

            LocalizationSettings.Instance       = m_Settings;
            LocalizationSettings.AssetDatabase  = m_TempAssetDatabase;
            LocalizationSettings.StringDatabase = m_TempStringDatabase;
        }
Exemple #4
0
        public void Setup()
        {
            LocalizationSettingsHelper.SaveCurrentSettings();

            LocalizationSettings.Instance      = ScriptableObject.CreateInstance <LocalizationSettings>();
            m_FixtureAssetDatabase             = new FixtureAssetDatabase();
            LocalizationSettings.AssetDatabase = m_FixtureAssetDatabase;

            m_GameObject           = new GameObject(nameof(ChangingLocalizedAssetEventUpdatesValues));
            m_LocalizeTextureEvent = m_GameObject.AddComponent <LocalizeTextureEvent>();

            // Setup with a default value so we do not start with an empty StringReference.
            m_LocalizeTextureEvent.AssetReference.SetReference(kDefaultTableCollectionName, kDefaultEntryName);
            ClearLastGetTableEntryValues();
        }
        public void Init()
        {
            m_OriginalSettings            = LocalizationSettings.Instance;
            m_TestSettings                = LocalizationSettingsHelper.CreateEmpty();
            LocalizationSettings.Instance = m_TestSettings;

            // Add the test locales
            var localeProvider = m_TestSettings.GetAvailableLocales();

            testLanguages.ForEach(o => localeProvider.AddLocale(Locale.CreateLocale(o)));

            PlayerPrefs.DeleteKey(k_PlayerPrefKey);
            m_PlayerPrefLocaleSelector = new PlayerPrefLocaleSelector {
                PlayerPreferenceKey = k_PlayerPrefKey
            };
            m_TestSettings.GetStartupLocaleSelectors().Add(m_PlayerPrefLocaleSelector);
        }
Exemple #6
0
        public void Setup()
        {
            LocalizationSettingsHelper.SaveCurrentSettings();

            LocalizationSettings.Instance = ScriptableObject.CreateInstance <LocalizationSettings>();

            var localeProvider = new TestLocaleProvider();

            m_Selected = Locale.CreateLocale("en");
            localeProvider.AddLocale(m_Selected);
            LocalizationSettings.Instance.SetAvailableLocales(localeProvider);

            m_FixtureStringDatabase             = new FixtureStringDatabase();
            LocalizationSettings.StringDatabase = m_FixtureStringDatabase;

            m_FixtureStringDatabase.NoTranslationFoundMessage = "No translation found for '{key}'";
            m_GameObject          = new GameObject(nameof(ChangingLocalizedStringUpdatesValues));
            m_LocalizeStringEvent = m_GameObject.AddComponent <LocalizeStringEvent>();

            // Setup with a default value so we do not start with an empty StringReference.
            m_LocalizeStringEvent.StringReference.SetReference(kDefaultTableCollectionName, kDefaultEntryName);
            ClearLastGetTableEntryValues();
        }
Exemple #7
0
 public void Teardown()
 {
     Object.DestroyImmediate(m_Settings);
     LocalizationSettingsHelper.RestoreSettings();
 }