Hello,
po4a currently has a --split option, but the support for this option is
not complete (the option is not documented, so this is not a problem).
It currently uses Po.pm:filter to select the strings used in one document,
but, for all the documents, it writes the POT in the same file.
The main issue of --split is that the user doesn't specify where the POT
and POs should be written.
I propose to use a $master variable in po4a_paths for that. For example:
[po4a_paths] po4a/po/$master/$master.pot $lang:po4a/po/$master/$lang.po
(Then the --split option is not needed, it can be autodetected)
The second issue with --split is that all the POs for a language should be
merged (i.e. if a string is translated in a PO, the translation should be
shared by the other POs of the same language).
I propose to use msgcat for that.
Then, if 2 POs have different translations, msgcat will mark this string
fuzzy, and will propose both translations in the POs:
# type: type
#: ref1 ref2
#, fuzzy, no-wrap
msgid "my string"
msgstr ""
"#-#-#-#-# ref1 #-#-#-#-#\n"
"first translation\n"
"#-#-#-#-# ref2 #-#-#-#-#\n"
"second translation"
Later, if this string is unfuzzied in one of these POs, po4a will remove the
fuzzy mark on this string from all the POs.
The attached patch should perform what is described above. It does not use
Po.pm:filter, but msggrep.
I will commit it this week unless you think there is something wrong in
the above description.
Kind Regards,
--
Nekral
Show replies by date