コード例 #1
0
        public static string Get(LocalizationKey key, params object[] parameters)
        {
            if (parameters.Length == key.parameters)
            {
                var value = LocalizationSystem.Get(key.key, LocalizationSystem.GetCurrentLanguage());
                if (key.formatWithDeclension == true)
                {
                    return(LocalizationSystem.FormatWithDeclension(value, returnWithNumber: !key.outputDeclensionWithoutNumber, parameters: parameters));
                }

                return(string.Format(value, parameters));
            }
            else
            {
                WindowSystemLogger.Warning(LocalizationSystem.GetName(), string.Format("Wrong parameters length in key `{0}`", key.key));
            }

            return(key.key);
        }
コード例 #2
0
        public static string Get(LocalizationKey key, params object[] parameters)
        {
            if (parameters != null && parameters.Length == key.parameters)
            {
                var lang  = LocalizationSystem.GetCurrentLanguage();
                var value = LocalizationSystem.Get(key.key, lang);
                if (key.formatWithDeclension == true)
                {
                    return(LocalizationSystem.ArabicCheck(LocalizationSystem.FormatWithDeclension(value, returnWithNumber: !key.outputDeclensionWithoutNumber, parameters: parameters), lang));
                }

                return(LocalizationSystem.ArabicCheck(string.Format(value, parameters), lang));
            }
            else
            {
                if (LocalizationSystem.instance.logEnabled == true)
                {
                    WindowSystemLogger.Warning(LocalizationSystem.GetName(), string.Format("Wrong parameters length in key `{0}`", key.key));
                }
            }

            return(key.key);
        }
コード例 #3
0
 public static string Get(LocalizationKey key, UnityEngine.SystemLanguage language)
 {
     return(LocalizationSystem.Get(key.key, language));
 }
コード例 #4
0
        public static Sprite GetSprite(LocalizationKey key, params object[] parameters)
        {
            var sprite = UnityEngine.Resources.Load <Sprite>(LocalizationSystem.GetSpritePath(key, parameters));

            return(sprite as Sprite);
        }
コード例 #5
0
 public static string GetSpritePath(LocalizationKey key, params object[] parameters)
 {
     return(LocalizationSystem.Get(key, parameters).Trim());
 }
コード例 #6
0
			public ITextComponent SetText(Plugins.Localization.LocalizationKey key, params object[] parameters) {
	
				this.lastTextLocalization = true;
				this.lastTextLocalizationKey = key;
				this.lastTextLocalizationParameters = parameters;
	
				return this.SetText(Plugins.Localization.LocalizationSystem.Get(key, parameters));
	
			}
コード例 #7
0
			public void SetImage(UnityEngine.UI.Windows.Plugins.Localization.LocalizationKey key, params object[] parameters) {
	
				this.lastImageLocalization = true;
				this.lastImageLocalizationKey = key;
				this.lastImageLocalizationParameters = parameters;
	
				this.SetImage(UnityEngine.UI.Windows.Plugins.Localization.LocalizationSystem.GetSprite(key, parameters));
	
			}
コード例 #8
0
			public IImageComponent SetImage(UnityEngine.UI.Windows.Plugins.Localization.LocalizationKey key, params object[] parameters) {
	
				this.lastImageLocalization = true;
				this.lastImageLocalizationKey = key;
				this.lastImageLocalizationParameters = parameters;
	
				//this.SetImage(UnityEngine.UI.Windows.Plugins.Localization.LocalizationSystem.GetSprite(key, parameters));
				WindowSystemResources.Unload(this, this.GetResource());
				WindowSystemResources.Load(this, onDataLoaded: null, onComplete: null, customResourcePath: UnityEngine.UI.Windows.Plugins.Localization.LocalizationSystem.GetSpritePath(key, parameters));
	
				return this;
	
			}