From b2fba5083b366df81b13658176efabb99088a16b Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 7 Apr 2020 22:32:27 -0400 Subject: [PATCH] Duplicate Hebrew strings on build for legacy locale code --- .gitignore | 5 ++++- app/build.gradle | 13 ++++++++++--- .../eu/kanade/tachiyomi/util/system/LocaleHelper.kt | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index af291a578..b0c3499ce 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,7 @@ .idea/ *iml *.iml -*/build \ No newline at end of file +*/build + +# Hebrew assets are copied on build +app/src/main/res/values-iw/ diff --git a/app/build.gradle b/app/build.gradle index 2d7d2fea7..d42065f09 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -108,6 +108,10 @@ android { } } +androidExtensions { + experimental = true +} + dependencies { // Modified dependencies @@ -268,11 +272,14 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).all { kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlin.Experimental"] } -androidExtensions { - experimental = true +// Duplicating Hebrew string assets due to some locale code issues on different devices +task copyResources(type: Copy) { + from './src/main/res/values-he' + into './src/main/res/values-iw' + include '**/*' } -preBuild.dependsOn(lintKotlin) +preBuild.dependsOn(lintKotlin, copyResources) lintKotlin.dependsOn(formatKotlin) if (getGradle().getStartParameter().getTaskRequests().toString().contains("Standard")) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt index 2d411780b..d0508cb8b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt @@ -64,8 +64,8 @@ object LocaleHelper { } } - /*Return Locale from string language code - + /** + * Return Locale from string language code */ private fun getLocale(lang: String): Locale { val sp = lang.split("_", "-")