public DictionaryInfo SetGTextByCode(string Owner, string Block, string code) { string pjblock = Utility.Text.Format("{0}{1}", Owner, Block); DictionaryInfo dictionaryInfo = RefreshGTextInfo(pjblock, code); return(RefreshGTextInfo(pjblock, code)); }
public void UpdateDicInfo(DictionaryInfo dictionaryInfo) { if (Dictionary.ContainsKey(dictionaryInfo.Key)) { Dictionary[dictionaryInfo.Key] = dictionaryInfo; } else { Dictionary.Add(dictionaryInfo.Key, dictionaryInfo); } }
public DictionaryInfo GetGtextInfo(string pjblock, string key) { FBlockInfo fBlockInfo = null; DictionaryInfo dictionaryInfo = null; if (BlockInfoDic.TryGetValue(pjblock, out fBlockInfo)) { if (fBlockInfo.Dictionary.TryGetValue(key, out dictionaryInfo)) { return(dictionaryInfo); } } return(null); }
public void SetGRichTextByCode(GRichTextField gTextField, string code) { string pjblock = Utility.Text.Format("{0}{1}", gTextField.Owner, gTextField.Block); DictionaryInfo dictionaryInfo = RefreshGTextInfo(pjblock, code); if (dictionaryInfo != null) { gTextField.text = dictionaryInfo.Value; if (dictionaryInfo.Size > 0) { gTextField.textFormat.size = dictionaryInfo.Size; } if (dictionaryInfo.NewLine) { gTextField.text = gTextField.text.Replace("**", System.Environment.NewLine); } } }
/// <summary> /// 注册字体组件到多语言 /// </summary> /// <param name="gTextInput">GTextInput</param> public void RegToLocalization(GTextInput gTextInput) { string pjblock = Utility.Text.Format("{0}{1}", gTextInput.Owner, gTextInput.Block); DictionaryInfo dictionaryInfo = RefreshGTextInfo(pjblock, gTextInput.key); if (dictionaryInfo != null) { gTextInput.promptText = dictionaryInfo.Value; if (dictionaryInfo.Size > 0) { gTextInput.textFormat.size = dictionaryInfo.Size; } if (dictionaryInfo.NewLine) { gTextInput.text = gTextInput.text.Replace("**", System.Environment.NewLine); } } }