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)
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.


No differences found