Any tool to convert Android XML localization to iPhone.strings file?

I think the title is self explanatory.

+8
android xml iphone localization
source share
5 answers

You can extract the localization from the .xml file from Android, and then add it to the iPhone.string file with the latest version of the TM-database tool . This is easy:

  • Launch tool
  • Android source and target xml files and import localization in TM
  • Open the .string file and translate it using TM
  • Save the .string file

See instructions here for more details.

+3
source share

I just looked at it. If you just need to do something to do some of the grunt work, and you're already on OsX, you can use xsltproc and this simple xsl to get you going

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 in a file, transform.xsl or something like that, then from the shell, run the following:

xsltproc transform.xsl your_android_strings.xml> fileforxcode.out

It seemed like it created something that looked right, although you might have to guess with any format lines separately. Regardless, this can save you some work.

+3
source share

I am using a script here . It converts already translated Android localized string files into iOS Localizable.strings files, taking into account string placeholder conversions ( %1$s becomes %1$@ ). Its a short ruby ​​script and easy to follow. Link it to Xcode as a Run script at the beginning of the build process.

+2
source share

You also have this option if you don't want to preproject strings, but just drop the android strings.xml file into your iPhone project.

0
source share

This does not answer your question, but you can consider DMLocalizedString for your future iOS + Android project. Currently, the source is intended only for iOS, but I believe that making the Android version is quite easy.

-one
source share

All Articles