public void CreateTestLocalizationSettings()
        {
            m_Settings = LocalizationSettings.CreateDefault();
            LocalizationSettings.Instance = m_Settings;

            var simpleLocalesProvider = ScriptableObject.CreateInstance <SimpleLocalesProvider>();

            m_Settings.SetAvailableLocales(simpleLocalesProvider);
            var sl = LocalizationSettings.AvailableLocales;

            sl.AddLocale(Locale.CreateLocale(new LocaleIdentifier(SystemLanguage.Arabic)));
            sl.AddLocale(Locale.CreateLocale(new LocaleIdentifier(SystemLanguage.English)));
            sl.AddLocale(Locale.CreateLocale(new LocaleIdentifier(SystemLanguage.French)));
            sl.AddLocale(Locale.CreateLocale(new LocaleIdentifier(SystemLanguage.German)));
            sl.AddLocale(Locale.CreateLocale(new LocaleIdentifier(SystemLanguage.Japanese)));
        }
Пример #2
0
 public void NullAvailableLocalesProducesError()
 {
     m_Settings.SetAvailableLocales(null);
     Assert.IsNull(m_Settings.GetSelectedLocale(), "Expected no locale to be returned.");
     LogAssert.Expect(LogType.Error, "AvailableLocales is null, can not pick a Locale.");
 }