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...
 
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...
 +
 +
==Basic String Translation==
  
 
===Getting set up===
 
===Getting set up===
Line 8: Line 10:
 
# Save the file as xx.yml, where xx is the [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes two-letter language code] for the language you are translating.
 
# Save the file as xx.yml, where xx is the [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes two-letter language code] for the language you are translating.
 
# On the first line of the file, change "en:" to "xx:"
 
# On the first line of the file, change "en:" to "xx:"
# Also download all of the raw versions of the *.en.md files in the directory: https://github.com/awesomefoundation/awesomebits/tree/master/app/views/locales (these are larger blocks of text for pages like the About page and FAQ)
 
# Change these files names to *.xx.md (where xx is again the 2 letter code for your language)
 
  
You are now ready to enter the translations into your new YAML and Markdown files!
+
You are now ready to enter the translations into your new YAML file!
  
 
===The Basics===
 
===The Basics===
Line 18: Line 18:
 
====Simple Example====
 
====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:
 
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!"}}
+
 
 +
thanks: "Thanks for applying!"
 +
 
 
to
 
to
{{thanks: "Merci d'application!"}}
+
 
 +
thanks: "Merci d'application!"
  
 
====Quotation Marks====
 
====Quotation Marks====
Line 27: Line 30:
 
===Wrapping Up===
 
===Wrapping Up===
 
First, use [http://yaml-online-parser.appspot.com/ this YAML checker] to make sure that your code works.
 
First, use [http://yaml-online-parser.appspot.com/ 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](https://github.com/awesomefoundation/awesomebits/tree/master/app/views/locales) directory of the app.
 +
 +
===Getting Set Up===
 +
 +
# Download all of the raw versions of the *.en.md files in the directory: [app/views/locales](https://github.com/awesomefoundation/awesomebits/tree/master/app/views/locales)
 +
# 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:
 +
 +
# 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
 +
# 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!

Revision as of 08:06, 4 February 2015

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...

Basic String Translation

Getting set up

  1. Download this file: https://raw.github.com/awesomefoundation/awesomebits/master/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](https://github.com/awesomefoundation/awesomebits/tree/master/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](https://github.com/awesomefoundation/awesomebits/tree/master/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!