mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 20:29:52 +01:00
Merge branch 'fix_translation_verification' into 'master'
Use project path for translation verification See merge request akwizgran/briar!840
This commit is contained in:
@@ -288,14 +288,14 @@ android {
|
|||||||
|
|
||||||
task verifyTranslations {
|
task verifyTranslations {
|
||||||
doLast {
|
doLast {
|
||||||
def file = "briar-android/src/main/res/values/arrays.xml"
|
def file = project.file("src/main/res/values/arrays.xml")
|
||||||
def arrays = new XmlParser().parse(file)
|
def arrays = new XmlParser().parse(file)
|
||||||
def lc = arrays.children().find { it.@name == "pref_language_values" }
|
def lc = arrays.children().find { it.@name == "pref_language_values" }
|
||||||
def translations = []
|
def translations = []
|
||||||
lc.children().each { value -> translations.add(value.text()) }
|
lc.children().each { value -> translations.add(value.text()) }
|
||||||
|
|
||||||
def folders = ["default", "en-US"]
|
def folders = ["default", "en-US"]
|
||||||
new File("briar-android/src/main/res").eachDir { dir ->
|
project.file("src/main/res").eachDir { dir ->
|
||||||
if (dir.name.startsWith("values-") && !dir.name.endsWith("night")) {
|
if (dir.name.startsWith("values-") && !dir.name.endsWith("night")) {
|
||||||
folders.add(dir.name.substring(7).replace("-r", "-"))
|
folders.add(dir.name.substring(7).replace("-r", "-"))
|
||||||
}
|
}
|
||||||
@@ -310,14 +310,14 @@ task verifyTranslations {
|
|||||||
+ "\nhave no matching value folder")
|
+ "\nhave no matching value folder")
|
||||||
|
|
||||||
// Some devices use iw instead of he for hebrew
|
// Some devices use iw instead of he for hebrew
|
||||||
def hebrew_legacy = new File("briar-android/src/main/res/values-iw")
|
def hebrew_legacy = project.file("src/main/res/values-iw")
|
||||||
def hebrew = new File("briar-android/src/main/res/values-he")
|
def hebrew = project.file("src/main/res/values-he")
|
||||||
// Copy values-he to values-iw
|
// Copy values-he to values-iw
|
||||||
if (hebrew.exists()) {
|
if (hebrew.exists()) {
|
||||||
hebrew_legacy.mkdir()
|
hebrew_legacy.mkdir()
|
||||||
copy {
|
copy {
|
||||||
from 'src/main/res/values-he'
|
from hebrew.getAbsolutePath()
|
||||||
into 'src/main/res/values-iw'
|
into hebrew_legacy.getAbsolutePath()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user