Skip to content

Translations

Julia Nguyen edited this page Oct 9, 2018 · 26 revisions

Doing translations require collaboration between translators and developers! Sometimes the translator is also a developer which is cool, but not required. If you're interested in proposing a new language for our app to be in, please file an issue (example) and tag it under the label "translations". You don't have to be the person working on the translations either, but it would be helpful to suggest translators and developers who could help.

Translating

Our translations are gender neutral and have a similar tone as talking to a loved one. We do not tolerate inappropriate or stigmatizing language.

All of our translation files can be found in /config/locales. Assuming that you'll be translating from English to a new language, you'll want to duplicate all of the files containing en.yml. We recommend copying and pasting the contents the English files into your new language files and then doing translations line by line.

For example:

back_to_top: Back to Top copied and pasted from en.yml would become back_to_top: Regresar al Inicio in Spanish in es.yml

It is highly recommended that you work on translations with another fluent individual. They don't have to be a developer. Having a second pair of eyes will help catch translation errors!

In every existing main translation file e.g. ptbr.yml, add an entry for the new language

  languages:
     en: English
     es: Español
     ptbr: Português
     sv: Svenska

Developer Specific

Adding New Locale to i18n

Add locale initials to the config.i18n.available_locales array in config/application.rb

Testing

Please do manual testing. View the app on your local development environment and ensure everything is a-ok.

We have automated tests for i18n to make sure things don't go wrong.

Please add your new translation files to the LOCALES_FILES object in spec/support/compare_locales_support.rb and add tests to spec/compare_locales_support_spec.rb.

Dotting your i's and crossing your t's

Your branch will be out of sync over time, and keys may be changed or added to the master branch. After syncing your branch to master you can run some tools to check against these changes to help identify them. The repository sexybiggetje/ifme-languagetools contains scripts for comparing locales and offers writing style suggestions using a LanguageTool.org instance.

Huge thanks to @sexybiggetje, who translated our site to Dutch, for working on this tool!

Clone this wiki locally