Given that there is a locale called `ja-JP-mac` (http://mxr.mozilla.org/l10n-central/source/ja-JP-mac/), doesn't the regexp need to be: `/^[a-z]+(-[A-Z]+)+(-[a-z]+)?$/.test(navigator.language)`?