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.
Go to the File menu and choose New > File, then select Strings File from the list of file types and click Next. Give this file the name “Localizable. strings”, then click Create to open it for editing.
Choose File → New → File ..., select Strings File under Resources, and click Next. Name it Localizable, then click on Create.
Localizable. strings stores application strings as key-value pairs for each language. Let's create this file for the base language first. Select File → New → File… or just tap Ctrl+N or Cmd+N .
Ensure your app accepts user-generated text in any language and in multiple languages at once, independent of the user interface language. This allows app content to appear in the user's preferred language and format. SwiftUI makes it easy to create localized apps.
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 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:
$ cat infile
"key"="value"
"key2"="value2"
$ sed 's/ *"\([^"]*\)" *= *"\([^"]*\)"/<string name="\1">\2<\/string>/' infile
<string name="key">value</string>
<string name="key2">value2</string>
$
I expect sed is available on your OSX install.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With