Index: ps/trunk/binaries/data/mods/public/gui/locale/locale_advanced.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/locale/locale_advanced.xml (revision 20538)
+++ ps/trunk/binaries/data/mods/public/gui/locale/locale_advanced.xml (nonexistent)
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
Property changes on: ps/trunk/binaries/data/mods/public/gui/locale/locale_advanced.xml
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: ps/trunk/binaries/data/mods/public/gui/locale/locale_advanced.js
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/locale/locale_advanced.js (revision 20538)
+++ ps/trunk/binaries/data/mods/public/gui/locale/locale_advanced.js (nonexistent)
@@ -1,118 +0,0 @@
-function init(initData)
-{
- let languageList = Engine.GetGUIObjectByName("languageList");
- let countryList = Engine.GetGUIObjectByName("countryList");
- let resultingLocaleText = Engine.GetGUIObjectByName("resultingLocale");
- let scriptInput = Engine.GetGUIObjectByName("scriptInput");
-
- // get languageList data. Only list languages for which we have a dictionary.
- let languageListData = [];
- let languageListTmp = Engine.GetSupportedLocaleBaseNames();
- let currentLocaleLanguage = Engine.GetLocaleLanguage(initData.locale);
- for (let i = 0; i < languageListTmp.length; ++i)
- {
- let lang = Engine.GetLocaleLanguage(languageListTmp[i]);
- if (lang != "" && languageListData.indexOf(lang) == -1)
- languageListData.push(lang);
- }
-
-
- // get countryList data (we get all countries and not only the ones we have dictionaries for)
- var countryListData = [];
- countryListData.push(translateWithContext("localeCountry", "None"));
- var countryListTmp = Engine.GetAllLocales();
- var currentLocaleCountry = Engine.GetLocaleCountry(initData.locale);
- for (let i = 0; i < countryListTmp.length; ++i)
- {
- let country = Engine.GetLocaleCountry(countryListTmp[i]);
- if (country != "" && countryListData.indexOf(country) == -1)
- countryListData.push(country);
- }
- countryListData.sort();
-
- // fill the languageList
- languageList.list = languageListData;
- languageList.list_data = languageListData;
- if (languageList.list_data.indexOf(currentLocaleLanguage) != -1)
- languageList.selected = languageList.list_data.indexOf(currentLocaleLanguage);
-
- // fill the country list
- countryList.list = countryListData;
- countryList.list_data = countryListData;
- if (currentLocaleCountry != "")
- countryList.selected = countryList.list_data.indexOf(currentLocaleCountry);
- else
- countryList.selected = 0;
-
- // fill the script
- scriptInput.caption = Engine.GetLocaleScript(initData.locale);
-}
-
-// TODO: an onChanged event for input boxes would be useful and would allow us to avoid a tick event here.
-function onTick()
-{
- updateResultingLocale();
-}
-
-function cancelSetup()
-{
- Engine.PopGuiPage();
-}
-
-function updateResultingLocale()
-{
- var languageList = Engine.GetGUIObjectByName("languageList");
- var countryList = Engine.GetGUIObjectByName("countryList");
- var resultingLocaleText = Engine.GetGUIObjectByName("resultingLocale");
- var scriptInput = Engine.GetGUIObjectByName("scriptInput");
- var variantInput = Engine.GetGUIObjectByName("variantInput");
- var dictionaryFile = Engine.GetGUIObjectByName("dictionaryFile");
-
- var resultingLocaleTmp = languageList.list_data[languageList.selected];
-
- if (scriptInput.caption != "")
- resultingLocaleTmp = resultingLocaleTmp + "_" + scriptInput.caption;
-
- if (countryList.selected != -1 && countryList.list_data[countryList.selected] != translateWithContext("localeCountry", "None"))
- resultingLocaleTmp = resultingLocaleTmp + "_" + countryList.list_data[countryList.selected];
-
- let acceptButton = Engine.GetGUIObjectByName("acceptButton");
- if (Engine.ValidateLocale(resultingLocaleTmp))
- {
- resultingLocaleText.caption = resultingLocaleTmp;
- let dictionaryFileList = Engine.GetDictionariesForLocale(Engine.GetDictionaryLocale(resultingLocaleTmp));
- let dictionaryFileString = "";
- dictionaryFileList.forEach(entry => { dictionaryFileString = dictionaryFileString + entry + "\n"; });
- dictionaryFile.caption = dictionaryFileString;
- acceptButton.enabled = true;
- }
- else
- {
- resultingLocaleText.caption = translate("invalid locale");
- dictionaryFile.caption = "";
- acceptButton.enabled = false;
- }
-}
-
-function autoDetectLocale()
-{
- var languageList = Engine.GetGUIObjectByName("languageList");
- var countryList = Engine.GetGUIObjectByName("countryList");
- var scriptInput = Engine.GetGUIObjectByName("scriptInput");
- var variantInput = Engine.GetGUIObjectByName("variantInput");
- var dictionaryFile = Engine.GetGUIObjectByName("dictionaryFile");
-
- variantInput.caption = "";
- dictionaryFile.caption = "";
- var locale = Engine.GetDictionaryLocale("");
-
- languageList.selected = languageList.list_data.indexOf(Engine.GetLocaleLanguage(locale));
- countryList.selected = countryList.list_data.indexOf(Engine.GetLocaleCountry(locale));
- scriptInput.caption = Engine.GetLocaleScript(locale);
-}
-
-function applySelectedLocale()
-{
- var resultingLocaleText = Engine.GetGUIObjectByName("resultingLocale");
- Engine.PopGuiPageCB(resultingLocaleText.caption);
-}
Property changes on: ps/trunk/binaries/data/mods/public/gui/locale/locale_advanced.js
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
Index: ps/trunk/binaries/data/mods/public/gui/locale/locale.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/locale/locale.xml (revision 20538)
+++ ps/trunk/binaries/data/mods/public/gui/locale/locale.xml (revision 20539)
@@ -1,52 +1,52 @@
-
+
Language
Language:
languageSelectionChanged();
Locale:
Cancel
cancelSetup();
Advanced
openAdvancedMenu();
Accept
applySelectedLocale();
Index: ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.js
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.js (nonexistent)
+++ ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.js (revision 20539)
@@ -0,0 +1,118 @@
+function init(initData)
+{
+ let languageList = Engine.GetGUIObjectByName("languageList");
+ let countryList = Engine.GetGUIObjectByName("countryList");
+ let resultingLocaleText = Engine.GetGUIObjectByName("resultingLocale");
+ let scriptInput = Engine.GetGUIObjectByName("scriptInput");
+
+ // get languageList data. Only list languages for which we have a dictionary.
+ let languageListData = [];
+ let languageListTmp = Engine.GetSupportedLocaleBaseNames();
+ let currentLocaleLanguage = Engine.GetLocaleLanguage(initData.locale);
+ for (let i = 0; i < languageListTmp.length; ++i)
+ {
+ let lang = Engine.GetLocaleLanguage(languageListTmp[i]);
+ if (lang != "" && languageListData.indexOf(lang) == -1)
+ languageListData.push(lang);
+ }
+
+
+ // get countryList data (we get all countries and not only the ones we have dictionaries for)
+ var countryListData = [];
+ countryListData.push(translateWithContext("localeCountry", "None"));
+ var countryListTmp = Engine.GetAllLocales();
+ var currentLocaleCountry = Engine.GetLocaleCountry(initData.locale);
+ for (let i = 0; i < countryListTmp.length; ++i)
+ {
+ let country = Engine.GetLocaleCountry(countryListTmp[i]);
+ if (country != "" && countryListData.indexOf(country) == -1)
+ countryListData.push(country);
+ }
+ countryListData.sort();
+
+ // fill the languageList
+ languageList.list = languageListData;
+ languageList.list_data = languageListData;
+ if (languageList.list_data.indexOf(currentLocaleLanguage) != -1)
+ languageList.selected = languageList.list_data.indexOf(currentLocaleLanguage);
+
+ // fill the country list
+ countryList.list = countryListData;
+ countryList.list_data = countryListData;
+ if (currentLocaleCountry != "")
+ countryList.selected = countryList.list_data.indexOf(currentLocaleCountry);
+ else
+ countryList.selected = 0;
+
+ // fill the script
+ scriptInput.caption = Engine.GetLocaleScript(initData.locale);
+}
+
+// TODO: an onChanged event for input boxes would be useful and would allow us to avoid a tick event here.
+function onTick()
+{
+ updateResultingLocale();
+}
+
+function cancelSetup()
+{
+ Engine.PopGuiPage();
+}
+
+function updateResultingLocale()
+{
+ var languageList = Engine.GetGUIObjectByName("languageList");
+ var countryList = Engine.GetGUIObjectByName("countryList");
+ var resultingLocaleText = Engine.GetGUIObjectByName("resultingLocale");
+ var scriptInput = Engine.GetGUIObjectByName("scriptInput");
+ var variantInput = Engine.GetGUIObjectByName("variantInput");
+ var dictionaryFile = Engine.GetGUIObjectByName("dictionaryFile");
+
+ var resultingLocaleTmp = languageList.list_data[languageList.selected];
+
+ if (scriptInput.caption != "")
+ resultingLocaleTmp = resultingLocaleTmp + "_" + scriptInput.caption;
+
+ if (countryList.selected != -1 && countryList.list_data[countryList.selected] != translateWithContext("localeCountry", "None"))
+ resultingLocaleTmp = resultingLocaleTmp + "_" + countryList.list_data[countryList.selected];
+
+ let acceptButton = Engine.GetGUIObjectByName("acceptButton");
+ if (Engine.ValidateLocale(resultingLocaleTmp))
+ {
+ resultingLocaleText.caption = resultingLocaleTmp;
+ let dictionaryFileList = Engine.GetDictionariesForLocale(Engine.GetDictionaryLocale(resultingLocaleTmp));
+ let dictionaryFileString = "";
+ dictionaryFileList.forEach(entry => { dictionaryFileString = dictionaryFileString + entry + "\n"; });
+ dictionaryFile.caption = dictionaryFileString;
+ acceptButton.enabled = true;
+ }
+ else
+ {
+ resultingLocaleText.caption = translate("invalid locale");
+ dictionaryFile.caption = "";
+ acceptButton.enabled = false;
+ }
+}
+
+function autoDetectLocale()
+{
+ var languageList = Engine.GetGUIObjectByName("languageList");
+ var countryList = Engine.GetGUIObjectByName("countryList");
+ var scriptInput = Engine.GetGUIObjectByName("scriptInput");
+ var variantInput = Engine.GetGUIObjectByName("variantInput");
+ var dictionaryFile = Engine.GetGUIObjectByName("dictionaryFile");
+
+ variantInput.caption = "";
+ dictionaryFile.caption = "";
+ var locale = Engine.GetDictionaryLocale("");
+
+ languageList.selected = languageList.list_data.indexOf(Engine.GetLocaleLanguage(locale));
+ countryList.selected = countryList.list_data.indexOf(Engine.GetLocaleCountry(locale));
+ scriptInput.caption = Engine.GetLocaleScript(locale);
+}
+
+function applySelectedLocale()
+{
+ var resultingLocaleText = Engine.GetGUIObjectByName("resultingLocale");
+ Engine.PopGuiPageCB(resultingLocaleText.caption);
+}
Property changes on: ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.js
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.xml (nonexistent)
+++ ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.xml (revision 20539)
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+ onTick();
+
+
+ Language
+
+
+ Language:
+
+
+
+
+ Country:
+
+
+
+
+
+ Script:
+
+
+ Optional four-letter script code part following the language code (as listed in ISO 15924)
+
+
+
+ Variant (unused):
+
+
+ Not implemented yet.
+
+
+
+ Keywords (unused):
+
+
+ Not implemented yet.
+
+
+
+ Resulting locale:
+
+
+
+
+ Dictionary files used:
+
+
+
+
+ Cancel
+ cancelSetup();
+
+
+
+ Auto detect
+ autoDetectLocale();
+
+
+
+ Accept
+ applySelectedLocale();
+
+
+
+
+
Property changes on: ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.xml
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: ps/trunk/binaries/data/mods/public/gui/page_locale_advanced.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/page_locale_advanced.xml (revision 20538)
+++ ps/trunk/binaries/data/mods/public/gui/page_locale_advanced.xml (revision 20539)
@@ -1,10 +1,10 @@
common/modern/setup.xml
common/modern/styles.xml
common/modern/sprites.xml
common/global.xml
- locale/locale_advanced.xml
+ locale_advanced/locale_advanced.xml