Hi,

I'm thrilled to see lconvert appear in Qt/4.5. I had been trying to  
use Launchpad to assist in translating our project and it only accepts  
PO files. So we worked with a combination of the Translate toolkit  
(ts2po and po2ts) and GNU gettext.

Among other things, we've had real trouble in the past converting from  
PO files back into TS files. Unfortunately, lconvert doesn't help.

I'm certainly not an expert in PO files. It seems like PO files  
perform "compression" -- that is, they sort strings and merge  
duplicate translation requests together. This means there's one entry  
per translatable string.

For example from our POT file:
> #. i18n: tag string
> #. i18n: file ./avogadro/src/mainwindow.ui line 13
> #: avogadro/src/aboutdialog.cpp:63 avogadro/src/mainwindow.cpp:601
...
> #: libavogadro/src/tools/insertfragmentdialog.cpp:152 rc.cpp:39
> msgid "Avogadro"
> msgstr ""

So when I convert from PO to TS using lconvert, all my translated  
strings become obsolete. There's no context, and lconvert doesn't  
"unroll" the PO file.

Here's the PO file generated by lconvert:
> #. ts-context Avogadro::AboutDialog
> #: ../avogadro/src/aboutdialog.cpp:63
> #, fuzzy
> msgid "Avogadro"
> msgstr "Avogadro"

Now, I've tried to merge my old PO file into this new PO file (which  
clearly has contexts), but msgmerge complains -- the file has  
duplicate msgid strings:
> avogadro2.po:5452: ...this is the location of the first definition
> avogadro2.po:15179: duplicate message definition...
> avogadro2.po:7040: ...this is the location of the first definition
> avogadro2.po:15184: duplicate message definition...
> ...

I'd like to help get to the bottom of this. I see two solutions:
1) Convert #. ts-context into msgctxt instead. That would generate an  
acceptable PO file. But the key problem is that PO files compress down  
to one msgid per translatable string, and this solution would generate  
a huge number of duplicate translations (i.e., one per context).
2) I'd really love to see some way to "expand" the PO file into a  
valid TS file. This saves a lot of work for translators -- they only  
have to translate "length" once.

If there's anything I can do to contribute code for this, test or  
debug this, please let me know. I'd be glad to help!

Cheers,
-Geoff
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to