Skip to content
Snippets Groups Projects
Commit 7225adf2 authored by akwizgran's avatar akwizgran
Browse files

Merge branch 'fix_translation_verification' into 'master'

Use project path for translation verification

See merge request akwizgran/briar!840
parents 99e2b7ea 30228cf0
No related branches found
No related tags found
No related merge requests found
...@@ -288,14 +288,14 @@ android { ...@@ -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 { ...@@ -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()
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment