Translate the text in the sort modal

This commit is contained in:
jos 2018-06-02 20:21:27 +02:00
parent b28f73ee13
commit 185a81e03a
4 changed files with 36 additions and 10 deletions

View File

@ -290,6 +290,9 @@ div.jsoneditor-contextmenu button.jsoneditor-type-modes > div.jsoneditor-icon {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
font-family: arial, sans-serif;
font-size: 11pt;
background: #3883fa; background: #3883fa;
color: white; color: white;
} }

View File

@ -11,7 +11,6 @@ div.jsoneditor-menu {
color: white; color: white;
background-color: #3883fa; background-color: #3883fa;
border-bottom: 1px solid #3883fa; border-bottom: 1px solid #3883fa;
overflow: hidden;
} }
div.jsoneditor-menu > button, div.jsoneditor-menu > button,

View File

@ -3732,30 +3732,31 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
Node.prototype._showSortModal = function () { Node.prototype._showSortModal = function () {
var node = this; var node = this;
// TODO: escape the translated text
var content = '<div class="pico-modal-contents">' + var content = '<div class="pico-modal-contents">' +
'<div class="pico-modal-header">Sort</div>' + '<div class="pico-modal-header">' + translate('sort') + '</div>' +
'<form>' + '<form>' +
'<table>' + '<table>' +
'<tbody>' + '<tbody>' +
'<tr>' + '<tr>' +
' <td>Field:</td>' + ' <td>' + translate('sortFieldLabel') + ' </td>' +
' <td class="jsoneditor-modal-input">' + ' <td class="jsoneditor-modal-input">' +
' <select id="field" title="Select the nested field by which to sort the array or object">' + ' <select id="field" title="' + translate('sortFieldTitle') + '">' +
' </select>' + ' </select>' +
' </td>' + ' </td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
' <td>Direction:</td>' + ' <td>' + translate('sortDirectionLabel') + ' </td>' +
' <td class="jsoneditor-modal-input">' + ' <td class="jsoneditor-modal-input">' +
' <div id="direction" class="jsoneditor-button-group">' + ' <div id="direction" class="jsoneditor-button-group">' +
'<input type="button" ' + '<input type="button" ' +
'value="Ascending" ' + 'value="' + translate('sortAscending') + '" ' +
'title="Sort the selected field in ascending order" ' + 'title="' + translate('sortAscendingTitle') + '" ' +
'data-value="asc" ' + 'data-value="asc" ' +
'class="jsoneditor-button-first jsoneditor-button-asc"/>' + 'class="jsoneditor-button-first jsoneditor-button-asc"/>' +
'<input type="button" ' + '<input type="button" ' +
'value="Descending" ' + 'value="' + translate('sortDescending') + '" ' +
'title="Sort the selected field in descending order" ' + 'title="' + translate('sortDescendingTitle') + '" ' +
'data-value="desc" ' + 'data-value="desc" ' +
'class="jsoneditor-button-last jsoneditor-button-desc"/>' + 'class="jsoneditor-button-last jsoneditor-button-desc"/>' +
' </div>' + ' </div>' +
@ -3763,7 +3764,7 @@ Node.prototype._showSortModal = function () {
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td colspan="2" class="jsoneditor-modal-input jsoneditor-modal-actions">' + '<td colspan="2" class="jsoneditor-modal-input jsoneditor-modal-actions">' +
' <input type="submit" id="ok" value="Ok" />' + ' <input type="submit" id="ok" value="' + translate('ok') + '" />' +
'</td>' + '</td>' +
'</tr>' + '</tr>' +
'</tbody>' + '</tbody>' +

View File

@ -28,6 +28,7 @@ var _defs = {
'insertTitle': 'Insert a new field with type \'auto\' before this field (Ctrl+Ins)', 'insertTitle': 'Insert a new field with type \'auto\' before this field (Ctrl+Ins)',
'insertSub': 'Select the type of the field to be inserted', 'insertSub': 'Select the type of the field to be inserted',
'object': 'Object', 'object': 'Object',
'ok': 'Ok',
'redo': 'Redo (Ctrl+Shift+Z)', 'redo': 'Redo (Ctrl+Shift+Z)',
'removeText': 'Remove', 'removeText': 'Remove',
'removeTitle': 'Remove selected fields (Ctrl+Del)', 'removeTitle': 'Remove selected fields (Ctrl+Del)',
@ -37,6 +38,13 @@ var _defs = {
'showMoreStatus': 'displaying ${visibleChilds} of ${totalChilds} items.', 'showMoreStatus': 'displaying ${visibleChilds} of ${totalChilds} items.',
'sort': 'Sort', 'sort': 'Sort',
'sortTitle': 'Sort the childs of this ', 'sortTitle': 'Sort the childs of this ',
'sortFieldLabel': 'Field:',
'sortDirectionLabel': 'Direction:',
'sortFieldTitle': 'Select the nested field by which to sort the array or object',
'sortAscending': 'Ascending',
'sortAscendingTitle': 'Sort the selected field in ascending order',
'sortDescending': 'Descending',
'sortDescendingTitle': 'Sort the selected field in descending order',
'string': 'String', 'string': 'String',
'type': 'Type', 'type': 'Type',
'typeTitle': 'Change the type of this field', 'typeTitle': 'Change the type of this field',
@ -80,6 +88,7 @@ var _defs = {
'insertTitle': 'Inserir um novo campo do tipo \'auto\' antes deste campo (Ctrl+Ins)', 'insertTitle': 'Inserir um novo campo do tipo \'auto\' antes deste campo (Ctrl+Ins)',
'insertSub': 'Selecionar o tipo de campo a ser inserido', 'insertSub': 'Selecionar o tipo de campo a ser inserido',
'object': 'Objeto', 'object': 'Objeto',
'ok': 'Ok',
'redo': 'Refazer (Ctrl+Shift+Z)', 'redo': 'Refazer (Ctrl+Shift+Z)',
'removeText': 'Remover', 'removeText': 'Remover',
'removeTitle': 'Remover campos selecionados (Ctrl+Del)', 'removeTitle': 'Remover campos selecionados (Ctrl+Del)',
@ -92,6 +101,20 @@ var _defs = {
'showMoreStatus': 'exibindo ${visibleChilds} de ${totalChilds} itens.', 'showMoreStatus': 'exibindo ${visibleChilds} de ${totalChilds} itens.',
'sort': 'Organizar', 'sort': 'Organizar',
'sortTitle': 'Organizar os filhos deste ', 'sortTitle': 'Organizar os filhos deste ',
// TODO: correctly translate sortFieldLabel
'sortFieldLabel': 'Field:',
// TODO: correctly translate sortDirectionLabel
'sortDirectionLabel': 'Direction:',
// TODO: correctly translate sortFieldTitle
'sortFieldTitle': 'Select the nested field by which to sort the array or object',
// TODO: correctly translate sortAscending
'sortAscending': 'Ascending',
// TODO: correctly translate sortAscendingTitle
'sortAscendingTitle': 'Sort the selected field in ascending order',
// TODO: correctly translate sortDescending
'sortDescending': 'Descending',
// TODO: correctly translate sortDescendingTitle
'sortDescendingTitle': 'Sort the selected field in descending order',
'string': 'Texto', 'string': 'Texto',
'type': 'Tipo', 'type': 'Tipo',
'typeTitle': 'Mudar o tipo deste campo', 'typeTitle': 'Mudar o tipo deste campo',