diff --git a/.gitignore b/.gitignore index 8e157b61c..ec23e8f0b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,10 +10,4 @@ */build /build *.apk -app/**/output.json - -# Hebrew assets are copied on build -app/src/main/res/values-iw/ - -# Generated -locales_config.xml \ No newline at end of file +app/**/output.json \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 57e43ef21..2e3b7469b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -149,6 +149,8 @@ android { } dependencies { + implementation(project(":i18n")) + // Compose implementation(compose.activity) implementation(compose.foundation) @@ -280,8 +282,6 @@ dependencies { } tasks { - val localesConfigTask = registerLocalesConfigTask(project) - withType { useJUnitPlatform() testLogging { @@ -310,16 +310,11 @@ tasks { ) } - // Duplicating Hebrew string assets due to some locale code issues on different devices - val copyHebrewStrings by registering(Copy::class) { - from("./src/main/res/values-he") - into("./src/main/res/values-iw") - include("**/*") - } + preBuild { val ktlintTask = if (System.getenv("GITHUB_BASE_REF") == null) formatKotlin else lintKotlin - dependsOn(ktlintTask, copyHebrewStrings, localesConfigTask) + dependsOn(ktlintTask) } } diff --git a/i18n/.gitignore b/i18n/.gitignore new file mode 100644 index 000000000..13d1ad697 --- /dev/null +++ b/i18n/.gitignore @@ -0,0 +1,5 @@ +# Hebrew assets are copied on build +/src/main/res/values-iw/ + +# Generated +locales_config.xml \ No newline at end of file diff --git a/i18n/build.gradle.kts b/i18n/build.gradle.kts new file mode 100644 index 000000000..44c11460a --- /dev/null +++ b/i18n/build.gradle.kts @@ -0,0 +1,37 @@ +plugins { + id("com.android.library") + kotlin("android") +} + +android { + namespace = "eu.kanade.tachiyomi.i18n" + compileSdk = AndroidConfig.compileSdk + + defaultConfig { + minSdk = AndroidConfig.minSdk + targetSdk = AndroidConfig.targetSdk + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8.toString() + } +} + +tasks { + val localesConfigTask = registerLocalesConfigTask(project) + + // Duplicating Hebrew string assets due to some locale code issues on different devices + val copyHebrewStrings by registering(Copy::class) { + from("./src/main/res/values-he") + into("./src/main/res/values-iw") + include("**/*") + } + + preBuild { + dependsOn(copyHebrewStrings, localesConfigTask) + } +} diff --git a/i18n/src/main/AndroidManifest.xml b/i18n/src/main/AndroidManifest.xml new file mode 100644 index 000000000..568741e54 --- /dev/null +++ b/i18n/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/app/src/main/res/values-aii/strings.xml b/i18n/src/main/res/values-aii/strings.xml similarity index 100% rename from app/src/main/res/values-aii/strings.xml rename to i18n/src/main/res/values-aii/strings.xml diff --git a/app/src/main/res/values-am/strings.xml b/i18n/src/main/res/values-am/strings.xml similarity index 100% rename from app/src/main/res/values-am/strings.xml rename to i18n/src/main/res/values-am/strings.xml diff --git a/app/src/main/res/values-ar/strings.xml b/i18n/src/main/res/values-ar/strings.xml similarity index 100% rename from app/src/main/res/values-ar/strings.xml rename to i18n/src/main/res/values-ar/strings.xml diff --git a/app/src/main/res/values-ars/strings.xml b/i18n/src/main/res/values-ars/strings.xml similarity index 100% rename from app/src/main/res/values-ars/strings.xml rename to i18n/src/main/res/values-ars/strings.xml diff --git a/app/src/main/res/values-b+es+419/strings.xml b/i18n/src/main/res/values-b+es+419/strings.xml similarity index 100% rename from app/src/main/res/values-b+es+419/strings.xml rename to i18n/src/main/res/values-b+es+419/strings.xml diff --git a/app/src/main/res/values-be/strings.xml b/i18n/src/main/res/values-be/strings.xml similarity index 100% rename from app/src/main/res/values-be/strings.xml rename to i18n/src/main/res/values-be/strings.xml diff --git a/app/src/main/res/values-bg/strings.xml b/i18n/src/main/res/values-bg/strings.xml similarity index 100% rename from app/src/main/res/values-bg/strings.xml rename to i18n/src/main/res/values-bg/strings.xml diff --git a/app/src/main/res/values-bn/strings.xml b/i18n/src/main/res/values-bn/strings.xml similarity index 100% rename from app/src/main/res/values-bn/strings.xml rename to i18n/src/main/res/values-bn/strings.xml diff --git a/app/src/main/res/values-ca/strings.xml b/i18n/src/main/res/values-ca/strings.xml similarity index 100% rename from app/src/main/res/values-ca/strings.xml rename to i18n/src/main/res/values-ca/strings.xml diff --git a/app/src/main/res/values-ceb/strings.xml b/i18n/src/main/res/values-ceb/strings.xml similarity index 100% rename from app/src/main/res/values-ceb/strings.xml rename to i18n/src/main/res/values-ceb/strings.xml diff --git a/app/src/main/res/values-cs/strings.xml b/i18n/src/main/res/values-cs/strings.xml similarity index 100% rename from app/src/main/res/values-cs/strings.xml rename to i18n/src/main/res/values-cs/strings.xml diff --git a/app/src/main/res/values-cv/strings.xml b/i18n/src/main/res/values-cv/strings.xml similarity index 100% rename from app/src/main/res/values-cv/strings.xml rename to i18n/src/main/res/values-cv/strings.xml diff --git a/app/src/main/res/values-da/strings.xml b/i18n/src/main/res/values-da/strings.xml similarity index 100% rename from app/src/main/res/values-da/strings.xml rename to i18n/src/main/res/values-da/strings.xml diff --git a/app/src/main/res/values-de/strings.xml b/i18n/src/main/res/values-de/strings.xml similarity index 100% rename from app/src/main/res/values-de/strings.xml rename to i18n/src/main/res/values-de/strings.xml diff --git a/app/src/main/res/values-el/strings.xml b/i18n/src/main/res/values-el/strings.xml similarity index 100% rename from app/src/main/res/values-el/strings.xml rename to i18n/src/main/res/values-el/strings.xml diff --git a/app/src/main/res/values-eo/strings.xml b/i18n/src/main/res/values-eo/strings.xml similarity index 100% rename from app/src/main/res/values-eo/strings.xml rename to i18n/src/main/res/values-eo/strings.xml diff --git a/app/src/main/res/values-es/strings.xml b/i18n/src/main/res/values-es/strings.xml similarity index 100% rename from app/src/main/res/values-es/strings.xml rename to i18n/src/main/res/values-es/strings.xml diff --git a/app/src/main/res/values-eu/strings.xml b/i18n/src/main/res/values-eu/strings.xml similarity index 100% rename from app/src/main/res/values-eu/strings.xml rename to i18n/src/main/res/values-eu/strings.xml diff --git a/app/src/main/res/values-fa/strings.xml b/i18n/src/main/res/values-fa/strings.xml similarity index 100% rename from app/src/main/res/values-fa/strings.xml rename to i18n/src/main/res/values-fa/strings.xml diff --git a/app/src/main/res/values-fi/strings.xml b/i18n/src/main/res/values-fi/strings.xml similarity index 100% rename from app/src/main/res/values-fi/strings.xml rename to i18n/src/main/res/values-fi/strings.xml diff --git a/app/src/main/res/values-fil/strings.xml b/i18n/src/main/res/values-fil/strings.xml similarity index 100% rename from app/src/main/res/values-fil/strings.xml rename to i18n/src/main/res/values-fil/strings.xml diff --git a/app/src/main/res/values-fr/strings.xml b/i18n/src/main/res/values-fr/strings.xml similarity index 100% rename from app/src/main/res/values-fr/strings.xml rename to i18n/src/main/res/values-fr/strings.xml diff --git a/app/src/main/res/values-gl/strings.xml b/i18n/src/main/res/values-gl/strings.xml similarity index 100% rename from app/src/main/res/values-gl/strings.xml rename to i18n/src/main/res/values-gl/strings.xml diff --git a/app/src/main/res/values-ha/strings.xml b/i18n/src/main/res/values-ha/strings.xml similarity index 100% rename from app/src/main/res/values-ha/strings.xml rename to i18n/src/main/res/values-ha/strings.xml diff --git a/app/src/main/res/values-he/strings.xml b/i18n/src/main/res/values-he/strings.xml similarity index 100% rename from app/src/main/res/values-he/strings.xml rename to i18n/src/main/res/values-he/strings.xml diff --git a/app/src/main/res/values-hi/strings.xml b/i18n/src/main/res/values-hi/strings.xml similarity index 100% rename from app/src/main/res/values-hi/strings.xml rename to i18n/src/main/res/values-hi/strings.xml diff --git a/app/src/main/res/values-hr/strings.xml b/i18n/src/main/res/values-hr/strings.xml similarity index 100% rename from app/src/main/res/values-hr/strings.xml rename to i18n/src/main/res/values-hr/strings.xml diff --git a/app/src/main/res/values-hu/strings.xml b/i18n/src/main/res/values-hu/strings.xml similarity index 100% rename from app/src/main/res/values-hu/strings.xml rename to i18n/src/main/res/values-hu/strings.xml diff --git a/app/src/main/res/values-in/strings.xml b/i18n/src/main/res/values-in/strings.xml similarity index 100% rename from app/src/main/res/values-in/strings.xml rename to i18n/src/main/res/values-in/strings.xml diff --git a/app/src/main/res/values-it/strings.xml b/i18n/src/main/res/values-it/strings.xml similarity index 100% rename from app/src/main/res/values-it/strings.xml rename to i18n/src/main/res/values-it/strings.xml diff --git a/app/src/main/res/values-ja/strings.xml b/i18n/src/main/res/values-ja/strings.xml similarity index 100% rename from app/src/main/res/values-ja/strings.xml rename to i18n/src/main/res/values-ja/strings.xml diff --git a/app/src/main/res/values-jv/strings.xml b/i18n/src/main/res/values-jv/strings.xml similarity index 100% rename from app/src/main/res/values-jv/strings.xml rename to i18n/src/main/res/values-jv/strings.xml diff --git a/app/src/main/res/values-ka-rGE/strings.xml b/i18n/src/main/res/values-ka-rGE/strings.xml similarity index 100% rename from app/src/main/res/values-ka-rGE/strings.xml rename to i18n/src/main/res/values-ka-rGE/strings.xml diff --git a/app/src/main/res/values-kk/strings.xml b/i18n/src/main/res/values-kk/strings.xml similarity index 100% rename from app/src/main/res/values-kk/strings.xml rename to i18n/src/main/res/values-kk/strings.xml diff --git a/app/src/main/res/values-km/strings.xml b/i18n/src/main/res/values-km/strings.xml similarity index 100% rename from app/src/main/res/values-km/strings.xml rename to i18n/src/main/res/values-km/strings.xml diff --git a/app/src/main/res/values-kn/strings.xml b/i18n/src/main/res/values-kn/strings.xml similarity index 100% rename from app/src/main/res/values-kn/strings.xml rename to i18n/src/main/res/values-kn/strings.xml diff --git a/app/src/main/res/values-ko/strings.xml b/i18n/src/main/res/values-ko/strings.xml similarity index 100% rename from app/src/main/res/values-ko/strings.xml rename to i18n/src/main/res/values-ko/strings.xml diff --git a/app/src/main/res/values-lt/strings.xml b/i18n/src/main/res/values-lt/strings.xml similarity index 100% rename from app/src/main/res/values-lt/strings.xml rename to i18n/src/main/res/values-lt/strings.xml diff --git a/app/src/main/res/values-lv/strings.xml b/i18n/src/main/res/values-lv/strings.xml similarity index 100% rename from app/src/main/res/values-lv/strings.xml rename to i18n/src/main/res/values-lv/strings.xml diff --git a/app/src/main/res/values-ml/strings.xml b/i18n/src/main/res/values-ml/strings.xml similarity index 100% rename from app/src/main/res/values-ml/strings.xml rename to i18n/src/main/res/values-ml/strings.xml diff --git a/app/src/main/res/values-mn/strings.xml b/i18n/src/main/res/values-mn/strings.xml similarity index 100% rename from app/src/main/res/values-mn/strings.xml rename to i18n/src/main/res/values-mn/strings.xml diff --git a/app/src/main/res/values-mr/strings.xml b/i18n/src/main/res/values-mr/strings.xml similarity index 100% rename from app/src/main/res/values-mr/strings.xml rename to i18n/src/main/res/values-mr/strings.xml diff --git a/app/src/main/res/values-ms/strings.xml b/i18n/src/main/res/values-ms/strings.xml similarity index 100% rename from app/src/main/res/values-ms/strings.xml rename to i18n/src/main/res/values-ms/strings.xml diff --git a/app/src/main/res/values-my/strings.xml b/i18n/src/main/res/values-my/strings.xml similarity index 100% rename from app/src/main/res/values-my/strings.xml rename to i18n/src/main/res/values-my/strings.xml diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/i18n/src/main/res/values-nb-rNO/strings.xml similarity index 100% rename from app/src/main/res/values-nb-rNO/strings.xml rename to i18n/src/main/res/values-nb-rNO/strings.xml diff --git a/app/src/main/res/values-ne/strings.xml b/i18n/src/main/res/values-ne/strings.xml similarity index 100% rename from app/src/main/res/values-ne/strings.xml rename to i18n/src/main/res/values-ne/strings.xml diff --git a/app/src/main/res/values-nl/strings.xml b/i18n/src/main/res/values-nl/strings.xml similarity index 100% rename from app/src/main/res/values-nl/strings.xml rename to i18n/src/main/res/values-nl/strings.xml diff --git a/app/src/main/res/values-nn/strings.xml b/i18n/src/main/res/values-nn/strings.xml similarity index 100% rename from app/src/main/res/values-nn/strings.xml rename to i18n/src/main/res/values-nn/strings.xml diff --git a/app/src/main/res/values-or/strings.xml b/i18n/src/main/res/values-or/strings.xml similarity index 100% rename from app/src/main/res/values-or/strings.xml rename to i18n/src/main/res/values-or/strings.xml diff --git a/app/src/main/res/values-pl/strings.xml b/i18n/src/main/res/values-pl/strings.xml similarity index 100% rename from app/src/main/res/values-pl/strings.xml rename to i18n/src/main/res/values-pl/strings.xml diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/i18n/src/main/res/values-pt-rBR/strings.xml similarity index 100% rename from app/src/main/res/values-pt-rBR/strings.xml rename to i18n/src/main/res/values-pt-rBR/strings.xml diff --git a/app/src/main/res/values-pt/strings.xml b/i18n/src/main/res/values-pt/strings.xml similarity index 100% rename from app/src/main/res/values-pt/strings.xml rename to i18n/src/main/res/values-pt/strings.xml diff --git a/app/src/main/res/values-ro/strings.xml b/i18n/src/main/res/values-ro/strings.xml similarity index 100% rename from app/src/main/res/values-ro/strings.xml rename to i18n/src/main/res/values-ro/strings.xml diff --git a/app/src/main/res/values-ru/strings.xml b/i18n/src/main/res/values-ru/strings.xml similarity index 100% rename from app/src/main/res/values-ru/strings.xml rename to i18n/src/main/res/values-ru/strings.xml diff --git a/app/src/main/res/values-sa/strings.xml b/i18n/src/main/res/values-sa/strings.xml similarity index 100% rename from app/src/main/res/values-sa/strings.xml rename to i18n/src/main/res/values-sa/strings.xml diff --git a/app/src/main/res/values-sah/strings.xml b/i18n/src/main/res/values-sah/strings.xml similarity index 100% rename from app/src/main/res/values-sah/strings.xml rename to i18n/src/main/res/values-sah/strings.xml diff --git a/app/src/main/res/values-sc/strings.xml b/i18n/src/main/res/values-sc/strings.xml similarity index 100% rename from app/src/main/res/values-sc/strings.xml rename to i18n/src/main/res/values-sc/strings.xml diff --git a/app/src/main/res/values-sdh/strings.xml b/i18n/src/main/res/values-sdh/strings.xml similarity index 100% rename from app/src/main/res/values-sdh/strings.xml rename to i18n/src/main/res/values-sdh/strings.xml diff --git a/app/src/main/res/values-si/strings.xml b/i18n/src/main/res/values-si/strings.xml similarity index 100% rename from app/src/main/res/values-si/strings.xml rename to i18n/src/main/res/values-si/strings.xml diff --git a/app/src/main/res/values-sk/strings.xml b/i18n/src/main/res/values-sk/strings.xml similarity index 100% rename from app/src/main/res/values-sk/strings.xml rename to i18n/src/main/res/values-sk/strings.xml diff --git a/app/src/main/res/values-sr/strings.xml b/i18n/src/main/res/values-sr/strings.xml similarity index 100% rename from app/src/main/res/values-sr/strings.xml rename to i18n/src/main/res/values-sr/strings.xml diff --git a/app/src/main/res/values-sv/strings.xml b/i18n/src/main/res/values-sv/strings.xml similarity index 100% rename from app/src/main/res/values-sv/strings.xml rename to i18n/src/main/res/values-sv/strings.xml diff --git a/app/src/main/res/values-ta/strings.xml b/i18n/src/main/res/values-ta/strings.xml similarity index 100% rename from app/src/main/res/values-ta/strings.xml rename to i18n/src/main/res/values-ta/strings.xml diff --git a/app/src/main/res/values-te/strings.xml b/i18n/src/main/res/values-te/strings.xml similarity index 100% rename from app/src/main/res/values-te/strings.xml rename to i18n/src/main/res/values-te/strings.xml diff --git a/app/src/main/res/values-th/strings.xml b/i18n/src/main/res/values-th/strings.xml similarity index 100% rename from app/src/main/res/values-th/strings.xml rename to i18n/src/main/res/values-th/strings.xml diff --git a/app/src/main/res/values-ti/strings.xml b/i18n/src/main/res/values-ti/strings.xml similarity index 100% rename from app/src/main/res/values-ti/strings.xml rename to i18n/src/main/res/values-ti/strings.xml diff --git a/app/src/main/res/values-tr/strings.xml b/i18n/src/main/res/values-tr/strings.xml similarity index 100% rename from app/src/main/res/values-tr/strings.xml rename to i18n/src/main/res/values-tr/strings.xml diff --git a/app/src/main/res/values-uk/strings.xml b/i18n/src/main/res/values-uk/strings.xml similarity index 100% rename from app/src/main/res/values-uk/strings.xml rename to i18n/src/main/res/values-uk/strings.xml diff --git a/app/src/main/res/values-ur-rPK/strings.xml b/i18n/src/main/res/values-ur-rPK/strings.xml similarity index 100% rename from app/src/main/res/values-ur-rPK/strings.xml rename to i18n/src/main/res/values-ur-rPK/strings.xml diff --git a/app/src/main/res/values-ur/strings.xml b/i18n/src/main/res/values-ur/strings.xml similarity index 100% rename from app/src/main/res/values-ur/strings.xml rename to i18n/src/main/res/values-ur/strings.xml diff --git a/app/src/main/res/values-uz/strings.xml b/i18n/src/main/res/values-uz/strings.xml similarity index 100% rename from app/src/main/res/values-uz/strings.xml rename to i18n/src/main/res/values-uz/strings.xml diff --git a/app/src/main/res/values-v28/arrays.xml b/i18n/src/main/res/values-v28/arrays.xml similarity index 100% rename from app/src/main/res/values-v28/arrays.xml rename to i18n/src/main/res/values-v28/arrays.xml diff --git a/app/src/main/res/values-vi/strings.xml b/i18n/src/main/res/values-vi/strings.xml similarity index 100% rename from app/src/main/res/values-vi/strings.xml rename to i18n/src/main/res/values-vi/strings.xml diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/i18n/src/main/res/values-zh-rCN/strings.xml similarity index 100% rename from app/src/main/res/values-zh-rCN/strings.xml rename to i18n/src/main/res/values-zh-rCN/strings.xml diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/i18n/src/main/res/values-zh-rTW/strings.xml similarity index 100% rename from app/src/main/res/values-zh-rTW/strings.xml rename to i18n/src/main/res/values-zh-rTW/strings.xml diff --git a/app/src/main/res/values/arrays.xml b/i18n/src/main/res/values/arrays.xml similarity index 100% rename from app/src/main/res/values/arrays.xml rename to i18n/src/main/res/values/arrays.xml diff --git a/app/src/main/res/values/strings.xml b/i18n/src/main/res/values/strings.xml similarity index 100% rename from app/src/main/res/values/strings.xml rename to i18n/src/main/res/values/strings.xml diff --git a/settings.gradle.kts b/settings.gradle.kts index 170ba7daf..4e928658b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -36,3 +36,4 @@ dependencyResolutionManagement { rootProject.name = "Tachiyomi" include(":app") +include(":i18n")