示例#1
0
        public static void Add(string key, string value)
        {
            if (mMsg == null)
            {
                BlockResMgr.Get().LoadI18n();
            }

            mMsg[key] = value;
        }
示例#2
0
        public static bool Contains(string key)
        {
            if (mMsg == null)
            {
                BlockResMgr.Get().LoadI18n();
            }

            return(mMsg.ContainsKey(key));
        }
示例#3
0
        public static string Get(string key)
        {
            if (mMsg == null)
            {
                BlockResMgr.Get().LoadI18n();
            }

            string value;

            if (mMsg.TryGetValue(key, out value))
            {
                return(value);
            }

            throw new Exception("I18n file doesn't contain translation for key: " + key);
        }
示例#4
0
 /// <summary>
 /// Initialize blockly model. Called very first when start blockly
 /// </summary>
 public static void Init()
 {
     BlockResMgr.Get().LoadI18n(I18n.EN);
     BlockResMgr.Get().LoadJsonDefinitions();
 }
示例#5
0
 /// <summary>
 /// Initialize blockly model. Called very first when start blockly
 /// </summary>
 public static void Init(bool localize = true)
 {
     BlockResMgr.Get().LoadI18n(localize);
     BlockResMgr.Get().LoadJsonDefinitions();
 }