From 321ceb797fac20ff4a74d17819b8b75a125ad372 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 9 Feb 2021 18:01:39 +0100 Subject: [PATCH] Refactor translation names & remove no translate unclear file --- OsmAnd/.gitignore | 2 -- OsmAnd/AndroidManifest-nightlyFree.xml | 4 +--- OsmAnd/build-common.gradle | 14 -------------- OsmAnd/build.gradle | 24 +++++++++++------------- OsmAnd/{ => res/values}/no_translate.xml | 1 - 5 files changed, 12 insertions(+), 33 deletions(-) rename OsmAnd/{ => res/values}/no_translate.xml (97%) diff --git a/OsmAnd/.gitignore b/OsmAnd/.gitignore index b8c08a2225..3149fb4209 100644 --- a/OsmAnd/.gitignore +++ b/OsmAnd/.gitignore @@ -39,8 +39,6 @@ mx_* valgrind/ bin/ dist/ -res/values/no_translate.xml -res/values/skip_translate.xml assets/specialphrases/* assets/voice/* assets/fonts/* diff --git a/OsmAnd/AndroidManifest-nightlyFree.xml b/OsmAnd/AndroidManifest-nightlyFree.xml index 6ec6d5a12e..c58c4b35ac 100644 --- a/OsmAnd/AndroidManifest-nightlyFree.xml +++ b/OsmAnd/AndroidManifest-nightlyFree.xml @@ -4,10 +4,8 @@ - replaceNoTranslate(line); - } - } - into 'res/values/' -} task validateTranslate { println "Validating translations" @@ -147,10 +138,6 @@ task collectVoiceAssets(type: Sync) { include "**/*.js" } -task cleanNoTranslate(type: Delete) { - delete('res/values/no_translate.xml') -} - task collectFonts(type: Copy) { from "../../resources/fonts" from "../../resources/rendering_styles/fonts" @@ -262,7 +249,6 @@ task collectExternalResources { copyMapShaderIcons, copyMapPOIIcons, copyLargePOIIcons, - updateNoTranslate, validateTranslate, copyWidgetIcons, copyWidgetIconsHdpi, diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index bf435f606b..22a9d3a2b1 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -105,31 +105,42 @@ android { nightlyFree { dimension "version" applicationId "net.osmand.dev" + resValue "string", "app_name", "OsmAnd Nightly" + resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION").toInteger() : "" // resConfig "en" } androidFull { dimension "version" applicationId "net.osmand.plus" + resValue "string", "app_name", "OsmAnd~" + resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION").toInteger() : "" } gplayFree { dimension "version" applicationId "net.osmand" + resValue "string", "app_name", "OsmAnd" + resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION").toInteger() : "" } gplayFull { dimension "version" applicationId "net.osmand.plus" + resValue "string", "app_name", "OsmAnd+" + resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION").toInteger() : "" } amazonFree { dimension "version" applicationId "net.osmand" + resValue "string", "app_name", "OsmAnd" } amazonFull { dimension "version" applicationId "net.osmand.plus" + resValue "string", "app_name", "OsmAnd+" } huawei { dimension "version" applicationId "net.osmand.huawei" + resValue "string", "app_name", "OsmAnd" } // Build that includes 3D OpenGL release @@ -153,19 +164,6 @@ android { } -def replaceNoTranslate(line) { - if (line.contains("\"app_name\"") && System.getenv("TARGET_APP_PLUS_NAME")) { - return line.replaceAll(">[^<]*<", ">" + System.getenv("TARGET_APP_PLUS_NAME") + "<") - } - if (line.contains("\"app_name_free\"") && System.getenv("TARGET_APP_FREE_NAME")) { - return line.replaceAll(">[^<]*<", ">" + System.getenv("TARGET_APP_FREE_NAME") + "<") - } - if (line.contains("\"app_edition\"") && System.getenv("APP_EDITION")) { - return line.replaceAll(">[^<]*<", ">" + System.getenv("APP_EDITION") + "<") - } - return line; -} - afterEvaluate { android.applicationVariants.all { variant -> variant.javaCompiler.dependsOn(collectExternalResources, buildOsmAndCore, cleanupDuplicatesInCore) diff --git a/OsmAnd/no_translate.xml b/OsmAnd/res/values/no_translate.xml similarity index 97% rename from OsmAnd/no_translate.xml rename to OsmAnd/res/values/no_translate.xml index d5ecc7c149..1bbd142295 100644 --- a/OsmAnd/no_translate.xml +++ b/OsmAnd/res/values/no_translate.xml @@ -1,7 +1,6 @@ OsmAnd~ - OsmAnd Nightly