diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-08-30 13:28:11 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-08-30 13:43:42 (GMT) |
commit | e32d8cd49c4e3137889512e3f3a19018b4195970 (patch) | |
tree | 2d02bbbb06dc87124187a8176743e8f3a4be0465 | |
parent | 47fe98d194e48ec2bac1f75d8b5bd57820d7f66a (diff) | |
download | Qt-e32d8cd49c4e3137889512e3f3a19018b4195970.zip Qt-e32d8cd49c4e3137889512e3f3a19018b4195970.tar.gz Qt-e32d8cd49c4e3137889512e3f3a19018b4195970.tar.bz2 |
properly parse ts contexts in obsolete messages
-rw-r--r-- | tests/auto/linguist/lconvert/data/test20.ts | 9 | ||||
-rw-r--r-- | tools/linguist/shared/po.cpp | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/linguist/lconvert/data/test20.ts b/tests/auto/linguist/lconvert/data/test20.ts index f042edf..0e38b4b 100644 --- a/tests/auto/linguist/lconvert/data/test20.ts +++ b/tests/auto/linguist/lconvert/data/test20.ts @@ -158,5 +158,14 @@ <comment>comment with | and ~ and so~</comment> <translation type="unfinished"></translation> </message> + <message> + <source>just something obsolete</source> + <translation type="obsolete">translated obsoletion</translation> + </message> + <message> + <source>something else obsolete</source> + <comment>comment with | and ~ and so~</comment> + <translation type="obsolete">another translated obsoletion</translation> + </message> </context> </TS> diff --git a/tools/linguist/shared/po.cpp b/tools/linguist/shared/po.cpp index 620d27b..a58a0bf 100644 --- a/tools/linguist/shared/po.cpp +++ b/tools/linguist/shared/po.cpp @@ -656,6 +656,8 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) item.isPlural = true; } else if (line.startsWith("#~ msgctxt ")) { item.tscomment = slurpEscapedString(lines, l, 11, "#~ ", cd); + if (qtContexts) + splitContext(&item.tscomment, &item.context); } else { cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'")) .arg(l + 1).arg(codec->toUnicode(lines[l]))); |