ether/etherpad-lite — pull request #1279 by joker-x (2012-12-10 11:31:50+00:00)
Title: Added support for translate plugins

For test it i have build a version of ep_headings traslated to spanish, german and french. The package is called ep_headings-trl8 and can be installed from admin/plugins throught npm

## How to internationalize a plugin (for developers)

You can see the [ep_headings-trl8 source code](https://github.com/joker-x/etherpad-plugins/tree/master/ep_headings-trl8) for a functional example.

### 1. Mark the strings to translate

#### In a template file of your plugin
From:
```html
Heading 1

```
To:
```html

```

#### In a javascript file of your plugin
From:
```js
alert ('Chat');
```
To:
```js
alert(_('pad.chat'));
```
### 2. Create translate files under locales directory of your plugin:

* The name of the file must be one of the [language code supported by translatewiki](http://joker-x.github.com/languages4translatewiki/test/) in lowercase: (en → English, es → Spanish...)
* The extension of the file must be ``.ini``
* The language by default is English, you will always provide a en.ini file with ``[*]`` in its first line, instead of ``[en]``.
* For avoid name conflicts, we recommend starting yours keys with the name of your plugin followed by a dot.

*your-plugin-dir/locales/en.ini*
```
[*]
ep_heading-trl8.h1 = Heading 1
```

*your-plugin-dir/locales/es.ini*
```
[es]
ep_heading-trl8.h1 = Título 1
```

**This is all!**
When start Etherpad server it will detect your new messages and merge automatically with messages core.

### Overwrite core messages

You can overwrite the translated message of the Etherpad core in yours ini files.
For example, if you can show *Notes* instead of *Chat* edit

*your-plugin-dir/locales/en.ini*
```
[*]
ep_heading-trl8.h1 = Heading 1
pad.chat = Notes
```

and restart server