MediaWiki:DonationFormSandbox.js: Difference between revisions

Content deleted Content added
No edit summary
drop anything after '-' in language
Line 29:
language = 'en';
}
// MediaWiki allows if (some language ===codes like 'en-gb', )en-ca, {pt-br
// We don't want these for a javascript locale, so drop anything after '-'
language = 'en';
language = language.split('-')[0];
}
if ( language === 'en-ca' ) {
language = 'en';
}
if ( language === 'es-419' ) {
language = 'es';
}
if ( language === 'pt-br' ) {
language = 'pt';
}
return language + '-' + country;
};