Recently I had the need to translate an Android app to various languages. I try google a little and very soon I realize that what used to exists doesn't work any more. Why? because what used to exists was using Google Translate API, and that API now is charged. After I realize this I put my hands in my keyboard and a few hours latter I had create my own command line app that translates a strings.xml file into one or various languages using Bing Translator API. Bing Translator API is very easy to use and all you need is a AppID. Then do an HTTP request like this: http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=YOUR_KEY_HERE&text=Test this app&from=en&to=pt And in the response you will have your text translated. The app I've create is in .Net and requires either .Net or Mono to work. To get the app working you will have to create an AppID and then edit the file App.config and place the generated AppID in section BING_KEY. Then compile the app and run it. The app accepts the following arguments: usage: APKTranslator -h Prints help message -i <arg> Strings.xml file path -o <arg> Output path to save strings.xml file. Default strings.xml parent folder \values-{target language}\strings.xml -s <arg> Source language. Default en -t <arg> Target language. Default all supported languages -override If the same resource key exists in destination strings.xml, override it. It's very easy to use and here is an example: * mono ApkTranslator.exe -i /home/user/projects/app/res/values/strings.xml -override - This command will translate string.xml to all Bing supported languages, and it will override all existing resource keys. * mono ApkTranslator.exe -i /home/user/projects/app/res/values/strings.xml -o /home/user/projects/app/res/values-pt/strings.xml -s en -t pt - This command will translate strings.xml from english to portuguese and it won't override any resource key that exists in portuguese strings.xml file. Tags: .Net, Mono, Bing, Translator, App, Application, APK, Android, APK Translator |

