public string GetTextForKey(StringToken key) { var localizationKey = key.ToLocalizationKey(); return(_localeCache .Retrieve(localizationKey, () => _missingHandler.FindMissingText(key, _localeCache.Culture))); }
private TextAndCulture FindTextViaHierarchy(StringToken token, CultureInfo culture) { var text = _localeCache[culture].Get(token.ToLocalizationKey(), () => { if (culture.Parent == CultureInfo.InvariantCulture || culture == culture.Parent) { return(_missingHandler.FindMissingText(token, culture)); } return(null); }); if (text == null && (culture.Parent != CultureInfo.InvariantCulture && culture != culture.Parent)) { return(FindTextViaHierarchy(token, culture.Parent)); } return(new TextAndCulture(text, culture)); }