I have the localized strings file that is used in the Iphone app that I work on to port to Android. Are there any tools that go through the file taken from the xcode project and build the xml needed to use the strings in android?
As the apple file is a simple key value file is there a tool that converts string in this format
"key"="value"
to this:
<string name="key"> value </string>
This tool should be easy to build but I appreciate any pointers to already working tools.
I think you might like this tool :
http://members.home.nl/bas.de.reuver/files/stringsconvert.html
Also this one, but it lacks some features (like converting whitespace in name) :
http://localise.biz/free/converter/ios-to-android
It is free, no need of registration, and you won't need to build your own script!
This don't really answer your question, but you may consider DMLocalizedString for your future iOS+Android project. Currently the source is for iOS only, but I believe that making the Android version is pretty easy.
This is one of the areas where the Unix mindset and toolset comes in handy. I don't know what the iPhone format is like, but if it's what you say, with each value one per line, a simple
sed
call could do this:I expect sed is available on your OSX install.
Ok i wrote my own little converter using a little bit from the code from alex.
It was a little bit tricky to get Java to correctly read and write the UTF 16 input I got out of the xcode project but now it is working like a charm.
Added few modification to above solutions:
I improved your main method above to work for me: