Difference between revisions of "Gallery3:Localization" - Gallery Codex
Personal tools

Difference between revisions of "Gallery3:Localization"

From Gallery Codex

(Localizing Gallery 3)
(Allowed HTML)
Line 43: Line 43:
 
** Allowed values for href: a placeholder (e.g. %url) or "#"
 
** Allowed values for href: a placeholder (e.g. %url) or "#"
 
** And <a %attr>Click me</a> is allowed as well (using %attr as a placeholder for various element attributes, as defined by the source message)
 
** And <a %attr>Click me</a> is allowed as well (using %attr as a placeholder for various element attributes, as defined by the source message)
* b, i, em, strong (no attributes allowed)
+
* b, br, i, em, strong (no attributes allowed)
  
 
[[Category:Gallery 3:Usage|Localization]]
 
[[Category:Gallery 3:Usage|Localization]]

Revision as of 01:25, 22 January 2010

Localizing Gallery 3

Gallery 3 is internationalized. Instead of containing language specific text messages, it tracks text in a special way so that it can be extracted and translated into other languages. Users will see a version of the text that has been converted into their own language.

In order for the users to see a localized version of Gallery's text, somebody must first translate the text messages that Gallery is going to display. This process is called "localization".

Gallery 3 has a built-in user interface to add your translations. To translate in Gallery 3, do the following:

  1. Browse to "Admin" > "Settings" > "Language" and activate the language you want to translate to.
  2. If the target translation isn't the default language for your Gallery, go to your user settings and make the new language your account's preferred language.
  3. Now enable the translation mode at the very bottom of the page "Admin" > "Settings" > "Language" by clicking on "Start translating"
  4. At the bottom right, click on "Translate" to show the translation interface
  5. Now you can browse around in your Gallery, select a message in the lower left and enter the translation in the lower right.

To translate messages like "Start translating" and "Login", i.e. messages that are never shown when you are in the translation mode, click in the translation UI on "Show all." Also, note that you first have to click on "Get updates" to index all messages of your Gallery before "Show all" really shows all messages.

Sharing Your Translations

Translating is a lot of work. Luckily you don't have to do it all yourself. If we all share our own translations, we all only have to do a fraction of the work. Please share your translations! To share (= upload) your translations, do the following:

  1. As a one time configuration step, "Admin" > "Settings" > "Language" and follow the instructions at the bottom of the page to get a translation API key.
  2. Once configured, all you have to do is click the "Share" button on the same page to upload your translations to the translation server.

Notes

  • All your translations are stored in a single database table ("outgoing_translations") on your own Gallery server.
    • It's recommended that you create a backup of this table if you've spent a lot of time adding your own translations. Else all the work might be gone if something bad happens to the server or to the Gallery installation.
  • The translation server is a database to share translations with other Gallery users, and it's located at gallery.menalto.com.
  • There are multiple reasons why your translation submission to the translation server might not be accepted immediately
    • If there is an existing translation for the same message and the same language, and you submit a new (better?) translation, the newer translation wins. But if the existing translation received more votes, it's still the default translation for this message.
    • If your translation contains HTML elements (e.g. <a>Click me</a>), then it is only immediately activated if the HTML is part of the small subset of valid HTML that is allowed in Gallery 3 translation messages.

Style Guide

  • Translations should have the same placeholders as the source message (e.g. %author)
  • Translations can only contain a specific subset of HTML (see below)
  • Translations must be well formed HTML (e.g. all HTML elements must be closed)
  • All HTML element attributes must use double-quotes as value delimiter. Single-quotes are not allowed as delimiter.

Allowed HTML

  • a (link anchor) element
    • allowed attributes: class, href.
    • Allowed values for href: a placeholder (e.g. %url) or "#"
    • And <a %attr>Click me</a> is allowed as well (using %attr as a placeholder for various element attributes, as defined by the source message)
  • b, br, i, em, strong (no attributes allowed)
advertisements