mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2025-02-17 17:01:12 -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
|
/official
|
||||||
|
/arc
|
||||||
/pbs
|
/pbs
|
||||||
|
|
|
@ -17,10 +17,10 @@ window.Settings = {
|
||||||
categoryStopColor: '#D62222',
|
categoryStopColor: '#D62222',
|
||||||
paletteBlockShadowOpacity: 0.8,
|
paletteBlockShadowOpacity: 0.8,
|
||||||
autoSaveInterval: 30 * 1000,
|
autoSaveInterval: 30 * 1000,
|
||||||
defaultLocale: 'en-US',
|
defaultLocale: 'en',
|
||||||
defaultLocaleShort: 'en',
|
defaultLocaleShort: 'en',
|
||||||
supportedLocales: {
|
supportedLocales: {
|
||||||
'English': 'en-US',
|
'English': 'en',
|
||||||
'Español': 'es-AR'
|
'Español': 'es'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -46,12 +46,13 @@ Localization.includeLocales = function () {
|
||||||
} else {
|
} else {
|
||||||
Localization.currentLocale = localizationCookie;
|
Localization.currentLocale = localizationCookie;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var topLevel = Localization.currentLocale.split('-')[0];
|
||||||
// Intl locale-data
|
// Intl locale-data
|
||||||
document.write('<script src="' + Localization.root +
|
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
|
// MessageFormat locale-data
|
||||||
var topLevel = Localization.currentLocale.split('-')[0];
|
|
||||||
document.write('<script src="' + Localization.root +
|
document.write('<script src="' + Localization.root +
|
||||||
'jssource/external/intl-messageformat/locale-data/' + topLevel + '.js"><\/script>');
|
'jssource/external/intl-messageformat/locale-data/' + topLevel + '.js"><\/script>');
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@ Localization.includeLocales = function () {
|
||||||
|
|
||||||
// Get messages synchronously
|
// Get messages synchronously
|
||||||
var xhr = new XMLHttpRequest();
|
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);
|
xhr.send(null);
|
||||||
Localization.localizationMessages = JSON.parse(xhr.responseText);
|
Localization.localizationMessages = JSON.parse(xhr.responseText);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue