I simply can't as i need a fully bijective conversion. I've explained how it works in an thread a few days ago. Pasting here for reference:
=cut
upstream uses grit. It's a combination of one grd and several xtb files.
All are XML files (some kind of xslt).
the 1st string of generated_resources.grd (the template):
====
<if expr="not pp_ifdef('use_titlecase')">
<message name="IDS_CONTENT_CONTEXT_PRINTFRAME" desc="The name of the Print Frame command in the content area context menu"> P&rint frame...
</message>
</if>
====
in generated_resources_en_GB.xtb (the en-GB translation file), it looks like this (and nothing else):
there's no obvious link between IDS_CONTENT_CONTEXT_PRINTFRAME and
1002064594444093641. The reason is that in a grd file, a string could be used for
totally different IDS_xxx codes with different conditions in different
contexts. So what grit does is it applies a function to the string
creating the id in order for that string to be translated only once:
some_hash("P&rint frame...") => 1002064594444093641
So for launchpad, i turn all this into:
====
#. IDS_CONTENT_CONTEXT_PRINTFRAME
#. - description: In Title Case: The name of the Print Frame command in
the content area context menu
#. - condition: pp_ifdef('use_titlecase')
#: id: 1002064594444093641
msgid "P&rint Frame..."
msgstr ""
====
of course, i have to transcode all the xml entities and tags so they are
easy to read, and also i need to convert the gettext back to the grit
format.
=end
it explains why my gettext keys changed (msgid is transcoded, and each time i improve/change the transcoding rules, i hit this bug)
I simply can't as i need a fully bijective conversion. I've explained how it works in an thread a few days ago. Pasting here for reference:
=cut
upstream uses grit. It's a combination of one grd and several xtb files.
All are XML files (some kind of xslt).
the 1st string of generated_ resources. grd (the template):
==== 'use_titlecase' )"> CONTENT_ CONTEXT_ PRINTFRAME" desc="The name of the Print Frame command in the content area context menu">
P& rint frame...
<if expr="not pp_ifdef(
<message name="IDS_
</message>
</if>
====
in generated_ resources_ en_GB.xtb (the en-GB translation file), it looks like this (and nothing else):
==== 44093641" >P& rint Frame.. .</translation>
<translation id="10020645944
====
there's no obvious link between IDS_CONTENT_ CONTEXT_ PRINTFRAME and 3641. The reason is that in a grd file, a string could be used for "P& rint frame...") => 1002064594444093641
100206459444409
totally different IDS_xxx codes with different conditions in different
contexts. So what grit does is it applies a function to the string
creating the id in order for that string to be translated only once:
some_hash(
So for launchpad, i turn all this into:
==== CONTEXT_ PRINTFRAME 'use_titlecase' )
#. IDS_CONTENT_
#. - description: In Title Case: The name of the Print Frame command in
the content area context menu
#. - condition: pp_ifdef(
#: id: 1002064594444093641
msgid "P&rint Frame..."
msgstr ""
====
of course, i have to transcode all the xml entities and tags so they are
easy to read, and also i need to convert the gettext back to the grit
format.
=end
it explains why my gettext keys changed (msgid is transcoded, and each time i improve/change the transcoding rules, i hit this bug)