poedit and xml files

后端 未结 5 734
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 14:11

How to configure poedit to extract strings from xml file?

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


    
5条回答
  •  旧巷少年郎
    2020-12-09 14:21

    The above advice to abuse the Glade extractor to parse non-Glade XML files is misguided. It’s never going to work well (case in point: some comments around here). Of course, it was better than nothing back in 2010.

    Starting with gettext 0.19.7 (bundled with Poedit since 1.8.7), there’s a better way: there’s now builtin support in gettext for custom XML files via ITS rules.

    The best way to extract strings from a custom XML file is to

    1. Add a custom extractor with your extension, specifying standard gettext invocation, without the -L glade bit.
    2. Write ITS rules for your file format.
    3. Put them in the location of other .its and .loc files in Poedit’s installation.

提交回复
热议问题