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.

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

index 738d49e..2e2dfef 100644 (file)
@@ -19,13 +19,14 @@ endmacro(setup_qt4_variables)
 
 # This generates a .ts from a .po file
 macro(generate_ts outvar basename)
-  set(input ${CMAKE_SOURCE_DIR}/po/${basename}.po)
+  set(input ${basename}.po)
   set(output ${CMAKE_BINARY_DIR}/po/${basename}.ts)
   add_custom_command(OUTPUT ${output}
           COMMAND ${QT_LCONVERT_EXECUTABLE}
           ARGS -i ${input}
                -of ts
                -o ${output}
+          WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po
 # This is a workaround to add (duplicate) strings that lconvert missed to the .ts
           COMMAND ${QT_LUPDATE_EXECUTABLE}
           ARGS -silent
index 1f442ae..55beefe 100644 (file)
--- a/po/cs.po
+++ b/po/cs.po
@@ -3937,9 +3937,6 @@ msgid_plural "%n pending highlights"
 msgstr[0] "%n zbývající zvýraznění"
 msgstr[1] "%n zbývající zvýraznění"
 msgstr[2] "%n zbývajících zvýraznění"
-msgstr[3] "%n zbývající zvýraznění"
-msgstr[4] "%n zbývající zvýraznění"
-msgstr[5] "%n zbývajících zvýraznění"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5725,9 +5722,6 @@ msgid_plural "%n pending highlights"
 msgstr[0] "%n zbývající zvýraznění"
 msgstr[1] "%n zbývající zvýraznění"
 msgstr[2] "%n zbývajících zvýraznění"
-msgstr[3] "%n zbývající zvýraznění"
-msgstr[4] "%n zbývající zvýraznění"
-msgstr[5] "%n zbývajících zvýraznění"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index 34f48a7..8940548 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -3967,8 +3967,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n ausstehende Hervorhebungen"
 msgstr[1] "%n ausstehende Hervorhebungen"
-msgstr[2] "%n ausstehende Hervorhebungen"
-msgstr[3] "%n ausstehende Hervorhebungen"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5755,8 +5753,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n ausstehende Hervorhebungen"
 msgstr[1] "%n ausstehende Hervorhebungen"
-msgstr[2] "%n ausstehende Hervorhebungen"
-msgstr[3] "%n ausstehende Hervorhebungen"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index e4a5f82..1df0946 100644 (file)
@@ -3935,8 +3935,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n pending highlights"
 msgstr[1] "%n pending highlights"
-msgstr[2] "%n pending highlights"
-msgstr[3] "%n pending highlights"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5718,8 +5716,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n pending highlights"
 msgstr[1] "%n pending highlights"
-msgstr[2] "%n pending highlights"
-msgstr[3] "%n pending highlights"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index 8744986..73b85b4 100644 (file)
@@ -3936,8 +3936,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n pending highlights"
 msgstr[1] "%n pending highlights"
-msgstr[2] "%n pending highlights"
-msgstr[3] "%n pending highlights"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5719,8 +5717,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n pending highlights"
 msgstr[1] "%n pending highlights"
-msgstr[2] "%n pending highlights"
-msgstr[3] "%n pending highlights"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index dd99174..ebadfe1 100644 (file)
--- a/po/es.po
+++ b/po/es.po
@@ -3971,8 +3971,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n resaltados pendientes"
 msgstr[1] "%n resaltados pendientes"
-msgstr[2] "%n resaltados pendientes"
-msgstr[3] "%n resaltados pendientes"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5763,8 +5761,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n resaltados pendientes"
 msgstr[1] "%n resaltados pendientes"
-msgstr[2] "%n resaltados pendientes"
-msgstr[3] "%n resaltados pendientes"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index 64157a9..e46136a 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -3972,8 +3972,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n message surligné en attente"
 msgstr[1] "%n messages surlignés en attente"
-msgstr[2] "%n message surligné en attente"
-msgstr[3] "%n messages surlignés en attente"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5772,8 +5770,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n message surligné en attente"
 msgstr[1] "%n messages surlignés en attente"
-msgstr[2] "%n message surligné en attente"
-msgstr[3] "%n messages surlignés en attente"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index 692b002..720e8b1 100644 (file)
--- a/po/gl.po
+++ b/po/gl.po
@@ -3958,8 +3958,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n resaltado pendente"
 msgstr[1] "%n resaltados pendentes"
-msgstr[2] "%n resaltado pendente"
-msgstr[3] "%n resaltados pendentes"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5749,8 +5747,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n resaltado pendente"
 msgstr[1] "%n resaltados pendentes"
-msgstr[2] "%n resaltado pendente"
-msgstr[3] "%n resaltados pendentes"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index 00d0391..ad67e55 100644 (file)
--- a/po/it.po
+++ b/po/it.po
@@ -3963,8 +3963,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n evento in attesa"
 msgstr[1] "%n eventi in attesa"
-msgstr[2] "%n evento in attesa"
-msgstr[3] "%n eventi in attesa"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5761,8 +5759,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n evento in attesa"
 msgstr[1] "%n eventi in attesa"
-msgstr[2] "%n evento in attesa"
-msgstr[3] "%n eventi in attesa"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index 3c13a4e..b33e6a6 100644 (file)
--- a/po/nb.po
+++ b/po/nb.po
@@ -3942,8 +3942,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n utheving(er) er ikke lest"
 msgstr[1] "%n utheving(er) er ikke lest"
-msgstr[2] "%n utheving(er) er ikke lest"
-msgstr[3] "%n utheving(er) er ikke lest"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5728,8 +5726,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n utheving(er) er ikke lest"
 msgstr[1] "%n utheving(er) er ikke lest"
-msgstr[2] "%n utheving(er) er ikke lest"
-msgstr[3] "%n utheving(er) er ikke lest"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index 803c398..5b63bef 100644 (file)
--- a/po/nl.po
+++ b/po/nl.po
@@ -3945,8 +3945,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n markering in wachtrij"
 msgstr[1] "%n markeringen in wachtrij"
-msgstr[2] "%n markering in wachtrij"
-msgstr[3] "%n markeringen in wachtrij"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5740,8 +5738,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n markering in wachtrij"
 msgstr[1] "%n markeringen in wachtrij"
-msgstr[2] "%n markering in wachtrij"
-msgstr[3] "%n markeringen in wachtrij"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index 086a164..0051418 100644 (file)
@@ -3959,8 +3959,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n destaque pendente"
 msgstr[1] "%n destaques pendentes"
-msgstr[2] "%n destaque pendente"
-msgstr[3] "%n destaques pendentes"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5751,8 +5749,6 @@ msgid "%n pending highlights"
 msgid_plural "%n pending highlights"
 msgstr[0] "%n destaque pendente"
 msgstr[1] "%n destaques pendentes"
-msgstr[2] "%n destaque pendente"
-msgstr[3] "%n destaques pendentes"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index c1684df..09f4c0c 100644 (file)
--- a/po/sl.po
+++ b/po/sl.po
@@ -3941,10 +3941,6 @@ msgstr[0] "%n čakajoč poudarek"
 msgstr[1] "%n čakajoča poudarka"
 msgstr[2] "%n čakajoči poudarki"
 msgstr[3] "%n čakajočih poudarkov"
-msgstr[4] "%n čakajoč poudarek"
-msgstr[5] "%n čakajoča poudarka"
-msgstr[6] "%n čakajoči poudarki"
-msgstr[7] "%n čakajočih poudarkov"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5730,10 +5726,6 @@ msgstr[0] "%n čakajoč poudarek"
 msgstr[1] "%n čakajoča poudarka"
 msgstr[2] "%n čakajoči poudarki"
 msgstr[3] "%n čakajočih poudarkov"
-msgstr[4] "%n čakajoč poudarek"
-msgstr[5] "%n čakajoča poudarka"
-msgstr[6] "%n čakajoči poudarki"
-msgstr[7] "%n čakajočih poudarkov"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"
index f7a2dce..ad80bca 100644 (file)
--- a/po/uk.po
+++ b/po/uk.po
@@ -3969,9 +3969,6 @@ msgid_plural "%n pending highlights"
 msgstr[0] "%n підсвічування у черзі"
 msgstr[1] "%n підсвічування у черзі"
 msgstr[2] "%n підсвічувань у черзі"
-msgstr[3] "%n підсвічування у черзі"
-msgstr[4] "%n підсвічування у черзі"
-msgstr[5] "%n підсвічувань у черзі"
 
 #: ../src/qtui/settingspages/keysequencewidget.cpp:77
 msgctxt "KeySequenceButton|"
@@ -5762,9 +5759,6 @@ msgid_plural "%n pending highlights"
 msgstr[0] "%n підсвічування у черзі"
 msgstr[1] "%n підсвічування у черзі"
 msgstr[2] "%n підсвічувань у черзі"
-msgstr[3] "%n підсвічування у черзі"
-msgstr[4] "%n підсвічування у черзі"
-msgstr[5] "%n підсвічувань у черзі"
 
 #: ../src/qtui/systraynotificationbackend.cpp:135
 msgctxt "SystrayNotificationBackend::ConfigWidget|"