diff --git a/.tx/config b/.tx/config index 18fae2ddf..53f8bbb00 100644 --- a/.tx/config +++ b/.tx/config @@ -3,8 +3,8 @@ host = https://www.transifex.com lang_map = id: in, ja_JP: ja, nl_NL: nl, pt_BR: pt-rBR, zh_CN: zh-rCN, zh_TW: zh-rTW [o:delta-chat:p:delta-chat-app:r:stringsxml] -file_filter = res/values-/strings.xml -source_file = res/values/strings.xml +file_filter = src/main/res/values-/strings.xml +source_file = src/main/res/values/strings.xml source_lang = en type = ANDROID diff --git a/build.gradle b/build.gradle index 1b6691425..740613a2f 100644 --- a/build.gradle +++ b/build.gradle @@ -131,9 +131,6 @@ android { sourceSets { main { - manifest.srcFile 'AndroidManifest.xml' - res.srcDirs = ['res'] - assets.srcDirs = ['assets'] jniLibs.srcDirs = ['libs'] } } diff --git a/scripts/add-language.sh b/scripts/add-language.sh index c44b4fb77..57fe38791 100755 --- a/scripts/add-language.sh +++ b/scripts/add-language.sh @@ -7,18 +7,19 @@ then fi LANG=$1 +RES=src/main/res -mkdir res/values-$LANG/ +mkdir $RES/values-$LANG/ -cp res/values/strings.xml res/values-$LANG/strings.xml +cp $RES/values/strings.xml $RES/values-$LANG/strings.xml # set time to old date because transifex may have different file times # and does not overwrite old file # (using -t as sth. as -d "100 days ago" does not work on mac) -touch -t 201901010000 res/values-$LANG/strings.xml +touch -t 201901010000 $RES/values-$LANG/strings.xml -echo "res/values-$LANG/strings.xml added:" -echo "- add the name to res/values/arrays.xml" +echo "$RES/values-$LANG/strings.xml added:" +echo "- add the name to $RES/values/arrays.xml" echo "- if needed, language mappings can be added to .tx/config" echo "- pull translations using ./scripts/tx-pull-translations.sh" echo " (on problems, 'tx -d pull' gives verbose output)" diff --git a/scripts/check-translations.sh b/scripts/check-translations.sh index 501caeb89..ffe5abd7d 100755 --- a/scripts/check-translations.sh +++ b/scripts/check-translations.sh @@ -1,20 +1,22 @@ echo potential errors, if any: +RES=./src/main/res + # a space after the percent sign # results in an IllegalFormatException in getString() -grep --include='strings.xml' -r '\% [12]' ./res/ -grep --include='strings.xml' -r '\%[$]' ./res/ -grep --include='strings.xml' -r '\$ ' ./res/ -grep --include='strings.xml' -r ' \$' ./res/ +grep --include='strings.xml' -r '\% [12]' $RES +grep --include='strings.xml' -r '\%[$]' $RES +grep --include='strings.xml' -r '\$ ' $RES +grep --include='strings.xml' -r ' \$' $RES # check for broken usage of escape sequences: # - alert on `\ n`, `\ N`, `\n\Another paragraph` and so on # - allow only `\n`, `\"`, `\'` and `\’` # (`’` might not be escaped, but it is done often eg. in "sq", so we allow that for now) -grep --include='strings.xml' -r "\\\\[^n\"'’]" ./res/ +grep --include='strings.xml' -r "\\\\[^n\"'’]" $RES # check for usage of a single `&` - this has to be an `&` -grep --include='strings.xml' -r "&[^a]" ./res/ +grep --include='strings.xml' -r "&[^a]" $RES # single
is not needed - and not allowed in xml, leading to error "matching end tag missing" -grep --include='strings.xml' -r "