예제 #1
0
 public static void Init(string fileName)
 {
     if (ToolsLocalization.Ek)
     {
         Log.Fatal("ToolsLocalization: Init: Already initialized.");
     }
     if (VirtualFile.Exists(fileName))
     {
         ToolsLocalization.Ek = true;
         ToolsLocalization.EL = fileName;
         ToolsLocalization.EM = new Dictionary <string, ToolsLocalization.GroupItem>();
         ToolsLocalization.El = false;
         ToolsLocalization.A();
     }
 }
예제 #2
0
 public static string Translate(string groupName, string text)
 {
     if (ToolsLocalization.IsInitialized && !string.IsNullOrEmpty(text))
     {
         ToolsLocalization.GroupItem groupItem = ToolsLocalization.A(groupName);
         if (groupItem != null)
         {
             string text2;
             if (groupItem.em.TryGetValue(text, out text2))
             {
                 if (!string.IsNullOrEmpty(text2))
                 {
                     return(text2);
                 }
             }
             else
             {
                 ToolsLocalization.El = true;
                 groupItem.em.Add(text, "");
             }
         }
     }
     return(text);
 }