mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-25 08:38:30 -05:00
Merge pull request #3 from tmickel/localization-codes
Use short localization codes
This commit is contained in:
commit
75a36adfe4
5 changed files with 8 additions and 6 deletions
1
android/ScratchJr/app/src/.gitignore
vendored
1
android/ScratchJr/app/src/.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
/official
|
||||
/arc
|
||||
/pbs
|
||||
|
|
|
@ -17,10 +17,10 @@ window.Settings = {
|
|||
categoryStopColor: '#D62222',
|
||||
paletteBlockShadowOpacity: 0.8,
|
||||
autoSaveInterval: 30 * 1000,
|
||||
defaultLocale: 'en-US',
|
||||
defaultLocale: 'en',
|
||||
defaultLocaleShort: 'en',
|
||||
supportedLocales: {
|
||||
'English': 'en-US',
|
||||
'Español': 'es-AR'
|
||||
'English': 'en',
|
||||
'Español': 'es'
|
||||
}
|
||||
};
|
||||
|
|
|
@ -46,12 +46,13 @@ Localization.includeLocales = function () {
|
|||
} else {
|
||||
Localization.currentLocale = localizationCookie;
|
||||
}
|
||||
|
||||
var topLevel = Localization.currentLocale.split('-')[0];
|
||||
// Intl locale-data
|
||||
document.write('<script src="' + Localization.root +
|
||||
'jssource/external/Intl/locale-data/jsonp/' + Localization.currentLocale + '.js"><\/script>');
|
||||
'jssource/external/Intl/locale-data/jsonp/' + topLevel + '.js"><\/script>');
|
||||
|
||||
// MessageFormat locale-data
|
||||
var topLevel = Localization.currentLocale.split('-')[0];
|
||||
document.write('<script src="' + Localization.root +
|
||||
'jssource/external/intl-messageformat/locale-data/' + topLevel + '.js"><\/script>');
|
||||
|
||||
|
@ -63,7 +64,7 @@ Localization.includeLocales = function () {
|
|||
|
||||
// Get messages synchronously
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', Localization.root + 'localizations/' + Localization.currentLocale + '.json', false);
|
||||
xhr.open('GET', Localization.root + 'localizations/' + topLevel + '.json', false);
|
||||
xhr.send(null);
|
||||
Localization.localizationMessages = JSON.parse(xhr.responseText);
|
||||
|
||||
|
|
Loading…
Reference in a new issue