deltachat/scripts/check-translations.sh
bjoern 8b308ca3be
check translation for bad lineends (#2389)
`<br>` lineends are not allowed in strings.xml
and lead to compile errors as "terminating tag missing".

(adding these checks as this pop up from time to time and is easily overseen)
2022-09-30 15:36:30 +02:00

20 lines
824 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

echo potential errors, if any:
# a space after the percent sign
# results in an IllegalFormatException in getString()
grep --include='strings.xml' -r '\% [12]' .
grep --include='strings.xml' -r '\%[$]' .
grep --include='strings.xml' -r '\$ ' .
grep --include='strings.xml' -r ' \$' .
# 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\"']" .
# check for usage of a single `&` - this has to be an `&amp;`
grep --include='strings.xml' -r "&[^a]" .
# single <br> is not needed - and not allowed in xml, leading to error "matching end tag missing"
grep --include='strings.xml' -r "<br" .