Refactor translation names & remove no translate unclear file

This commit is contained in:
Victor Shcherb 2021-02-09 18:01:39 +01:00
parent 6cada80a58
commit 2e4ddcffe8
5 changed files with 12 additions and 33 deletions

2
OsmAnd/.gitignore vendored
View file

@ -39,8 +39,6 @@ mx_*
valgrind/
bin/
dist/
res/values/no_translate.xml
res/values/skip_translate.xml
assets/specialphrases/*
assets/voice/*
assets/fonts/*

View file

@ -4,10 +4,8 @@
<application
android:icon="@mipmap/icon_nightly"
android:label="@string/app_name_free"
tools:replace="android:icon">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="fb792288460976727"/>
<activity
android:name="net.osmand.plus.activities.MapActivity"
android:theme="@style/FirstSplashScreenNightlyFree"

View file

@ -106,15 +106,6 @@ android {
}
}
task updateNoTranslate(type: Copy) {
from('.') {
include 'no_translate.xml'
filter {
line -> 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,

View file

@ -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_NAME")) {
return line.replaceAll(">[^<]*<", ">" + System.getenv("TARGET_APP_NAME") + "<")
}
if (line.contains("\"app_name_free\"") && System.getenv("TARGET_APP_NAME")) {
return line.replaceAll(">[^<]*<", ">" + System.getenv("TARGET_APP_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)

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources>
<string name="app_name">OsmAnd~</string>
<string name="app_name_free">OsmAnd Nightly</string>
<!-- string name="app_version_suffix"></string -->
<!-- Not translatable -->