mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Implement task to generate translator layout from a text file (#759)
Related to #669
This commit is contained in:
@@ -8,6 +8,10 @@ plugins {
|
||||
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
|
||||
}
|
||||
|
||||
apply {
|
||||
from("translators.gradle.kts")
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
|
||||
1
build.sh
1
build.sh
@@ -87,6 +87,7 @@ build_apk() {
|
||||
|
||||
if [ -n "$RELEASE" ]; then
|
||||
log_info "Building release APK..."
|
||||
$GRADLE updateTranslators
|
||||
$GRADLE :uhabits-android:assembleRelease
|
||||
cp -v \
|
||||
uhabits-android/build/outputs/apk/release/uhabits-android-release.apk \
|
||||
|
||||
69
translators
Normal file
69
translators
Normal file
@@ -0,0 +1,69 @@
|
||||
Mihail Stefanov (Български)
|
||||
Angga Rifandi (Bahasa Indonesia)
|
||||
raden20 (Bahasa Indonesia)
|
||||
azzamsa (Bahasa Indonesia)
|
||||
David Nos (Català)
|
||||
Tomáš Borovec (Čeština)
|
||||
Rancher (Cрпски)
|
||||
Yussuf (Dansk)
|
||||
Sølv Ræven (Dansk)
|
||||
Matthias Meisser (Deutsch)
|
||||
Sojusnik (Deutsch)
|
||||
Can Altas (Deutsch)
|
||||
Laura Sophie (Deutsch)
|
||||
Ander Raso Vazquez (Español)
|
||||
Beriain (Euskara)
|
||||
Osoitz (Euskara)
|
||||
Andreas Michelakis (Ελληνικά)
|
||||
Eman (Fārsi)
|
||||
Saeed Esmaili (Fārsi)
|
||||
Behnood HRazy (Fārsi)
|
||||
François Mahé (Français)
|
||||
Thibaut Girka (Français)
|
||||
Mathis Chenuet (Français)
|
||||
Michael Faille (Français)
|
||||
Tiralka (Français)
|
||||
Ivan Krušlin (Hrvatski)
|
||||
Marco Cavazza (Italiano)
|
||||
Mark Macaré (Nederlands)
|
||||
Jelle den Butter (Nederlands)
|
||||
nitovf9292 (Norsk)
|
||||
Adam Jurkiewicz (Polski)
|
||||
Álinson Santos Xavier (Português)
|
||||
Bernardo Lopes (Português)
|
||||
Dmitriy Bogdanov (Русский)
|
||||
Andrei Pleș (Română)
|
||||
Andreea Muscalagiu (Română)
|
||||
Dušan Strgar (Slovenščina)
|
||||
Alexander Jansson (Svenska)
|
||||
Robin (Svenska)
|
||||
Sofia Veijonen (Suomen kieli)
|
||||
Đorđe Vasiljević (српски)
|
||||
Caner Başaran (Türkçe)
|
||||
hodanli (Türkçe)
|
||||
Yurii Stavytskyi (Українська)
|
||||
Rystard (Українська)
|
||||
Oglaigh Rystard (Українська)
|
||||
taras-ko (Українська)
|
||||
Limin Lu (中文)
|
||||
XuToTo (中文)
|
||||
Ting-Hua (中文)
|
||||
Bowie Chen (中文)
|
||||
Lee (中文)
|
||||
Liveeasy (中文)
|
||||
Naofumi F (日本語)
|
||||
Al Alloush (العَرَبِية)
|
||||
Boula (العَرَبِية)
|
||||
Israa Z (العَرَبِية)
|
||||
Josh Graham (한국어 )
|
||||
Seoyul (한국어 )
|
||||
Aman Satnami (हिन्दी)
|
||||
Niraj Yadav (हिन्दी)
|
||||
Yoav Argov (עברית)
|
||||
Mahdi Nasiri (فارسی)
|
||||
Mohammed Imthath (தமிழ்)
|
||||
magimai (தமிழ்)
|
||||
Anshoe (தமிழ்)
|
||||
Trần Thái (Tiếng Việt)
|
||||
Anh Quân (Tiếng Việt)
|
||||
pnhpnh (Tiếng Việt)
|
||||
45
translators.gradle.kts
Normal file
45
translators.gradle.kts
Normal file
@@ -0,0 +1,45 @@
|
||||
import groovy.xml.MarkupBuilder
|
||||
import java.io.StringWriter
|
||||
|
||||
task("updateTranslators") {
|
||||
doLast {
|
||||
fun updateTranslatorLayouts() {
|
||||
val writer = StringWriter()
|
||||
val indent = " "
|
||||
val xml = MarkupBuilder(groovy.util.IndentPrinter(writer, indent))
|
||||
xml.doubleQuotes = true
|
||||
xml.withGroovyBuilder {
|
||||
"LinearLayout"(
|
||||
"style" to "@style/Card",
|
||||
"android:gravity" to "center",
|
||||
"xmlns:android" to "http://schemas.android.com/apk/res/android"
|
||||
) {
|
||||
"TextView"(
|
||||
"style" to "@style/CardHeader",
|
||||
"android:text" to "@string/translators",
|
||||
"android:textColor" to "?aboutScreenColor"
|
||||
)
|
||||
|
||||
xml.mkp.yield('\n' + indent)
|
||||
xml.mkp.comment("This list is automatically generated, do not edit manually.")
|
||||
|
||||
val reader = file("translators").bufferedReader()
|
||||
for (l in reader.lines()) {
|
||||
"TextView"(
|
||||
"style" to "@style/About.Item",
|
||||
"android:text" to l
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
val newContent = writer.toString()
|
||||
val path = "uhabits-android/src/main/res/layout/about_translators.xml"
|
||||
val currentContent = file(path).readText()
|
||||
if (currentContent != newContent) {
|
||||
file(path).writeText(newContent)
|
||||
}
|
||||
}
|
||||
|
||||
updateTranslatorLayouts()
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016-2021 Álinson Santos Xavier <git@axavier.org>
|
||||
*
|
||||
@@ -26,7 +28,12 @@ plugins {
|
||||
id("org.jlleitschuh.gradle.ktlint")
|
||||
}
|
||||
|
||||
tasks.compileLint {
|
||||
dependsOn("updateTranslators")
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
compileSdkVersion(30)
|
||||
|
||||
defaultConfig {
|
||||
|
||||
@@ -139,292 +139,9 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
style="@style/Card"
|
||||
android:gravity="center">
|
||||
<include layout="@layout/about_translators"/>
|
||||
|
||||
<TextView
|
||||
style="@style/CardHeader"
|
||||
android:text="@string/translators"
|
||||
android:textColor="?aboutScreenColor"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Mihail Stefanov (Български)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Angga Rifandi (Bahasa Indonesia)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="raden20 (Bahasa Indonesia)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="azzamsa (Bahasa Indonesia)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="David Nos (Català)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Tomáš Borovec (Čeština)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Rancher (Cрпски)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Yussuf (Dansk)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Sølv Ræven (Dansk)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Matthias Meisser (Deutsch)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Sojusnik (Deutsch)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Can Altas (Deutsch)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Laura Sophie (Deutsch)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Ander Raso Vazquez (Español)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Beriain (Euskara)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Osoitz (Euskara)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Andreas Michelakis (Ελληνικά)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Eman (Fārsi)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Saeed Esmaili (Fārsi)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Behnood HRazy (Fārsi)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="François Mahé (Français)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Thibaut Girka (Français)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Mathis Chenuet (Français)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Michael Faille (Français)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Tiralka (Français)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Ivan Krušlin (Hrvatski)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Marco Cavazza (Italiano)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Mark Macaré (Nederlands)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Jelle den Butter (Nederlands)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="nitovf9292 (Norsk)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Adam Jurkiewicz (Polski)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Álinson Santos Xavier (Português)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Bernardo Lopes (Português)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Dmitriy Bogdanov (Русский)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Andrei Pleș (Română)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Andreea Muscalagiu (Română)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Dušan Strgar (Slovenščina)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Alexander Jansson (Svenska)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Robin (Svenska)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Sofia Veijonen (Suomen kieli)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Đorđe Vasiljević (српски)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Caner Başaran (Türkçe)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="hodanli (Türkçe)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Yurii Stavytskyi (Українська)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Rystard (Українська)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Oglaigh Rystard (Українська)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="taras-ko (Українська)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Limin Lu (中文)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="XuToTo (中文)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Ting-Hua (中文)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Bowie Chen (中文)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Lee (中文)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Liveeasy (中文)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Naofumi F (日本語)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Al Alloush (العَرَبِية)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Boula (العَرَبِية)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Israa Z (العَرَبِية)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Josh Graham (한국어 )"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Seoyul (한국어 )"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Aman Satnami (हिन्दी)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Niraj Yadav (हिन्दी)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Yoav Argov (עברית)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Mahdi Nasiri (فارسی)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Mohammed Imthath (தமிழ்)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="magimai (தமிழ்)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Anshoe (தமிழ்)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Trần Thái (Tiếng Việt)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="Anh Quân (Tiếng Việt)"/>
|
||||
|
||||
<TextView
|
||||
style="@style/About.Item"
|
||||
android:text="pnhpnh (Tiếng Việt)"/>
|
||||
|
||||
</LinearLayout>
|
||||
>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
73
uhabits-android/src/main/res/layout/about_translators.xml
Normal file
73
uhabits-android/src/main/res/layout/about_translators.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<LinearLayout style="@style/Card" android:gravity="center" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<TextView style="@style/CardHeader" android:text="@string/translators" android:textColor="?aboutScreenColor" />
|
||||
<!-- This list is automatically generated, do not edit manually. -->
|
||||
<TextView style="@style/About.Item" android:text="Mihail Stefanov (Български)" />
|
||||
<TextView style="@style/About.Item" android:text="Angga Rifandi (Bahasa Indonesia)" />
|
||||
<TextView style="@style/About.Item" android:text="raden20 (Bahasa Indonesia)" />
|
||||
<TextView style="@style/About.Item" android:text="azzamsa (Bahasa Indonesia)" />
|
||||
<TextView style="@style/About.Item" android:text="David Nos (Català)" />
|
||||
<TextView style="@style/About.Item" android:text="Tomáš Borovec (Čeština)" />
|
||||
<TextView style="@style/About.Item" android:text="Rancher (Cрпски)" />
|
||||
<TextView style="@style/About.Item" android:text="Yussuf (Dansk)" />
|
||||
<TextView style="@style/About.Item" android:text="Sølv Ræven (Dansk)" />
|
||||
<TextView style="@style/About.Item" android:text="Matthias Meisser (Deutsch)" />
|
||||
<TextView style="@style/About.Item" android:text="Sojusnik (Deutsch)" />
|
||||
<TextView style="@style/About.Item" android:text="Can Altas (Deutsch)" />
|
||||
<TextView style="@style/About.Item" android:text="Laura Sophie (Deutsch)" />
|
||||
<TextView style="@style/About.Item" android:text="Ander Raso Vazquez (Español)" />
|
||||
<TextView style="@style/About.Item" android:text="Beriain (Euskara)" />
|
||||
<TextView style="@style/About.Item" android:text="Osoitz (Euskara)" />
|
||||
<TextView style="@style/About.Item" android:text="Andreas Michelakis (Ελληνικά)" />
|
||||
<TextView style="@style/About.Item" android:text="Eman (Fārsi)" />
|
||||
<TextView style="@style/About.Item" android:text="Saeed Esmaili (Fārsi)" />
|
||||
<TextView style="@style/About.Item" android:text="Behnood HRazy (Fārsi)" />
|
||||
<TextView style="@style/About.Item" android:text="François Mahé (Français)" />
|
||||
<TextView style="@style/About.Item" android:text="Thibaut Girka (Français)" />
|
||||
<TextView style="@style/About.Item" android:text="Mathis Chenuet (Français)" />
|
||||
<TextView style="@style/About.Item" android:text="Michael Faille (Français)" />
|
||||
<TextView style="@style/About.Item" android:text="Tiralka (Français)" />
|
||||
<TextView style="@style/About.Item" android:text="Ivan Krušlin (Hrvatski)" />
|
||||
<TextView style="@style/About.Item" android:text="Marco Cavazza (Italiano)" />
|
||||
<TextView style="@style/About.Item" android:text="Mark Macaré (Nederlands)" />
|
||||
<TextView style="@style/About.Item" android:text="Jelle den Butter (Nederlands)" />
|
||||
<TextView style="@style/About.Item" android:text="nitovf9292 (Norsk)" />
|
||||
<TextView style="@style/About.Item" android:text="Adam Jurkiewicz (Polski)" />
|
||||
<TextView style="@style/About.Item" android:text="Álinson Santos Xavier (Português)" />
|
||||
<TextView style="@style/About.Item" android:text="Bernardo Lopes (Português)" />
|
||||
<TextView style="@style/About.Item" android:text="Dmitriy Bogdanov (Русский)" />
|
||||
<TextView style="@style/About.Item" android:text="Andrei Pleș (Română)" />
|
||||
<TextView style="@style/About.Item" android:text="Andreea Muscalagiu (Română)" />
|
||||
<TextView style="@style/About.Item" android:text="Dušan Strgar (Slovenščina)" />
|
||||
<TextView style="@style/About.Item" android:text="Alexander Jansson (Svenska)" />
|
||||
<TextView style="@style/About.Item" android:text="Robin (Svenska)" />
|
||||
<TextView style="@style/About.Item" android:text="Sofia Veijonen (Suomen kieli)" />
|
||||
<TextView style="@style/About.Item" android:text="Đorđe Vasiljević (српски)" />
|
||||
<TextView style="@style/About.Item" android:text="Caner Başaran (Türkçe)" />
|
||||
<TextView style="@style/About.Item" android:text="hodanli (Türkçe)" />
|
||||
<TextView style="@style/About.Item" android:text="Yurii Stavytskyi (Українська)" />
|
||||
<TextView style="@style/About.Item" android:text="Rystard (Українська)" />
|
||||
<TextView style="@style/About.Item" android:text="Oglaigh Rystard (Українська)" />
|
||||
<TextView style="@style/About.Item" android:text="taras-ko (Українська)" />
|
||||
<TextView style="@style/About.Item" android:text="Limin Lu (中文)" />
|
||||
<TextView style="@style/About.Item" android:text="XuToTo (中文)" />
|
||||
<TextView style="@style/About.Item" android:text="Ting-Hua (中文)" />
|
||||
<TextView style="@style/About.Item" android:text="Bowie Chen (中文)" />
|
||||
<TextView style="@style/About.Item" android:text="Lee (中文)" />
|
||||
<TextView style="@style/About.Item" android:text="Liveeasy (中文)" />
|
||||
<TextView style="@style/About.Item" android:text="Naofumi F (日本語)" />
|
||||
<TextView style="@style/About.Item" android:text="Al Alloush (العَرَبِية)" />
|
||||
<TextView style="@style/About.Item" android:text="Boula (العَرَبِية)" />
|
||||
<TextView style="@style/About.Item" android:text="Israa Z (العَرَبِية)" />
|
||||
<TextView style="@style/About.Item" android:text="Josh Graham (한국어 )" />
|
||||
<TextView style="@style/About.Item" android:text="Seoyul (한국어 )" />
|
||||
<TextView style="@style/About.Item" android:text="Aman Satnami (हिन्दी)" />
|
||||
<TextView style="@style/About.Item" android:text="Niraj Yadav (हिन्दी)" />
|
||||
<TextView style="@style/About.Item" android:text="Yoav Argov (עברית)" />
|
||||
<TextView style="@style/About.Item" android:text="Mahdi Nasiri (فارسی)" />
|
||||
<TextView style="@style/About.Item" android:text="Mohammed Imthath (தமிழ்)" />
|
||||
<TextView style="@style/About.Item" android:text="magimai (தமிழ்)" />
|
||||
<TextView style="@style/About.Item" android:text="Anshoe (தமிழ்)" />
|
||||
<TextView style="@style/About.Item" android:text="Trần Thái (Tiếng Việt)" />
|
||||
<TextView style="@style/About.Item" android:text="Anh Quân (Tiếng Việt)" />
|
||||
<TextView style="@style/About.Item" android:text="pnhpnh (Tiếng Việt)" />
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user