public void sendPlayerPlatformData()
    {
        SmartLocalization.LanguageManager  languageManager = SmartLocalization.LanguageManager.Instance;
        SmartLocalization.SmartCultureInfo deviceCulture   = languageManager.GetDeviceCultureIfSupported();

        Analytics.CustomEvent("Player data", new Dictionary <string, object> {
            { "Player language", deviceCulture.nativeName },
            { "Player device type", SystemInfo.deviceType.ToString() },
            { "Player operation system", SystemInfo.operatingSystem },
        });
    }
示例#2
0
 void setUpGameLanguage()
 {
     SmartLocalization.LanguageManager  languageManager = SmartLocalization.LanguageManager.Instance;
     SmartLocalization.SmartCultureInfo deviceCulture   = languageManager.GetDeviceCultureIfSupported();
     //deviceCulture.languageCode = "ru";
     if (deviceCulture != null)
     {
         languageManager.ChangeLanguage(deviceCulture);
     }
     SmartLocalization.LanguageManager.SetDontDestroyOnLoad();
 }
示例#3
0
    void setUpGameName()
    {
        SmartLocalization.LanguageManager  languageManager = SmartLocalization.LanguageManager.Instance;
        SmartLocalization.SmartCultureInfo deviceCulture   = languageManager.CurrentlyLoadedCulture;

        if (deviceCulture.languageCode == "ru")
        {
            russianGameName.gameObject.SetActive(true);
            englishGameName.gameObject.SetActive(false);
        }
        else
        {
            russianGameName.gameObject.SetActive(false);
            englishGameName.gameObject.SetActive(true);
        }
    }
        void Awake()
        {
            SmartLocalization.LanguageManager languageManager = SmartLocalization.LanguageManager.Instance;

            //Subscribe to the change language event
            languageManager.OnChangeLanguage += OnChangeLanguage;

            foreach (LanguageConversionData i in systemLanguages)
            {
                if (Application.systemLanguage == i.systemLanguage)
                {
                    SmartLocalization.LanguageManager.Instance.ChangeLanguage(i.smartLocalizationKey);
                    return;
                }
            }



            //Run the method one first time if no language correspondance found.
            ChangeLanguage(SmartLocalization.LanguageManager.Instance.defaultLanguage);
        }