mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 17:06:16 -04:00
Simplify local locale file format
This commit is contained in:
parent
d84951cd04
commit
220e084484
41 changed files with 43 additions and 51 deletions
|
@ -19,7 +19,6 @@ Translations will be send back to us regularly and will eventually appear in the
|
|||
`/src/locales` contains files for all supported languages which contain the translated strings. Translation files are simple `*.json` files and look like this:
|
||||
|
||||
```json
|
||||
{ "fr":
|
||||
{ "pad.modals.connected": "Connecté."
|
||||
, "pad.modals.uderdup": "Ouvrir dans une nouvelle fenêtre."
|
||||
, "pad.toolbar.unindent.title": "Désindenter"
|
||||
|
@ -27,7 +26,6 @@ Translations will be send back to us regularly and will eventually appear in the
|
|||
, "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.
|
||||
|
@ -71,18 +69,14 @@ alert(window._('pad.chat'));
|
|||
|
||||
*ep_your-plugin/locales/en.json*
|
||||
```
|
||||
{ "en":
|
||||
{ "ep_your-plugin.h1": "Heading 1"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*ep_your-plugin/locales/es.json*
|
||||
```
|
||||
{ "es":
|
||||
{ "ep_your-plugin.h1": "Título 1"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Everytime the http server is started, it will auto-detect your messages and merge them automatically with the core messages.
|
||||
|
@ -94,9 +88,7 @@ For example, if you want to replace `Chat` with `Notes`, simply add...
|
|||
|
||||
*ep_your-plugin/locales/en.json*
|
||||
```
|
||||
{ "en":
|
||||
{ "ep_your-plugin.h1": "Heading 1"
|
||||
, "pad.chat": "Notes"
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue