Any tool to convert Android's XML localization to iPhone's .strings file? [closed] Any tool to convert Android's XML localization to iPhone's .strings file? [closed] xml xml

Any tool to convert Android's XML localization to iPhone's .strings file? [closed]


I was just looking at this as well. If you just need something to get some of the grunt work done, and you're on OsX already, you can use xsltproc and this simple xsl to get you going

The xsl:

<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="string">"<xsl:value-of select="@name"/>"= "<xsl:apply-templates/>"; </xsl:template><xsl:template match="resources"><xsl:apply-templates select="string"/> </xsl:template></xsl:stylesheet>   

Save this to a file, transform.xsl or something, then from a shell run the following:

xsltproc transform.xsl your_android_strings.xml > fileforxcode.out

This seemed to generate something that looked right, although you'll probably need to muck with any format strings separately. No matter what, it might save you some work.


You can extract localization from Android .xml file then add it to iPhone .string file with last version of TM-database tool.It is easy:

  1. Launch tool
  2. Open source and target Android xml files and import localization to TM
  3. Open .string file and translate it with TM
  4. Save .string file

Please see the detail instruction here


I use a script here. It converts the already-translated Android localized strings files into iOS Localizable.strings files, accounting for conversions of string placeholders (%1$sbecomes %1$@). Its a short ruby script and is easy to follow. Link it into Xcode as a Run Script at the beginning of your build process.