diff options
author | Florian Jung <flo@windfisch.org> | 2011-09-16 14:50:34 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-09-16 14:50:34 +0000 |
commit | 663b022ab88acc47a5df898aa8df10d2e6422ba1 (patch) | |
tree | e808adc272cb15357840c504fa83038ffeed2f91 /muse2/find_translation_concatenation.sh | |
parent | cc28402b688bd757a6ffe32f582b0c0c967a677a (diff) |
fixed wrong usages of tr() like:
QString::toNumber(num) + ( num > 1 ? tr("parts") : tr("part")) or
tr("file ")+ filename +tr(" could not be loaded")
and commited scripts to find such errors
Diffstat (limited to 'muse2/find_translation_concatenation.sh')
-rwxr-xr-x | muse2/find_translation_concatenation.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/muse2/find_translation_concatenation.sh b/muse2/find_translation_concatenation.sh new file mode 100755 index 00000000..644944f1 --- /dev/null +++ b/muse2/find_translation_concatenation.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# this script tries to find all "bad" code like +# tr("the file ") + your_file + tr(" could not be loaded!") +# you should replace it by: +# tr("the file %1 could not be loaded!").arg(your_file) +# +# this script is not perfect. it misses some "bad" things, and +# finds some "good" things. + +{ +find . -iname '*.cpp' -print0 | xargs -0 grep -E 'tr *\("[^"]*" *\) *\+'; +find . -iname '*.cpp' -print0 | xargs -0 grep -E '\+ *tr *\("[^"]*" *\)'; +} | sort | uniq + + |