moment/moment — pull request #1142 by icambron (2013-09-28 22:24:22+00:00)
Title: Picking languages

Fix for #1108 and #1109. Here are the changes:

* `moment.lang()` and `moment().lang()` now accept an array of language strings, with the idea that we'll use the first one that works
* We now use language substrings. If the user specifies 'es-MX', we'll use 'es' if we don't have the MX one.
* The precedence between array items and substrings is that we'll try substrings of the same array item until we discover that the next item has something mores specific with the same root. E.g., we'll try `['es-MX', 'es-GU', 'fr-CA']` this order 'es-MX', 'es-GU', 'fr-CA', 'fr'. I think that's probably the most intuitive setup, because it allows you to describe specific alternatives without breaking general ones, and it seems unlikely you'd prefer a completely different language to a less localized version of the one you do want.