[PATCH] [poxml] make internal entities translatable

Marc Mutz mutz at kde.org
Wed May 28 23:30:24 BST 2008


Hei,

You might remember me as the guy that, four years ago, used internal entities 
in kleopatra/index.docbook to have a handy shortcut for the menu entries:
  <!ENTITY view-redisplay "<menuchoice><shortcut><keycombo action='simul'>
  <keycap>F5</keycap></keycombo></shortcut>
  <guimenu>View</guimenu><guimenuitem>Redisplay</guimenuitem></menuchoice>">
...
  Use &view-redisplay; to foo bar.

Up to now, these entities were squarely removed by the poxml parser, which 
made their contents inaccessible to translators. Which, in turn, made it 
impossible for me to use these handy shortcuts.

Since that is clearly an unacceptable state, and since I think that also 
translators could save a bunch of work if these shortcuts were made available 
to them, I've sat down and after a few hours of staring at incomprehensible 
code, came up with attached patch, which fixes this.

In order to be minimally intrusive, I've only enabled entity extraction for 
entities starting with "i18n-". That way, the standard entities such as 
kappname and language don't clobber the .po(t). It's trivial to extract all 
internal entities, though.

The patch is forwards- and backwards compatible. Old po2xml will ignore the 
new data, and new po2xml will leave the entity definition in peace if there's 
no translation for them,

On thing I haven't tested is the effect on the other two programs of the poxml 
suite. split2po and swappo. I just don't know what they do...

I'd like to ask for permission to apply this patch now, in the feature freeze, 
because I think it's a bugfix, and because poxml is a development tool that's 
hardly user-visible, so the freeze shouldn't apply to it.

Another reason is that I intend to make much, much use of this new facility 
when updating kleopatra/index.docbook for Kleopatra 2.0.

I'll commit in ~24h unless someone objects.

Please keep my @kdab address CC'ed.

Thanks,
Marc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: poxml-internal-entities.diff
Type: text/x-diff
Size: 4826 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080529/2902eff1/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080529/2902eff1/attachment.sig>


More information about the kde-core-devel mailing list