I have worked on this for the since a week or so and finally managed to have something « working » ! 🙂
That’s not perfect but I expect to get some time to update this later…
ALPHA VERSION, the source code is partially documented & manually tested. You might want to save your files first !!!
What’s for ?
This project is an Eclipse plugin designed to synchronize your strings.xml across localization :
- It reads your res/values.xml
- It compares all its ids & comments to add missing ids to your other localization
Why ?
I usually do increment builds with different languages but I’m often doing this as « indie » and when I want to sort my strings.xml I usually add them to my res/values/strings.xml and just forget to add them to others locales… and guess what ? Users don’t like SLOPPY WORK. 🙂
« lol » almost useless ?
Well, it will show you empty strings too fill into your strings.xml thanks to warnings… it might save you some minutes and maybe if I could implement some translate tools API to make you a direct translation… it might actually be more efficient than doing some copy paste in http://translate.google.com/toolkit/.
I find copy pasting strings ids really boring so you have better solutions I’m looking forward to hear them 😉
Some features ?
- Backup by default at <ProjectFolder>/backup/ (checkbox to disable)
- Revert process from your backup
- Reorder your localized strings.xml as your main strings.xml
Get it :
How to use :
- Right click on an Android Project and hit « Sync strings.xml ».
Small example :
res/values/strings.xml :
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="loading">Loading :</string>
<string name="skipTutorial">Skip tutorial</string>
<string name="next">Next</string>
<!-- tutorial on screen process image -->
<string name="tutorial1_hi1">First time on ComboTouch ?</string>
<string name="tutorial1_hi2">Press next to start the tutorial.</string>
<string name="tutorial2">Check the color there</string>
<string name="tutorial3">Now just tap the right color !</string>
<string name="tutorial4">As long as it matchs the color...</string>
<string name="tutorial4b">Your multiplier goes up every 10*2^n !</string>
<string name="tutorial5">Every 50*2^n boxes, you get god mode !</string>
<string name="tutorial5b">But only for 2 seconds !</string>
<string name="tutorial6">Now it\'s your turn !</string>
</resources>
res/values-fr/strings.xml :
<resources>
<string name="loading">Loading :</string>
<string name="skipTutorial">Skip tutorial</string>
<string name="next">Next</string>
</resources>
--------------------- Android Strings tool process ----------------------
Now the res/values-fr/strings.xml looks like :
<resources>
<string name="loading">Loading :</string>
<string name="skipTutorial">Skip tutorial</string>
<string name="next">Next</string>
<!-- tutorial on screen process strings -->
<string name="tutorial1_hi1"></string>
<string name="tutorial1_hi2"></string>
<string name="tutorial2"></string>
<string name="tutorial3"></string>
<string name="tutorial4"></string>
<string name="tutorial4b"></string>
<string name="tutorial5"></string>
<string name="tutorial5b"></string>
<string name="tutorial6"></string>
</resources>
It’s Open source :
You can find the source code under APACHE Licence 2.0 ( yet to submit some licence file… ) :
https://github.com/Kayrnt/AndroidStringToolPlugin
but also the standalone version ( just a java program ) :
https://github.com/Kayrnt/AndroidStringTool
Todo list :
play starcraft 2
- support plurals
- Make some tests
- Do a proper documentation
- fix the layout of the custom dialog & add progress bar & error management…
- optimize perfomances (concurrency is a bitch)
- Mavenize ?
Feel free to pull & push & fork & reuse & create plugins or whatever !