Crear Localization for developers - remove redundant namespace authored by emmapeel's avatar emmapeel
# Translation process for Tor Project developers
To have a real impact worlwide, our software needs to break the language barriers a **majority of the global population** has.
Localizing our software let us share it with more people, and should eventually lead to better software in itself, even if it needs a bit more work.
If you have doubts about how to localize your software, please get in touch with emmapeel@torproject.org
# How to be nice to translators
Remember that **if you generate better quality source strings, the translations will be better**.
## Translators' input
The translators find many errors on the source strings, it is important to have a look at the [open issues in transifex](https://www.transifex.com/otf/torproject/translate/#issues) (needs login)
After selecting a string, check the Comments section on the bottom right: there you will see the issue the translator has found:
![issues_transifex.cleaned](uploads/b5f0d333ba730c5ad35a569e9c50297d/issues_transifex.cleaned.png)
Please read the incredibly good article [https://www.smashingmagazine.com/2012/07/12-commandments-software-localization/ 12 Commandments Of Software Localization] from Zack Grossbart to get an introduction to software localization from an engineer's point of view. This are developers best practices with l10n in mind:
### 1. NEVER CONCATENATE STRINGS
It may sound efficient in English, but the truth is that different languages have different ways of saying things, and the order is important. Please make it so the whole sentences is up for translation at once.
### 2. PUNCTUATION IS PART OF THE SENTENCE
Please add all punctuation for translation, as different languages use different punctuation rules. Punctuation is part of the sentence.
### 3. NO HARDCODED UPPERCASES OR CAPITALIZATION
Ortographic rules change depending on a word being capitalized or not in many languages, as Greek and Russian. Other languages, like Arabic, don't even have capital letters, so your styling will not be seen.
That is why you should refrain of hardcoding this styles on CSS or other similar way, and if you want a capitalized sentence, write the actual sentence capitalized as you would like to see it, so the translator understands what you want, and translates your intention on the local rules (maybe adding exclamation signs or something else).
### 4. ADD COMMENTS OR EXPLANATIONS ON HOW TO TRANSLATE
Context is everything when translating, and if a string has many errors, it probably means that a developer comment explaining how to translate is needed.
When the source text is in English, as on our project, the objects on that language have no gender. But objects have gender in many languages: Spanish, Italian, French, German... So when we translate 'Published' to German, we need to know what was published, to give the correct gender to the adjective.
### 5. PROVIDE SCREENSHOTS AND EARLY LOCALIZED RESOURCES
The translators will translate better if they can see the effect their translations have. Try to get a staging/beta version early, so they can do a final review for the language with the real application.
[Add screenshots to the translation platform](https://www.transifex.com/otf/torproject/context/) so the translators see how the words will look on the interface.
This will improve the translation because the translators will have the context of the strings, and can also translate looking at the interface.
The localization coordinator can add the screenshots, but you need to provide them. Screenshots with error messages should also be present.
### Getting your translations added to Transifex
#### Prepare your files for translation
* Check [Transifex] for supported file types
* Our Tier 1 languages contain languages that are read from right to left (RTL). Make sure that your interface can support that.
* Open a ticket in the component [Community/L10n](https://gitlab.torproject.org/tpo/community/l10n/-/issues) with a link to a file in a repository with your English strings.
* Please attach screenshots for all the strings, or better, upload them to transifex.
* Contact `emmapeel <at> torproject <dot> org` and she will make the bot pick them up and produce two branches on the [https://gitweb.torproject.org/translation.git translation] repository
* Wait for strings to be added to Transifex and git
### Transifex Sandbox
For developers, there is a [sandbox available](https://www.transifex.com/otf/tor-project-sandbox/content/) to test translations and start integration, before having the projects sent to the translators.
If you would like to test your applications there, please ask for access to the L10n Coordinator.
On the Sandbox you can upload translation files and you will see how the strings look to the translators. Please check that the comments for translators are well placed.
### Your translations
* Clone the [https://gitweb.torproject.org/translation.git translation repository]
* Check out the branch for your project (e.g. ''git checkout mat-gui'')
* If you only want translations that are completed, check out the ''_completed'' branch instead (e.g. ''git checkout mat-gui_completed''). Currently this branch only provides reviewed strings as well.
'''NOTE:''' Transifex does '''not''' do any kind of input validation on the translated strings. You need to make sure that the strings you include are valid and do not contain anything malicious.
### Stats
arthuredelstein is helping with some stats about translation, so they can be accessed from outside transifex:
* Tor Browser Locales: https://torpat.ch/locales
* Tor Browser Manual Locales: https://torpat.ch/manual-locales
* Tor Support Portal Locales: https://torpat.ch/support-locales
thanks arthur!
# How do we call the languages?
### Call them as they call them
When we present a list of languages, we like to call them as the speakers of that language call them. Because if they don't speak English, they probably don't know how their language is spell in English (specially if they use other kind of characters).
We can easily read Spanish/English because we share a Latin alphabet. People using another kind of alphabets (Arabic, Cyrillic, Georgian, etc) will look for familiar letters before reading.
### language codes: Always better to follow Mozilla
Many of our applications depend on the Tor Browser, which in turn depends on Mozilla. By making sure your apps will expect the language codes as in mozilla, you can ensure links and other things are going to work across the whole project. See here for Mozilla language codes: https://hg.mozilla.org/l10n-central/ . Check with the localization coordinator if you don't know what is the situation with your app.
Incidentally, transifex may differ from this codes, but we can correct that through our translation repo. For example, we use en-US for the Tor Browser default locale, but it is called en in Transiffex.
### Actual list
|| tbb Lang code || transifex || English name || Preferred name (orig) ||
|| ar || || Arabic || عربية (ar) ||
|| ca || || || Català (ref #31600) ||
|| cs || || || česky ||
|| da || || || Dansk ||
|| de || || || Deutsch ||
|| el || || || Ελληνικά (el) ||
|| en-US || en || || ||
|| es-AR || || || ||
|| es-ES || es || || Español ||
|| fa || || || ﻑﺍﺮﺳی ||
|| fr || || || Français ||
|| ga-IE || ga || Irish || Gaeilge (ga) ||
|| he || || Hebrew || עברית ||
|| hr || || Croatian || hrvatski ||
|| hu || || Hungarian || Magyar nyelv (hu) ||
|| id || || || bahasa Indonesia ||
|| is || || Icelandic || Íslenska ||
|| it || || || Italiano ||
|| ja || || || 日本語 ||
|| ka || || Georgian || ქართული ენა ||
|| ko || || || 한국어 ||
|| lt || ||Lithuanian || lietuvių ||
|| mk || || Macedonian || македонски (mk) ||
|| ml || || Malayalam || മലയാളം ||
|| ms || ms_MY|| Malay || Bahasa Melayu ||
|| nb-NO || || || Norsk bokmål ||
|| nl || || Dutch || Nederlands (nl) ||
|| pl || || Polish || polski ||
|| pt-BR || || || Português Br. ||
|| pt-PT || || || Português Port. ||
|| ro || || Romanian || Română ||
|| ru || || Russian || Русский ||
|| sv-SE || sv || Swedish || Svenska (sv) ||
|| th || || Thai || ภาษาไทย (th) ||
|| tr || || || Türkçe ||
|| vi || || || Tiếng Việt ||
|| uk || || || українська ||
|| zh-CN || zh_CN || || 简体中文 (zh-CN) ||
|| zh-TW || zh_TW || || 正體字 (zh-TW) ||