Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
523 views
in Technique[技术] by (71.8m points)

internationalization - poedit and xml files

How to configure poedit to extract strings from xml file?

I have Zend Framework navigation items in .xml like this:

<entry-i>
    <label>Text to translate</label>
    <params>
       ...
    <params>
<entry-i>

And I want poedit to read just messages from <label>s.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have been searching for a solution as well, and I have just gotten it to work!

In Poedit (I have 1.4.2), add a new parser (Edit > Preferences) with the following properties:

  • Language: XML
  • List of extensions separated by semicolons (e.g. .cpp;.h): *.xml
  • Parser command: xgettext --force-po -o %o %C %K %F -L glade
  • An item in keywords list: -k%k
  • An item in input files list: %f
  • Source code charset: --from-code=%c

In your translation project, add label and title to your keyword list and update the catalog.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...