diff --git a/HISTORY.md b/HISTORY.md index 2cf022a..2b4ea7c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,8 +3,9 @@ https://github.com/josdejong/jsoneditor -## not yet released, version 5.13.4 +## not yet released, version 5.14.0 +- Implemented support for translations. Thanks @mariohmol. - Fixed a bug sometimes occurring when dragging items from array to object, see #509. Thanks @43081j. - Fixed autocomplete not accepting returned `null` values, see #512. diff --git a/docs/api.md b/docs/api.md index 5081b20..6302205 100644 --- a/docs/api.md +++ b/docs/api.md @@ -125,7 +125,7 @@ Constructs a new JSONEditor. The following example allow you can create a "Person" node and a "Address" node, each one will appear in your context menu, once you selected the whole json object will be created. - ```js + ```js var options = { templates: [ { @@ -192,12 +192,12 @@ Constructs a new JSONEditor. Adds status bar to the buttom of the editor - the status bar shows the cursor position and a count of the selected charcters. True by default. Only applicable when `mode` is 'code' or 'text'. - - `{string} language` +- `{string} language` - The default language comes from the browser navigator, but you can force a specific language. So use here string as 'en' or 'pt-BR'. + The default language comes from the browser navigator, but you can force a specific language. So use here string as 'en' or 'pt-BR'. Built-in languages: `en`, `pt-BR`. Other translations can be specified via the option `languages`. - - `{Object} languages` +- `{Object} languages` You can override existing translations or provide a new translation for a specific language. To do it provide an object at languages with language and the keys/values to be inserted. For example: @@ -212,6 +212,8 @@ Constructs a new JSONEditor. } ``` + All available fields for translation can be found in the source file `src/js/i18n.js`. + ### Methods diff --git a/examples/14_translate.html b/examples/14_translate.html index 706a33c..aef8766 100644 --- a/examples/14_translate.html +++ b/examples/14_translate.html @@ -2,10 +2,10 @@ - JSONEditor | Basic usage + JSONEditor | Translate - +