sproutcore/sproutcore — pull request #1196 by nicolasbadia (2014-03-28 09:33:28+00:00)
Title: Improves localization support

This PR adds two new methods: `SC.hashesForLocale` and `SC.methodForLocale` in order to be able to register constants and functions to a locale.

It also adds inflection constants for french and spanish languages, and an ordinal function for the french language.

#### Problems

This PR is breaking tests because the default english ordinal function is now defined in a local .lproj file. The breaking tests assume that japanese should use the english ordinal function since there is no ordinal function defined in japanese.
In order to properly fix this, we have to solve 2 issues first:
- The first is for testing the localized methods. When the preferred language is dynamically changed in a test, the dependent local files are not load.
- The second is when there is no localized file defined for a language.

#### Possible solutions
After discussing this with @dcporter we thought of 2 possible solutions:

For the first issue the best solution may be to add a feature allowing dynamical change of a language at runtime. But this is gone be some work...

For the second one, we could add support for a default.lproj directory which would be used if there is no local method for a particular language. This will require change to the build tools.

Thought ?
Should I comment the failing tests until solutions are found, so we can commit this PR ?