localisation of messages from xml files

Olivier Goffart ogoffart at kde.org
Mon Apr 17 09:41:10 BST 2006


Le Lundi 17 Avril 2006 05:22, Cristian Tibirna a écrit :
> Hello
>
> KDEPrint uses a few xml files for defining special purpose filters that can
> be used in preprint processing of print jobs. These xmls contain
> display-able messages. (e.g.
> http://websvn.kde.org/branches/KDE/3.5/kdelibs/kdeprint/filters/psnup.xml)
>
> Is there a mechanism that allows for some kind of l10n of such messages?
>
> Thanks


We have translated strings in xml files for style.

In Kopete 0.11,  the style are xslt, we put user visible strings in
 <kopete-i18n> tags.  and pass their content to i18n() in the code.
The rules to extract theses:

messages:
        $(EXTRACTRC) --context="Translators: The %FOO% placeholders are variables that are substituted in the code, please leave them untranslated" --tag-group=none --tag kopete-i18n styles/*.xsl > xml_doc.cpp
        $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc | egrep -v '(libkopete/compat|protocols/testbed)'` > rc.cpp
        LIST=`find . -name \*.h -o -name \*.cpp -o -name \*.c | egrep -v '(libkopete/compat|protocols/testbed)'`; \
        if test -n "$$LIST"; then \
                $(XGETTEXT) $$LIST -o $(podir)/kopete.pot; \
        fi
        -rm xml_doc.cpp



Another idea is to use 
<foo xml:lang="en">Hello</foo>
<foo xml:lang="fr">Salut</foo>
<foo xml:lang="nl">Dag</foo>
....
But it's a bit unpractical


--
Olivier (aka Gof)
-------------- 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/20060417/5cee0ecf/attachment.sig>


More information about the kde-core-devel mailing list