From 1c4c8d6fb23ca0d332dc3bb727f9bedfe7159531 Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Tue, 30 Apr 2024 20:46:06 +0200 Subject: [PATCH 1/2] feat(android): defaultLang option in tiapp.xml --- android/cli/commands/_build.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/cli/commands/_build.js b/android/cli/commands/_build.js index b230e62b55b..805f7ca4914 100644 --- a/android/cli/commands/_build.js +++ b/android/cli/commands/_build.js @@ -3206,7 +3206,8 @@ AndroidBuilder.prototype.generateI18N = async function generateI18N() { root.appendChild(dom.createTextNode('\n')); // Create the XML file under the Android "res/values-" folder. - const localeSuffixName = (locale === 'en' ? '' : '-' + resolveRegionName(locale)); + const defaultLang = this.tiapp.defaultLang ? this.tiapp.defaultLang : 'en'; + const localeSuffixName = (locale === defaultLang ? '' : '-' + resolveRegionName(locale)); const dirPath = path.join(this.buildAppMainResDir, `values${localeSuffixName}`); const filePath = path.join(dirPath, 'ti_i18n_strings.xml'); this.logger.debug(__('Writing %s strings => %s', locale.cyan, filePath.cyan)); From 693afb4e46479c6c76307e548267cbfdf51cc436 Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Tue, 30 Apr 2024 21:00:23 +0200 Subject: [PATCH 2/2] Update android/cli/commands/_build.js Co-authored-by: Chris Barber --- android/cli/commands/_build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/cli/commands/_build.js b/android/cli/commands/_build.js index 805f7ca4914..052395b4446 100644 --- a/android/cli/commands/_build.js +++ b/android/cli/commands/_build.js @@ -3206,7 +3206,7 @@ AndroidBuilder.prototype.generateI18N = async function generateI18N() { root.appendChild(dom.createTextNode('\n')); // Create the XML file under the Android "res/values-" folder. - const defaultLang = this.tiapp.defaultLang ? this.tiapp.defaultLang : 'en'; + const defaultLang = this.tiapp.defaultLang || 'en'; const localeSuffixName = (locale === defaultLang ? '' : '-' + resolveRegionName(locale)); const dirPath = path.join(this.buildAppMainResDir, `values${localeSuffixName}`); const filePath = path.join(dirPath, 'ti_i18n_strings.xml');