Fix #964: translation of titles of some context menu items not working

This commit is contained in:
josdejong 2020-04-19 09:47:59 +02:00
parent c42ddd4f65
commit 894af51861
2 changed files with 10 additions and 9 deletions

View File

@ -5,6 +5,7 @@ https://github.com/josdejong/jsoneditor
## not yet published, version 8.6.5 ## not yet published, version 8.6.5
- Fix #964: translation of titles of some context menu items not working.
- Update ace editor to `v1.4.9`. - Update ace editor to `v1.4.9`.

View File

@ -3633,7 +3633,15 @@ export class Node {
*/ */
showContextMenu (anchor, onClose) { showContextMenu (anchor, onClose) {
const node = this const node = this
const titles = Node.TYPE_TITLES
// titles with explanation for the different types
const titles = {
auto: translate('autoType'),
object: translate('objectType'),
array: translate('arrayType'),
string: translate('stringType')
}
let items = [] let items = []
if (this.editable.value) { if (this.editable.value) {
@ -4600,14 +4608,6 @@ Node.blurNodes = nodes => {
} }
} }
// titles with explanation for the different types
Node.TYPE_TITLES = {
auto: translate('autoType'),
object: translate('objectType'),
array: translate('arrayType'),
string: translate('stringType')
}
// helper function to get the internal path of a node // helper function to get the internal path of a node
function getInternalPath (node) { function getInternalPath (node) {
return node.getInternalPath() return node.getInternalPath()