[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: Re: Problem with contexts in TS<->PO
From: Albert Astals Cid <aacid () kde ! org>
Date: 2014-09-15 18:10:58
Message-ID: 11667538.tm5vnXr2To () xps
[Download RAW message or body]
El Dilluns, 15 de setembre de 2014, a les 19:52:08, Lukáš Tinkl va escriure:
> Dne 15.9.2014 v 19:26 Albert Astals Cid napsal(a):
> > El Dilluns, 15 de setembre de 2014, a les 13:06:31, Chusslove Illich va
> >
> > escriure:
> >>> -> lupdate mangles/breaks the context.
> >>>
> >>> WONTFIX on Qt side (fixing lupdate)
> >>>
> >>> Solution: directly extract po from Qt frameworks, so the context are
> >>> correct; requires few changes on the infrastructure
> >>
> >> This sounds strange. Is it related to
> >> https://bugreports.qt-project.org/browse/QTBUG-40444?
> >
> > Don't know, tbh i never understood; the problems of such things being
> > explained with words instead of with examples on the command line :D
> >
> > Lukas can you give us the expamples of what is really wrong?
> >
> > Cheers,
> >
> > Albert
> >>
> >> If so, I see Oswald's
> >> comments as correct, including the need-more-info resolution.
> >>
> >> For cases where PO is just an intermediate format, Gettext call
> >> conventions
> >> do not apply (e.g. that context in PO must match the context in code).
> >> Any
> >> conventions are instead established by the conversion tool. So the only
> >> relevant thing is whether installing the final TS file (after TS->PO->TS
> >> process) results in seeing all translations in the program. If it
> >> doesn't,
> >> then something is broken in the PO->TS part of lconvert, and not in
> >> lupdate
> >> or the TS->PO part of lconvert.
>
> I explained the problem and its symptoms (directly with examples) in the
> above bug report.
Ok, i didn't know if that was the bug or not, so reading the bug i see two
things you mention.
* The msgctxt has to match the source code context exactly and the comment has
to be put before the entry as a plain comment.
I do not agree with this, anywya seems more a stylistic thing than a real
problem.
* When converting such PO file back to TS with lconvert, the context is lost.
That doesn't happen here, i'm attaching my kcompletion5_qt.po and the ts
genereated with lconvert. The ca.ts is fine, no?
Cheers,
Albert
> I guess our solution would be to directly extract the
> strings using gettext, converting them effectively to PO files and
> finally compiling them into QM binary format using msgfmt. That way we
> can preserve the correct context and also save unnecessary roundtrips
> when converting TS->PO->QM
["ca.po" (ca.po)]
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Qt-Contexts: true\n"
#: khistorycombobox.cpp:203
msgctxt "KHistoryComboBox|"
msgid "Clear &History"
msgstr ""
#: klineedit.cpp:154
msgctxt "KLineEdit|Italic placeholder text in line edits: 0 no, 1 yes"
msgid "1"
msgstr ""
#: klineedit.cpp:224
msgctxt "KLineEdit|@action:button Clear current text in the line edit"
msgid "Clear text"
msgstr "momo"
#: klineedit.cpp:1111
msgctxt "KLineEdit|"
msgid "C&lear"
msgstr "lala"
#: klineedit.cpp:1125
msgctxt "KLineEdit|@title:menu"
msgid "Text Completion"
msgstr ""
#: klineedit.cpp:1132
msgctxt "KLineEdit|@item:inmenu Text Completion"
msgid "None"
msgstr ""
#: klineedit.cpp:1133
msgctxt "KLineEdit|@item:inmenu Text Completion"
msgid "Manual"
msgstr ""
#: klineedit.cpp:1134
msgctxt "KLineEdit|@item:inmenu Text Completion"
msgid "Automatic"
msgstr ""
#: klineedit.cpp:1135
msgctxt "KLineEdit|@item:inmenu Text Completion"
msgid "Dropdown List"
msgstr ""
#: klineedit.cpp:1136
msgctxt "KLineEdit|@item:inmenu Text Completion"
msgid "Short Automatic"
msgstr ""
#: klineedit.cpp:1137
msgctxt "KLineEdit|@item:inmenu Text Completion"
msgid "Dropdown List && Automatic"
msgstr ""
#: klineedit.cpp:1167
msgctxt "KLineEdit|@item:inmenu Text Completion"
msgid "Default"
msgstr ""
["ca.ts" (ca.ts)]
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>KHistoryComboBox</name>
<message>
<location filename="khistorycombobox.cpp" line="203"/>
<source>Clear &History</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KLineEdit</name>
<message>
<location filename="klineedit.cpp" line="154"/>
<source>1</source>
<comment>Italic placeholder text in line edits: 0 no, 1 yes</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="klineedit.cpp" line="224"/>
<source>Clear text</source>
<comment>@action:button Clear current text in the line edit</comment>
<translation>momo</translation>
</message>
<message>
<location filename="klineedit.cpp" line="1111"/>
<source>C&lear</source>
<translation>lala</translation>
</message>
<message>
<location filename="klineedit.cpp" line="1125"/>
<source>Text Completion</source>
<comment>@title:menu</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="klineedit.cpp" line="1132"/>
<source>None</source>
<comment>@item:inmenu Text Completion</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="klineedit.cpp" line="1133"/>
<source>Manual</source>
<comment>@item:inmenu Text Completion</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="klineedit.cpp" line="1134"/>
<source>Automatic</source>
<comment>@item:inmenu Text Completion</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="klineedit.cpp" line="1135"/>
<source>Dropdown List</source>
<comment>@item:inmenu Text Completion</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="klineedit.cpp" line="1136"/>
<source>Short Automatic</source>
<comment>@item:inmenu Text Completion</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="klineedit.cpp" line="1137"/>
<source>Dropdown List && Automatic</source>
<comment>@item:inmenu Text Completion</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="klineedit.cpp" line="1167"/>
<source>Default</source>
<comment>@item:inmenu Text Completion</comment>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic