Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Change culture fallback to depth-first #177

Merged
merged 1 commit into from
Dec 17, 2015

Conversation

DamianEdwards
Copy link
Member

After talking to some folks we think depth-first is a better approach here (i.e. more useful).

@lodejard @ryanbrandenburg @rynowak @miloush
#112

// Trim the trailing section from the culture name, e.g. "fr-FR" becomes "fr"
var parentCultureName = cultureName.Substring(0, lastIndexOfHyphen);

culture = GetCultureInfo(parentCultureName, supportedCultures, fallbackToAncestorCulture, currentDepth + 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely a lot cleaner this way.

@ryanbrandenburg
Copy link
Contributor

This looks pretty good, the only thing I might say is that we could note on the Fallback option doc-comment that this is "best effort" and won't ALWAYS give you every possible parent. Otherwise I'd say :shipit:

@DamianEdwards DamianEdwards force-pushed the damianedwards/culture-fallback branch 2 times, most recently from bbd197e to b041a07 Compare December 17, 2015 00:11
@DamianEdwards DamianEdwards merged commit b041a07 into dev Dec 17, 2015
@DamianEdwards DamianEdwards deleted the damianedwards/culture-fallback branch December 17, 2015 00:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants