diff --git a/.github/workflows/weekly_crowdin_sync.yml b/.github/workflows/weekly_crowdin_sync.yml new file mode 100644 index 00000000..1c6f0521 --- /dev/null +++ b/.github/workflows/weekly_crowdin_sync.yml @@ -0,0 +1,31 @@ +name: Sync localisations from Crowdin +on: + schedule: + - cron: '0 0 * * 6' + +jobs: + update-publicsuffix-data: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + + - name: Download new translations from Crowdin + run: ./gradlew crowdin + + - name: Compare list changes + run: if [[ $(git diff --stat) != '' ]]; then echo "UPDATED=true" >> $GITHUB_ENV; fi + + - name: Create Pull Request + uses: peter-evans/create-pull-request@c7f493a8000b8aeb17a1332e326ba76b57cb83eb + if: env.UPDATED == 'true' + with: + assignees: msfjarvis + author: GitHub Actions + base: develop + body: This is an automated pull request to sync localisations from Crowdin. + branch: bot/crowdin-sync + commit-message: "strings: sync with crowdin" + labels: A-localisation, P-low, S-waiting-on-review + title: Sync localisations from Crowdin + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 89ab3b83..90322274 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -8,6 +8,11 @@ plugins { id("com.android.application") kotlin("android") `aps-plugin` + `crowdin-plugin` +} + +configure { + projectName = "android-password-store" } android { diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index b8155fed..89b4da27 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -84,10 +84,10 @@ Gardar e copiar Buscar - Contrasinal: - OTP: + Contrasinal + OTP Contido extra: - Nome de usuaria: + Nome de usuaria Editar contrasinal Copiar contrasinal Compartir como texto plano @@ -200,16 +200,17 @@ Enviar contrasinal como texto plano usando... Icona da app + Elixe o elemento a completar Busca resistente ó phishing Coincidencia con %1$s Baleirar coincidencias existentes Sen resultados. - Buscar no almacenaxe... + Buscar elemento Non se puido gardar por un fallo interno Esta app non está soportada actualmente Non concordan os contrasinais - Crear contrasinal... - Extraer código do SMS… + Crear elemento + Extraer código do SMS Acadouse o máximo número de coincidencias (%1$d); eliminar as coincidencias antes de engadir máis. A autoría desta app cambiou desde que rexistraches a entrada Password Store con ela: A aplicación actualmente instalada podería intentar roubar as túas credenciais pretendendo ser unha app de confianza.\n\nIntenta desinstalar e reinstalar @@ -219,7 +220,7 @@ a app desde unha fonte de confianza, como a Play Store, Amazon Appstore, F-Droid Manter desactivado o autocompletado Reactivar autocompletado Aviso - Toca para detalles... + Toca para ver detalles Posible intento de phishing Completar e gardar credenciais Completar credenciais @@ -342,7 +343,20 @@ a app desde unha fonte de confianza, como a Play Store, Amazon Appstore, F-Droid Escolle se queres crear un repositorio local ou clonar un remoto. Clonar repositorio remoto Crear repositorio local + Elixe\nChave\nGPG + Elixe a chave GPG coa que queres iniciar a almacenaxe + Elixe chave URL potencialmente incorrecto Semella que o teu URL contén un porto personalizado, pero non indica o esquema ssh://.\nEsto pode facer que o porto sexa considerado parte do enderezo. Preme aquí en OK para arranxalo URL. + URL HTTPS con porto personalizado + Semella que estar a usar un URL HTTPS cun porto personalizado. Esta función non está soportada, e causará problemas futuros. Preme OK para eliminar o porto do URL. + + Servidor proxy + Porto + Axustes do proxy HTTP(S) + URL non válido + Completa e garda contrasinais (gardar require que os servizos de accesibilidade non estén activados) + Eliminar chave do host gardada + Eliminouse correctamente a chave gardada do host! diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 63a605eb..5fcd812d 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -84,10 +84,10 @@ Salva e Copia Cerca - Password: - OTP: + Password + OTP Contenuto extra: - Nome Utente: + Nome Utente Modifica password Copia password Condividi come testo semplice @@ -200,16 +200,17 @@ Invia password come testo semplice usando… Icona app + Seleziona la voce da compilare Ricerca resistente al phishing Abbina con %1$s Cancella abbinamenti esistenti Nessun risultato. - Cerca nell\'archiviazione… + Cerca la voce Salvataggio fallito a causa di un errore interno Quest\'app non è attualmente supportata Le password non corrispondono - Genera password… - Estrai codice da SMS… + Crea voce + Estrai codice da SMS Numero massimo di abbinamenti (%1$d) raggiunto; cancella le corrispondenze prima di aggiungerne di nuove. L\'editore di quest\'app è cambiato da quando hai associato per la prima volta una voce di Password Store con essa: L\'app correntemente installata potrebbe provare a rubare le tue credenziali pretendendo di essere un\'app affidabile.\n\nProva a disinstallare e reinstallare l\'app da una fonte affidabile, come Play Store, Amazon, Appstore, F-Droid, o il negozio del produttore del tuo telefono. @@ -218,7 +219,7 @@ Mantieni l\'Auto-Completamento disabilitato Riabilita l\'Auto-Completamento Avviso - Tocca per i dettagli… + Tocca per i dettagli Possibile tentativo di phishing Compila e salva le credenziali Compila le credenziali @@ -341,7 +342,20 @@ Seleziona se vuoi creare una repo locale o clonarne una remota. Clona Repo Remota Crea Repo Locale + Seleziona\nChiave\nGPG + Seleziona una chiave GPG con cui inizializzare il tuo archivio + Seleziona chiave URL potenzialmente errato Sembra che il tuo URL contenga una porta personalizzata, ma non specifichi lo schema ssh://.\nQuesto può causare che la porta sia considerata una parte del tuo percorso. Premi OK qui per correggere l\'URL. + URL HTTPS con porta personalizzata + Sembra che tu stia usando un URL HTTPS con una porta personalizzata. Questo non è supportato e causerà problemi in futuro. Premere OK per rimuovere la porta dall\'URL. + + Nome host del proxy + Porta + Impostazioni proxy HTTP(S) + URL non valido + Compila e salva le password (il salvataggio necessita che nessun servizio di accessibilità sia abilitato) + Cancella la chiave host salvata + Chiave host cancellata con successo! diff --git a/app/src/nonFree/values-de/strings.xml b/app/src/nonFree/values-de/strings.xml new file mode 100644 index 00000000..bcbcc6ac --- /dev/null +++ b/app/src/nonFree/values-de/strings.xml @@ -0,0 +1,8 @@ + + + + Warte auf SMS… + diff --git a/app/src/nonFree/values-gl/strings.xml b/app/src/nonFree/values-gl/strings.xml new file mode 100644 index 00000000..248ebb31 --- /dev/null +++ b/app/src/nonFree/values-gl/strings.xml @@ -0,0 +1,8 @@ + + + + Agardando polo SMS… + diff --git a/app/src/nonFree/values-it/strings.xml b/app/src/nonFree/values-it/strings.xml new file mode 100644 index 00000000..a9f021a2 --- /dev/null +++ b/app/src/nonFree/values-it/strings.xml @@ -0,0 +1,8 @@ + + + + In attesa del SMS… + diff --git a/app/src/nonFree/values-pt-BR/strings.xml b/app/src/nonFree/values-pt-BR/strings.xml new file mode 100644 index 00000000..26fbf524 --- /dev/null +++ b/app/src/nonFree/values-pt-BR/strings.xml @@ -0,0 +1,8 @@ + + + + Esperando pelo SMS… + diff --git a/app/src/nonFree/values-ru/strings.xml b/app/src/nonFree/values-ru/strings.xml new file mode 100644 index 00000000..0e1a475d --- /dev/null +++ b/app/src/nonFree/values-ru/strings.xml @@ -0,0 +1,8 @@ + + + + Ожидание SMS… + diff --git a/app/src/nonFree/values-uk/strings.xml b/app/src/nonFree/values-uk/strings.xml new file mode 100644 index 00000000..14a3b0f3 --- /dev/null +++ b/app/src/nonFree/values-uk/strings.xml @@ -0,0 +1,8 @@ + + + + Очікування SMS… + diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 47f8aecf..3b719a63 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -21,6 +21,10 @@ gradlePlugin { id = "aps-plugin" implementationClass = "PasswordStorePlugin" } + register("crowdin") { + id = "crowdin-plugin" + implementationClass = "CrowdinDownloadPlugin" + } } } @@ -28,4 +32,5 @@ dependencies { implementation(build.getValue("kotlinGradlePlugin")) implementation(build.getValue("androidGradlePlugin")) implementation(build.getValue("binaryCompatibilityValidator")) + implementation(build.getValue("downloadTaskPlugin")) } diff --git a/buildSrc/buildDependencies.gradle b/buildSrc/buildDependencies.gradle index b7a2f758..dd246fbe 100644 --- a/buildSrc/buildDependencies.gradle +++ b/buildSrc/buildDependencies.gradle @@ -2,10 +2,12 @@ rootProject.ext.versions = [ agp : '4.1.0', kotlin : '1.4.21', binary_compatibility_validator : '0.2.4', + download_plugin : '4.1.1', ] rootProject.ext.build = [ androidGradlePlugin : "com.android.tools.build:gradle:${versions.agp}", kotlinGradlePlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}", binaryCompatibilityValidator : "org.jetbrains.kotlinx:binary-compatibility-validator:${versions.binary_compatibility_validator}", + downloadTaskPlugin : "de.undercouch:gradle-download-task:${versions.download_plugin}", ] diff --git a/buildSrc/src/main/java/CrowdinDownloadPlugin.kt b/buildSrc/src/main/java/CrowdinDownloadPlugin.kt new file mode 100644 index 00000000..7261eec0 --- /dev/null +++ b/buildSrc/src/main/java/CrowdinDownloadPlugin.kt @@ -0,0 +1,76 @@ +/* + * Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved. + * SPDX-License-Identifier: GPL-3.0-only + */ + +import de.undercouch.gradle.tasks.download.Download +import java.io.File +import org.gradle.api.GradleException +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.tasks.Copy +import org.gradle.kotlin.dsl.create +import org.gradle.kotlin.dsl.register + +class CrowdinDownloadPlugin : Plugin { + + override fun apply(project: Project) { + with(project) { + val extension = extensions.create("crowdin") + afterEvaluate { + val projectName = extension.projectName + if (projectName.isEmpty()) { + throw GradleException( + """ + Applying `crowdin-plugin` requires a projectName to be configured via the "crowdin" extension. + """.trimIndent() + ) + } + tasks.register("downloadCrowdin") { + src("https://crowdin.com/backend/download/project/$projectName.zip") + dest("$buildDir/translations.zip") + overwrite(true) + } + tasks.register("extractCrowdin") { + setDependsOn(setOf("downloadCrowdin")) + doFirst { + File(buildDir, "translations").deleteRecursively() + } + from(zipTree("$buildDir/translations.zip")) + into("$buildDir/translations") + } + tasks.register("extractBaseStrings") { + setDependsOn(setOf("extractCrowdin")) + from("$buildDir/translations/${project.name}/src/main/res") + into("${projectDir}/src/main/res") + } + tasks.register("extractNonFreeStrings") { + setDependsOn(setOf("extractCrowdin")) + from("$buildDir/translations/") { + exclude("app/") + } + into("$buildDir/nonFree-translations") + doLast { + File("$buildDir/nonFree-translations") + .listFiles { file: File -> file.isDirectory }?.forEach { file -> + val dest = File("${projectDir}/src/nonFree/values-${file.name}") + val src = File(file, "app/src/nonFree/res/values/strings.xml") + dest.mkdirs() + src.renameTo(File(dest, "strings.xml")) + } + } + } + tasks.register("crowdin") { + setDependsOn(setOf("extractBaseStrings", "extractNonFreeStrings")) + if (!extension.skipCleanup) { + doLast { + File("$buildDir/translations").deleteRecursively() + File("$buildDir/nonFree-translations").deleteRecursively() + File("$buildDir/translations.zip").delete() + } + } + } + } + } + } +} diff --git a/buildSrc/src/main/java/CrowdinExtension.kt b/buildSrc/src/main/java/CrowdinExtension.kt new file mode 100644 index 00000000..a95aede0 --- /dev/null +++ b/buildSrc/src/main/java/CrowdinExtension.kt @@ -0,0 +1,19 @@ +/* + * Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved. + * SPDX-License-Identifier: GPL-3.0-only + */ + +open class CrowdinExtension { + + /** + * Configure the project name on Crowdin + */ + open var projectName = "" + + /** + * Don't delete downloaded and extracted translation archives from build directory. + * + * Useful for debugging. + */ + open var skipCleanup = false +}