Extract translation from app module (#7975)

* Extract translation from app module

- Prep for further extraction to modules in the nearish future

* Subproject .gitignore

(cherry picked from commit d5c207d8a3fae9aa42f39a008454696e2d8b2e06)

# Conflicts:
#	.gitignore
This commit is contained in:
Andreas 2022-09-10 15:58:45 +02:00 committed by Jobobby04
parent 10f351de66
commit 1825a3e9a2
83 changed files with 49 additions and 15 deletions

6
.gitignore vendored
View File

@ -14,12 +14,6 @@
*.apk *.apk
app/**/output.json app/**/output.json
# Hebrew assets are copied on build
app/src/main/res/values-iw/
# Generated
locales_config.xml
TODO.md TODO.md
CHANGELOG.md CHANGELOG.md
/captures /captures

View File

@ -132,6 +132,8 @@ android {
} }
dependencies { dependencies {
implementation(project(":i18n"))
// Compose // Compose
implementation(compose.activity) implementation(compose.activity)
implementation(compose.foundation) implementation(compose.foundation)
@ -287,8 +289,6 @@ dependencies {
} }
tasks { tasks {
val localesConfigTask = registerLocalesConfigTask(project)
withType<Test> { withType<Test> {
useJUnitPlatform() useJUnitPlatform()
testLogging { testLogging {
@ -317,16 +317,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 { preBuild {
val ktlintTask = if (System.getenv("GITHUB_BASE_REF") == null) formatKotlin else lintKotlin val ktlintTask = if (System.getenv("GITHUB_BASE_REF") == null) formatKotlin else lintKotlin
dependsOn(ktlintTask, copyHebrewStrings, localesConfigTask) dependsOn(ktlintTask)
} }
} }

5
i18n/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# Hebrew assets are copied on build
/src/main/res/values-iw/
# Generated
locales_config.xml

37
i18n/build.gradle.kts Normal file
View File

@ -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)
}
}

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />

View File

@ -39,3 +39,4 @@ dependencyResolutionManagement {
rootProject.name = "TachiyomiSY" rootProject.name = "TachiyomiSY"
include(":app") include(":app")
include(":i18n")