private static void OnEditorApplicationUpdate() { // Note that this is called very often (100/sec). Thus, code in here should be fast. if (triggerUpdate) { triggerUpdate = false; I18NManager i18nManager = I18NManager.Instance; if (i18nManager != null) { List <string> quotedChangedFiles = changedFiles.Distinct().Select(it => $"'{it}'").ToList(); string changedFilesCsv = string.Join(", ", quotedChangedFiles); changedFiles = new ConcurrentBag <string>(); Debug.Log("Reloading translations because of changed files: " + changedFilesCsv); i18nManager.UpdateCurrentLanguageAndTranslations(); } } }
public override void OnInspectorGUI() { I18NManager i18nManager = target as I18NManager; bool lastIsOverwriteLanguage = i18nManager.isOverwriteLanguage; SystemLanguage lastOverwriteLanguage = i18nManager.overwriteLanguage; DrawDefaultInspector(); if (GUILayout.Button("Update Translations in Scene")) { UpdateAllTranslations(); } if (GUILayout.Button("Reload Translations") || lastIsOverwriteLanguage != i18nManager.isOverwriteLanguage || lastOverwriteLanguage != i18nManager.overwriteLanguage) { i18nManager.UpdateCurrentLanguageAndTranslations(); } }