public void DoTranslate(string newRelativePath) { if (img == null) { img = GetComponent <Image>(); } relativePath = newRelativePath; img.sprite = LocalizationUtil.TranslateImg(relativePath); }
public void DoTranslate(string k, params LocalizationInsert[] ins) { string[] insertV = SZ; if (ins != null) { int len = ins.Length; insertV = new string[len]; for (int i = 0; i < len; ++i) { insertV[i] = ins[i].Translate(); } } if (text == null) { text = GetComponent <Text>(); } text.text = string.Format(LocalizationUtil.TranslateText(k), insertV); key = k; inserts = ins; }
public string Translate() { return(needTranslate ? LocalizationUtil.TranslateText(insert) : insert); }