From 430724f4646e753345ae0714cffbb91668e1a6a3 Mon Sep 17 00:00:00 2001 From: Daniel Frett Date: Tue, 3 Oct 2023 17:14:04 -0600 Subject: [PATCH] create a normalized_app_language that will return the normalized locale that we are using for the app --- .../base/src/main/kotlin/org/cru/godtools/base/Settings.kt | 2 +- library/base/src/main/res/values-ar/values.xml | 4 ++++ library/base/src/main/res/values-es/values.xml | 4 ++++ library/base/src/main/res/values-fr/values.xml | 4 ++++ library/base/src/main/res/values-hi/values.xml | 4 ++++ library/base/src/main/res/values-id/values.xml | 4 ++++ library/base/src/main/res/values-in/values.xml | 4 ++++ library/base/src/main/res/values-lv/values.xml | 4 ++++ library/base/src/main/res/values-pt/values.xml | 4 ++++ library/base/src/main/res/values-ru/values.xml | 4 ++++ library/base/src/main/res/values-vi/values.xml | 4 ++++ library/base/src/main/res/values-zh-rCN/values.xml | 4 ++++ library/base/src/main/res/values-zh-rTW/values.xml | 4 ++++ library/base/src/main/res/values/values.xml | 4 ++++ 14 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 library/base/src/main/res/values-ar/values.xml create mode 100644 library/base/src/main/res/values-es/values.xml create mode 100644 library/base/src/main/res/values-fr/values.xml create mode 100644 library/base/src/main/res/values-hi/values.xml create mode 100644 library/base/src/main/res/values-id/values.xml create mode 100644 library/base/src/main/res/values-in/values.xml create mode 100644 library/base/src/main/res/values-lv/values.xml create mode 100644 library/base/src/main/res/values-pt/values.xml create mode 100644 library/base/src/main/res/values-ru/values.xml create mode 100644 library/base/src/main/res/values-vi/values.xml create mode 100644 library/base/src/main/res/values-zh-rCN/values.xml create mode 100644 library/base/src/main/res/values-zh-rTW/values.xml create mode 100644 library/base/src/main/res/values/values.xml diff --git a/library/base/src/main/kotlin/org/cru/godtools/base/Settings.kt b/library/base/src/main/kotlin/org/cru/godtools/base/Settings.kt index 9d8e272132..f12dd99143 100644 --- a/library/base/src/main/kotlin/org/cru/godtools/base/Settings.kt +++ b/library/base/src/main/kotlin/org/cru/godtools/base/Settings.kt @@ -62,7 +62,7 @@ class Settings internal constructor(private val context: Context, coroutineScope // region Language Settings var appLanguage: Locale - get() = AppCompatDelegate.getApplicationLocales()[0] ?: Locale.getDefault() + get() = Locale.forLanguageTag(context.getString(R.string.normalized_app_language)) set(value) { AppCompatDelegate.setApplicationLocales(LocaleListCompat.create(value)) } diff --git a/library/base/src/main/res/values-ar/values.xml b/library/base/src/main/res/values-ar/values.xml new file mode 100644 index 0000000000..0d1bab471a --- /dev/null +++ b/library/base/src/main/res/values-ar/values.xml @@ -0,0 +1,4 @@ + + + ar + diff --git a/library/base/src/main/res/values-es/values.xml b/library/base/src/main/res/values-es/values.xml new file mode 100644 index 0000000000..1a0a3714e2 --- /dev/null +++ b/library/base/src/main/res/values-es/values.xml @@ -0,0 +1,4 @@ + + + es + diff --git a/library/base/src/main/res/values-fr/values.xml b/library/base/src/main/res/values-fr/values.xml new file mode 100644 index 0000000000..78dace49e0 --- /dev/null +++ b/library/base/src/main/res/values-fr/values.xml @@ -0,0 +1,4 @@ + + + fr + diff --git a/library/base/src/main/res/values-hi/values.xml b/library/base/src/main/res/values-hi/values.xml new file mode 100644 index 0000000000..1d5e5125a5 --- /dev/null +++ b/library/base/src/main/res/values-hi/values.xml @@ -0,0 +1,4 @@ + + + hi + diff --git a/library/base/src/main/res/values-id/values.xml b/library/base/src/main/res/values-id/values.xml new file mode 100644 index 0000000000..fb3e35a02f --- /dev/null +++ b/library/base/src/main/res/values-id/values.xml @@ -0,0 +1,4 @@ + + + id + diff --git a/library/base/src/main/res/values-in/values.xml b/library/base/src/main/res/values-in/values.xml new file mode 100644 index 0000000000..fb3e35a02f --- /dev/null +++ b/library/base/src/main/res/values-in/values.xml @@ -0,0 +1,4 @@ + + + id + diff --git a/library/base/src/main/res/values-lv/values.xml b/library/base/src/main/res/values-lv/values.xml new file mode 100644 index 0000000000..5f5f0699ba --- /dev/null +++ b/library/base/src/main/res/values-lv/values.xml @@ -0,0 +1,4 @@ + + + lv + diff --git a/library/base/src/main/res/values-pt/values.xml b/library/base/src/main/res/values-pt/values.xml new file mode 100644 index 0000000000..11aaafe718 --- /dev/null +++ b/library/base/src/main/res/values-pt/values.xml @@ -0,0 +1,4 @@ + + + pt + diff --git a/library/base/src/main/res/values-ru/values.xml b/library/base/src/main/res/values-ru/values.xml new file mode 100644 index 0000000000..8dfe3fc971 --- /dev/null +++ b/library/base/src/main/res/values-ru/values.xml @@ -0,0 +1,4 @@ + + + ru + diff --git a/library/base/src/main/res/values-vi/values.xml b/library/base/src/main/res/values-vi/values.xml new file mode 100644 index 0000000000..8f6316e8ab --- /dev/null +++ b/library/base/src/main/res/values-vi/values.xml @@ -0,0 +1,4 @@ + + + vi + diff --git a/library/base/src/main/res/values-zh-rCN/values.xml b/library/base/src/main/res/values-zh-rCN/values.xml new file mode 100644 index 0000000000..be4415bcda --- /dev/null +++ b/library/base/src/main/res/values-zh-rCN/values.xml @@ -0,0 +1,4 @@ + + + zh-Hans + diff --git a/library/base/src/main/res/values-zh-rTW/values.xml b/library/base/src/main/res/values-zh-rTW/values.xml new file mode 100644 index 0000000000..e8b5d78840 --- /dev/null +++ b/library/base/src/main/res/values-zh-rTW/values.xml @@ -0,0 +1,4 @@ + + + zh-Hant + diff --git a/library/base/src/main/res/values/values.xml b/library/base/src/main/res/values/values.xml new file mode 100644 index 0000000000..26b0f9e7a2 --- /dev/null +++ b/library/base/src/main/res/values/values.xml @@ -0,0 +1,4 @@ + + + en +