Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add translations (e.g. Spanish) #57

Closed
DeeDeeG opened this issue Feb 7, 2018 · 8 comments
Closed

Add translations (e.g. Spanish) #57

DeeDeeG opened this issue Feb 7, 2018 · 8 comments

Comments

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Feb 7, 2018

Hi all,

The web app is now translatable, and a Spanish translation is probably going to go live soon. There is also interest in seeing the mobile apps translated. If there is any way I or other contributors can help, that would be great.

(I think we have an ability to signal boost about this via Twitter to try to get more people looking into it if need be.)

@hissingpanda
Copy link
Member

I don't have the capacity to do this at the moment, but would be able to merge pull requests that others submit. So I think a call on Twitter would be great!

@DeeDeeG
Copy link
Contributor Author

DeeDeeG commented Feb 14, 2019

I found how translations are managed. I poked around in Android Studio, and was double-clicking on all the source files to see what tools the IDE brings up to work on those files.

When you double-click strings.xml (app/src/main/res/values/strings.xml), it brings up a translation editor.

Full documentation is here: https://developer.android.com/studio/write/translations-editor

but I find the translation editor, and even the raw files, reasonably straight-forward.


Here's an example translated string (translated with Google Translate):

app/src/main/res/values/strings.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="add_bathroom_unisex">Unisex</string>
</resources>

app/src/main/res/values-es/strings.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="add_bathroom_unisex">Unisexo</string>
</resources>

@DeeDeeG
Copy link
Contributor Author

DeeDeeG commented Feb 14, 2019

I think we have high-quality translations in the web repo that we can re-use, since many of the strings are verbatim from the website. (And we can of course give credit to the people who submitted the translations to the other repo.)

@DeeDeeG DeeDeeG changed the title Make app translatable, add another locale (eg Spanish) Add translations (e.g. Spanish) Feb 20, 2019
@thehme
Copy link

thehme commented Sep 27, 2019

Hi all, I'd like to add a PR for a Spanish translation.

@DeeDeeG
Copy link
Contributor Author

DeeDeeG commented Sep 27, 2019

hi @thehme,

That would be most welcome! To add the Spanish translation, you can add a file in this repo at app/src/main/res/values-es/strings.xml; This requires adding a new folder values-es/ in app/src/main/res/.

Then, you can copy everything from app/src/main/res/values/strings.xml to the new values-es/strings.xml file.

Lastly, you can edit values-es/strings.xml, so as to change the text in quotes the text inside XML <string> tags (<string name="some_name">Text to translate is here.</string>) from English to Spanish. For example:

    <string name="bathroom">bathroom</string>

becomes:

    <string name="bathroom">baño</string>

You may also want to look at the translations for the web app here for guidance: https://github.com/RefugeRestrooms/refugerestrooms/tree/develop/config/locales/es

We will likely ask someone who has contributed translations to the web app if they can review your translations and perhaps give feedback.

Thanks again for your interest in translating the app!


P.S. If you are already using Android Studio, you might prefer to translate within Android Studio. Instructions for that are here: https://developer.android.com/studio/write/translations-editor

@thehme
Copy link

thehme commented Oct 1, 2019

Hi @DeeDeeG I created a PR at #77, I'll wait for reviews, thanks.

@hissingpanda
Copy link
Member

Thanks for this @thehme! I'll try to test everything out this week and deploy

@hissingpanda
Copy link
Member

PR is great - Tested it out in spanish on my device. Going to push live tonight. Thanks so much @thehme !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants