private static void ImportFileToDefaultGroupAndSourceLanguageDB() //does not import it to a group { TextAsset ta = Selection.activeObject as TextAsset; if (ta == null) { Debug.LogError("Selected item is not a text asset"); return; } string[] toSplit = new string[] { "\n", "\r\n" }; string[] newKeys = ta.text.Split(toSplit, StringSplitOptions.RemoveEmptyEntries); var dic = new Dictionary <string, string>(); foreach (string key in newKeys) { if (!dic.ContainsKey(key)) { dic.Add(key, key); } } var translationConfig = ResourceLoadFacade.LoadConfigGroup(""); var currentSet = GameTranslationGetter.GetTranslaitonSetFromLanguageCode(translationConfig.sourceLanguage.code); currentSet.mergeInSet("", dic); /* * var languageCodeList = new List<string> { translationConfig.sourceLanguage.code }; * translationConfig.destinationLanguages.ForEach((TransfluentLanguage lang) => { languageCodeList.Add(lang.code); }); * * DownloadAllGameTranslations.uploadTranslationSet(languageCodeList, translationConfig.translation_set_group); */ }
public static TranslationConfigurationSO getOrCreateGameTranslationConfig(string groupid) { string fileName = ResourceLoadFacade.TranslationConfigurationSOFileNameFromGroupID(groupid); TranslationConfigurationSO config = ResourceLoadFacade.LoadConfigGroup(groupid) ?? ResourceCreator.CreateSO <TranslationConfigurationSO>(fileName); config.translation_set_group = groupid; return(config); }
public void addToDB(string key, string value) { string currentGroup = _translationDB.groupBeingShown; TranslationConfigurationSO config = ResourceLoadFacade.LoadConfigGroup(_translationDB.groupBeingShown); Dictionary <string, string> translationDictionary = _translationDB.allKnownTranslations; GameTranslationSet gameTranslationSet = GameTranslationGetter.GetTranslaitonSetFromLanguageCode(config.sourceLanguage.code); bool exists = translationDictionary.ContainsKey(key); if (!exists) { translationDictionary.Add(key, key); } gameTranslationSet.mergeInSet(currentGroup, translationDictionary); //_translationDB.allKnownTranslations.Add(key,value); }
// Use this for initialization private void Start() { config = ResourceLoadFacade.LoadConfigGroup(""); populateKnownTranslationsInGroup(); TranslationUtility.changeStaticInstanceConfig("xx-xx"); }