Esempio n. 1
0
        protected void LoadTranslations()
        {
            string translationDir = Path.Combine(Paths.PluginPath, "translation");

            if (!Directory.Exists(translationDir))
            {
                Logger.Log(LogLevel.Debug, "Creating translation directory");
                Directory.CreateDirectory(translationDir);
            }
            else
            {
                try
                {
                    TextTranslator.Initialize(translationDir);
                }
                catch (TranslatorException)
                {
                    Logger.Log(LogLevel.Error, "Unable to initialize translator");
                }
            }
        }
Esempio n. 2
0
 public void Update()
 {
     // Keypress handlers
     if (Input.GetKeyDown(KeyCode.F10))
     {
         try
         {
             TextTranslator.Reload();
             Logger.Log(LogLevel.Info, "Reloaded translations");
         }
         catch (TranslatorException)
         {
             Logger.Log(LogLevel.Error, "Failed to reload translations");
         }
     }
     else if (Input.GetKeyDown(KeyCode.F9))
     {
         TextTranslator.DumpMissingTranslations();
         Logger.Log(LogLevel.Info, "Dumped missing translations");
     }
 }
Esempio n. 3
0
 public static void ADV_Loader_LineLoad_PostHook(ADV_Loader __instance)
 {
     __instance.Name = TextTranslator.Translate(TranslationDomain.D_ADV, __instance.Name);
     __instance.Text = TextTranslator.Translate(TranslationDomain.D_ADV, __instance.Text);
 }