*
*
* [[languages.someProperty]]
*
*/
var SettingsLanguagesSingletonElement;
(function() {
'use strict';
// Translate server treats some language codes the same.
// See also: components/translate/core/common/translate_util.cc.
var kLanguageCodeToTranslateCode = {
'nb': 'no',
'fil': 'tl',
'zh-HK': 'zh-TW',
'zh-MO': 'zh-TW',
'zh-SG': 'zh-CN',
};
// Some ISO 639 language codes have been renamed, e.g. "he" to "iw", but
// Translate still uses the old versions. TODO(michaelpg): Chrome does too.
// Follow up with Translate owners to understand the right thing to do.
var kTranslateLanguageSynonyms = {
'he': 'iw',
'jv': 'jw',
};
var preferredLanguagesPrefName = cr.isChromeOS ?
'settings.language.preferred_languages' : 'intl.accept_languages';
/**
* Singleton element that generates the languages model on start-up and
* updates it whenever Chrome's pref store and other settings change. These
* updates propagate to each