Difference between revisions of "Localization Guide"

From AwesomeWiki
(Getting set up)
Line 1: Line 1:
We want the Awesome Foundation website to be in as many languages as possible! If you're interested in helping us translate the site to a new language, just follow this guide...
+
==Introduction==
 +
 
 +
We want the Awesome Foundation website to be in as many languages as possible! If you're interested in helping us translate the site to a new language, just follow this guide. There are two different places to translate the site, and they are both important. The [[#Basic String Translation]] is for translating the interface of the website, including page headers, form labels, and navigation. The [[#Page Text Translation]] is for large blocks of text on the site, including the FAQ and About Us page.
 +
 
 +
Currently project pages are not able to be multi-lingual.  
  
 
==Basic String Translation==
 
==Basic String Translation==

Revision as of 17:54, 17 March 2015

Introduction

We want the Awesome Foundation website to be in as many languages as possible! If you're interested in helping us translate the site to a new language, just follow this guide. There are two different places to translate the site, and they are both important. The #Basic String Translation is for translating the interface of the website, including page headers, form labels, and navigation. The #Page Text Translation is for large blocks of text on the site, including the FAQ and About Us page.

Currently project pages are not able to be multi-lingual.

Basic String Translation

Getting set up

  1. Download this file: config/locales/en.yml (go to File -> Save Page As in your browser after clicking on the link)
  2. Open the file in a plain text editor
    • Mac: You can use TextEdit, but make sure it is not in rich text mode. If you can bold or italicize something in the editor, you're in the wrong mode, go to Format -> Make Plain Text to make sure you're in the right mode.
    • Windows: You can use Notepad.
  3. Save the file as xx.yml, where xx is the two-letter language code for the language you are translating.
  4. On the first line of the file, change "en:" to "xx:"

You are now ready to enter the translations into your new YAML file!

The Basics

The file is a YAML file that will tell the website how to swap out the English-centric copy for other localizations. It's mostly about direct translation of every word on the page (the copy, the comments, the navigation, and even the metadata), but it can actually go beyond that to culturally-correct numbering & dates as well!

Simple Example

All you really need to do is go down the file, swapping out each phrase for the proper one in your language. For example, if you were doing French, you could change:

thanks: "Thanks for applying!"

to

thanks: "Merci d'application!"

Quotation Marks

You may notice that some of the phrases have quotations marks around them while others do not. By default, quotation marks are not necessary. However, if your phrase has some funky symbols in it (like : or ! or < or >), you should put quotation marks around it so that it doesn't interfere with the code.

Wrapping Up

First, use this YAML checker to make sure that your code works.

Page Text Translation

There are also large blocks of text that need to get translated outside of the *.yml files. These are formatted using Markdown and are stored in the app/views/locales directory of the app.

Getting Set Up

  1. Download all of the raw versions of the *.en.md files in the directory: app/views/locales
  2. Change these files names to *.xx.md (where xx is again the 2 letter code for your language)

The Basics

These files are formatted using Markdown, which is a simple formatting language that is a bit easier to read than HTML. Just follow along with the sample English translation and you should get the hang of it pretty easily.

Submitting Your Translation

There are two ways of getting your translation into the app:

  1. If you are so inclined, you can make a Github Pull Request. This is outside of the scope of this project, but we accept all pull requests and this is the easiest way of getting your translation to us
  2. If you are not comfortable with Github, feel free to email your translations to webmaster@awesomefoundation.org and someone will import them for you

Thanks for all of your help!