Пример #1
0
        //TODO: fine tune fall back logic
        internal ContentItem FindContentItem(string key)
        {
            // what is my culture?
            var myCulture = CultureInfo.CurrentUICulture;

            // Do we have it on the first try
            var item = _source.GetContentItem(key, myCulture.Name);

            if (item == null && !myCulture.IsNeutralCulture && myCulture.Name != _defaultCultureCode)
            {
                item = _source.GetContentItem(key, myCulture.TwoLetterISOLanguageName);
            }

            // If we are not in the default culture code
            if (item == null && myCulture.Name != _defaultCultureCode)
            {
                item = _source.GetContentItem(key, _defaultCultureCode);
            }

            return(item);
        }