This small guide assumes that you know how to create a public repository with git (or other version control system). Maybe some projects use other VCS, Subversion or whatever; the process would be similar although the commands will be different of course.
If you don’t want to use any VCS, you can just download the corresponding file, translate it, and send it by email or to the BTS of the project, but the commands required are very easy and you’ll see soon that using git (or any VCS) is quite comfortable and less scary than what it seems.
So, you were going to recommend a nice app that you use or found in F-Droid to your friend, but she does not understand English. Why not translating the app for her? And for everybody? It’s a job that can be done in 15 minutes or so (Android apps have very short strings, few menus, and so). Let’s go!
1.- Search the app in the F-Droid website
You can do it going to the URL: https://f-droid.org/repository/browse/?fdfilter=wordofappname
Then, open the details of the app, and learn where’s the source code.
2.- Clone the source code
If you have an account in that forge, fork/clone the project into your account, and then, clone your fork/clone in local.
If you haven’t got an account in that forge, clone the project in local.
git clone URLofTheProjectOrYourClone
3.- In local, create a new branch, and checkout to it.
git checkout -b Spanish
4.- Then, copy the “/res/values” folder into “res/values-XX” folder (where XX is your language code)
cp ./res/values /res/values-es -R
Edit the “strings.xml” file that is in the “res/values-XX” folder, and change the English strings to your language (respect the XML format).
6.- Translate other files, or delete them
If there are more files in that folder (e.g. “arrays.xml”), review them to know if they have “translatable” strings. If yes, translate them. If not, delete the files.
When you are finished, commit your changes:
git add res/values-es/*
git commit -a
(Message can be “Spanish translation” or so)
8.- Push your changes to your public repo
If you didn’t create a public clone of the repo in your forge, create a public repo and push your local stuff into there.
git push --all
9.- Request a merge to the original repo
(Using the web interface of the forge, if it is the same for the original repo and your clone, or sending an email or creating an issue and providing the URL of your repo). For example, open a new issue in the project’s BTS
Title: Spanish translation available for merging
Body: Hi everybody.
Thanks for your work in "nameofapp".
I have completed a Spanish translation, it's available for review/merge in the Spanish branch of my repo:
Translations are new features, and having a new feature in your app for free is a great thing, so probably the app developer(s) will merge your translation soon.
Share your joy with your friends, so they begin to use the app you translated, and maybe become translators too!
You can comment on this post in this pump.io thread.