From 00d7d882712b28118386a53075e77a4ccd2dfe16 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 16 Aug 2025 18:55:26 +0200 Subject: gradle: Disable sync_translations (#1076) The diffs created by sync_translations.py creates conflicts with the changes made on Weblate. It is disable to make merging translations from Weblate easier.--- build.gradle | 11 ----------- sync_translations.py | 6 +++++- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 9cad84c..444525e 100644 --- a/build.gradle +++ b/build.gradle @@ -89,8 +89,6 @@ android { } lintOptions { - // Translation are already checked by 'syncTranslations' - disable 'MissingTranslation' } } @@ -121,7 +119,6 @@ tasks.register('genEmojis') { tasks.withType(Test).configureEach { dependsOn 'genLayoutsList' dependsOn 'checkKeyboardLayouts' - dependsOn 'syncTranslations' dependsOn 'compileComposeSequences' } @@ -141,14 +138,6 @@ tasks.register('checkKeyboardLayouts') { } } -tasks.register('syncTranslations') { - println "\nUpdating translations" - exec { - workingDir = projectDir - commandLine "python", "sync_translations.py" - } -} - tasks.register('compileComposeSequences') { def out = "srcs/juloo.keyboard2/ComposeKeyData.java" println "\nGenerating ${out}" diff --git a/sync_translations.py b/sync_translations.py index fe76623..3d0ab7d 100644 --- a/sync_translations.py +++ b/sync_translations.py @@ -1,5 +1,5 @@ import xml.etree.ElementTree as ET -import glob, os +import glob, os, sys # Edit every strings.xml files: # - Add missing translation as comments @@ -87,6 +87,10 @@ def sync_metadata(value_dir, strings): sync_meta_file("short_description.txt", ("short_description", None)) sync_meta_file("full_description.txt", ("store_description", None)) +if len(sys.argv) < 2 or sys.argv[1] != "sync": + print("Syncing of translation files is no longer needed. Run with 'sync_translation.py sync' to do it anyway.") + exit(1) + baseline = parse_strings_file("res/values/strings.xml") for value_dir in glob.glob("res/values-*"): -- cgit v1.2.3