From 663b022ab88acc47a5df898aa8df10d2e6422ba1 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 16 Sep 2011 14:50:34 +0000 Subject: 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 --- muse2/find_manual_plural.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 muse2/find_manual_plural.sh (limited to 'muse2/find_manual_plural.sh') diff --git a/muse2/find_manual_plural.sh b/muse2/find_manual_plural.sh new file mode 100755 index 00000000..3e77f304 --- /dev/null +++ b/muse2/find_manual_plural.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# this script tries to find all "bad" code like +# (number > 1 ? tr ("tracks") : tr("track")) +# that is, all manual plural diversifications +# you should replace them by: +# tr("processed %n track(s)", "", number) +# the "" is a translator comment. you may write what you want +# +# you have to create appropriate translations for this (even for +# english!). linguist will ask you for the singular, plural, +# and in some language even paucal form then. +# +# 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 -- cgit v1.2.3