Etherpad lite provides a multi-language user interface, that's apart from your users' content, so users from different countries can collaborate on a single document, while still having the user interface displayed in their mother tongue.
We rely on http://translatewiki.net to handle the translation process for us, so if you'd like to help...
Translate Etherpad lite interface
Fetch
Translations will be send back to us regularly and will eventually appear in the next release.
/src/locales
contains files for all supported languages which contain the translated strings. Translation files are simple *.json
files and look like this:
{ "pad.modals.connected": "Connect�."
, "pad.modals.uderdup": "Ouvrir dans une nouvelle fen�tre."
, "pad.toolbar.unindent.title": "D�sindenter"
, "pad.toolbar.undo.title": "Annuler (Ctrl-Z)"
, "timeslider.pageTitle": "{{appTitle}} Curseur temporel"
, ...
}
Each translation consists of a key (the id of the string that is to be translated) and the translated string. Terms in curly braces must not be touched but left as they are, since they represent a dynamically changing part of the string like a variable. Imagine a message welcoming a user: Welcome, {{userName}}!
would be translated as Ahoy, {{userName}}!
in pirate.
We use a language
cookie to save your language settings if you change them. If you don't, we autodetect your locale using information from your browser. Now, that we know your preferred language this information is feeded into a very nice library called html10n.js, which loads the appropriate translations and applies them to our templates, providing translation params, pluralization, include rules and even a nice javascript API along the way.
In the template files of your plugin, change all hardcoded messages/strings...
from:
<option value="0">Heading 1</option>
to:
<option data-l10n-id="ep_heading.h1" value="0"></option>
In the javascript files of your plugin, chaneg all hardcoded messages/strings...
from:
alert ('Chat');
to:
alert(window._('pad.chat'));
.json
en.json
In order to avoid naming conflicts, your message keys should start with the name of your plugin followed by a dot (see below)
ep_your-plugin/locales/en.json*
<span class="type"> "ep_your-plugin.h1": "Heading 1"
</span>
ep_your-plugin/locales/es.json*
<span class="type"> "ep_your-plugin.h1": "T�tulo 1"
</span>
Everytime the http server is started, it will auto-detect your messages and merge them automatically with the core messages.
You can overwrite Etherpad Lite's core messages in your plugin's locale files.
For example, if you want to replace Chat
with Notes
, simply add...
ep_your-plugin/locales/en.json
{ "ep_your-plugin.h1": "Heading 1"
, "pad.chat": "Notes"
}