stop lconvert from complaining about plurals
authorDaniel Albers <daniel@lbe.rs>
Mon, 23 Jan 2012 23:50:54 +0000 (00:50 +0100)
committerDaniel Albers <daniel@lbers.com>
Tue, 24 Jan 2012 00:14:22 +0000 (01:14 +0100)
commitca427796353e9dba3b6af1acc83755b891c1e2f3
treeee49ac33767046f741d388f810323a7c7593e4f7
parent0c3a3be22d7bbac5c9fcf1c807cb6b6873ae24af
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.
14 files changed:
cmake/modules/QuasselMacros.cmake
po/cs.po
po/de.po
po/en_AU.po
po/en_GB.po
po/es.po
po/fr.po
po/gl.po
po/it.po
po/nb.po
po/nl.po
po/pt_BR.po
po/sl.po
po/uk.po