From: Daniel Albers Date: Mon, 23 Jan 2012 23:50:54 +0000 (+0100) Subject: stop lconvert from complaining about plurals X-Git-Tag: 0.8-beta1~36 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=ca427796353e9dba3b6af1acc83755b891c1e2f3;hp=ca427796353e9dba3b6af1acc83755b891c1e2f3 stop lconvert from complaining about plurals Weird issue. lconvert of Qt 4.7.4 complains when: a) … there are msgstr[x] with x > nplurals=y, i. e. translations for more plural forms than the language actually has. Understandable, so we remove redundant plurals with black voodoo: for pofile in *.po; do IFS='=' read var plurals \ < <(egrep -o 'nplurals=[[:digit:]]+' $pofile); maxplural=$(egrep -o 'msgstr\[[[:digit:]]+\]' $pofile | egrep -o '[[:digit:]]+' | sort -rn | head -n 1); for ((i=$plurals; i<=$maxplural; i++)); do sed -i -re "/^msgstr\[$i\]/d;" $pofile; done; done b) … the .po path contains a '/'. Huh? Yeah. `lconvert -i xy.po …` is fine. `lconvert -i ./xy.po …` produces an error. So we're running lconvert from ${CMAKE_SOURCE_DIR}/po now. ---