martnst / localize-mainmenu

Commandline tool that localizes the common main menu items of an OS X app automatically.
MIT License
42 stars 12 forks source link

XML-reserved characters in keys are not escaped #11

Open homebysix opened 8 years ago

homebysix commented 8 years ago

It looks like localize-mainmenu doesn't consider the escaping of XML-reserved characters such as ampersands and quotations.

I exported an .xliff file from Xcode that contained this section:

      <trans-unit id="Folders &amp; Integration">
        <source>Folders &amp; Integration</source>
        <target>Dossiers &amp; Intégration</target>
        <note>Tab label</note>
      </trans-unit>

After running it through localize-mainmenu, I received this output:

      <trans-unit id="Folders & Integration">
        <source>Folders & Integration</source>
        <target>Dossiers & Intégration</target>
        <note>Tab label</note>
      </trans-unit>

The ampersands in the id, source, and target need to be escaped to &amp; in order to be importable into Xcode.