public static TranslationLeaf getLeaf(string language, TranslationReference reference) { if (string.IsNullOrEmpty(language) || !reference.isValid) { return(null); } Dictionary <string, Translation> dictionary; TranslationLeaf translationLeaf; Translation translation; if (!Translator.languages.TryGetValue(language, out dictionary)) { translationLeaf = null; } else if (!dictionary.TryGetValue(reference.ns, out translation)) { translationLeaf = null; } else { translationLeaf = translation.getLeaf(reference.token); } if (translationLeaf != null) { return(translationLeaf); } if (language == Translator.ORIGIN_LANGUAGE) { Translator.misses.Add(reference); return(null); } return(Translator.getLeaf(Translator.ORIGIN_LANGUAGE, reference)); }
// Token: 0x06000F27 RID: 3879 RVA: 0x00067911 File Offset: 0x00065D11 public TranslatedText(TranslationReference newReference) { this.args = null; this.text = null; this._reference = newReference; this.beginListening(); }
public static string translate(TranslationReference reference) { TranslationLeaf leaf = Translator.getLeaf(reference); if (leaf != null) { return(leaf.text); } return(reference.ToString()); }
public static TranslationLeaf addLeaf(TranslationReference reference) { if (!reference.isValid) { return(null); } Dictionary <string, Translation> dictionary; if (!Translator.languages.TryGetValue(Translator.ORIGIN_LANGUAGE, out dictionary)) { return(null); } Translation translation; if (!dictionary.TryGetValue(reference.ns, out translation)) { return(null); } return(translation.addLeaf(reference.token)); }
public static TranslationLeaf getLeaf(TranslationReference reference) { return(Translator.getLeaf(Translator.language, reference)); }