public static LangDictionary AddDictionary(string anAliasName, string anAssetPath){ if(DictionaryExists(anAliasName)) dictionaries.Remove(GetDictionary(anAliasName)); LangDictionary result = new LangDictionary(anAliasName, anAssetPath); dictionaries.Add(result); Debug.Log("DICTIONARY ADD : " + anAliasName + " RESOURCE PATH : " + anAssetPath); return result; }
static void Main(string[] args) { var lang = new LangDictionary("fr"); lang.Import("input\\lang\\i18n_fr.d2i"); Console.WriteLine(lang.Get(114, false)); Console.WriteLine(lang.Get(114, true)); Console.WriteLine("Done"); Console.ReadLine(); }
public static LangDictionary AddDictionary(string anAliasName, string anAssetPath) { if (DictionaryExists(anAliasName)) { dictionaries.Remove(GetDictionary(anAliasName)); } LangDictionary result = new LangDictionary(anAliasName, anAssetPath); dictionaries.Add(result); Debug.Log("DICTIONARY ADD : " + anAliasName + " RESOURCE PATH : " + anAssetPath); return(result); }
private async Task AppendLangDictionary(string id, string longLangName) { LangDictionary langEntity = await _langDictionaryRepository.GetByIdAsync(id); if (langEntity == null) { await _langDictionaryRepository.AddAsync(new LangDictionary() { Id = id, LongName = longLangName }); await _langDictionaryRepository.SaveAsync(); } }
public static string GetText(string aDictionaryAliasName, string anId, string aDefaultValue = "") { if (DictionaryExists(aDictionaryAliasName)) { LangDictionary dictionary = GetDictionary(aDictionaryAliasName); return(dictionary.GetText(anId, aDefaultValue)); } else { Debug.LogWarning( "DICTIONARY NOT FOUND - GET TEXT : " + (string.IsNullOrEmpty(anId) ? "EMPTY ID" : anId) + "\n" + "IN DICTIONARY : " + (string.IsNullOrEmpty(aDictionaryAliasName) ? "EMPTY ALIASNAME" : aDictionaryAliasName) + "\n" + "DEFAULT VALUE : " + (string.IsNullOrEmpty(aDefaultValue) ? "EMPTY DEFAULT VALUE" : aDefaultValue) ); return(aDefaultValue); } }