mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Client side translation.
This commit is contained in:
parent
59a6a08e8a
commit
8748ee20cb
@ -1,8 +1,9 @@
|
|||||||
define(
|
define(
|
||||||
['jquery', 'alertify', 'pgadmin', 'underscore', 'backform', 'pgadmin.browser', 'pgadmin.backform'],
|
['jquery', 'alertify', 'pgadmin', 'underscore', 'backform', 'pgadmin.browser',
|
||||||
|
'sources/translate', 'pgadmin.backform'],
|
||||||
|
|
||||||
// This defines the Preference/Options Dialog for pgAdmin IV.
|
// This defines the Preference/Options Dialog for pgAdmin IV.
|
||||||
function($, alertify, pgAdmin, _, Backform, pgBrowser) {
|
function($, alertify, pgAdmin, _, Backform, pgBrowser, t) {
|
||||||
pgAdmin = pgAdmin || window.pgAdmin || {};
|
pgAdmin = pgAdmin || window.pgAdmin || {};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -190,8 +191,8 @@ define(
|
|||||||
return 'input';
|
return 'input';
|
||||||
case 'boolean':
|
case 'boolean':
|
||||||
p.options = {
|
p.options = {
|
||||||
onText: '{{ _('True') }}',
|
onText: t('True'),
|
||||||
offText: '{{ _('False') }}',
|
offText: t('False'),
|
||||||
onColor: 'success',
|
onColor: 'success',
|
||||||
offColor: 'default',
|
offColor: 'default',
|
||||||
size: 'mini'
|
size: 'mini'
|
||||||
@ -199,8 +200,8 @@ define(
|
|||||||
return 'switch';
|
return 'switch';
|
||||||
case 'node':
|
case 'node':
|
||||||
p.options = {
|
p.options = {
|
||||||
onText: '{{ _('Show') }}',
|
onText: t('Show'),
|
||||||
offText: '{{ _('Hide') }}',
|
offText: t('Hide'),
|
||||||
onColor: 'success',
|
onColor: 'success',
|
||||||
offColor: 'default',
|
offColor: 'default',
|
||||||
size: 'mini'
|
size: 'mini'
|
||||||
@ -328,7 +329,7 @@ define(
|
|||||||
"<div class='pg-el-xs-3 preferences_tree aciTree'></div>"
|
"<div class='pg-el-xs-3 preferences_tree aciTree'></div>"
|
||||||
).append(
|
).append(
|
||||||
"<div class='pg-el-xs-9 preferences_content'>" +
|
"<div class='pg-el-xs-9 preferences_content'>" +
|
||||||
" {{ _('Category is not selected.')|safe }}" +
|
t('Category is not selected.') +
|
||||||
"</div>"
|
"</div>"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -354,16 +355,16 @@ define(
|
|||||||
attrs:{name:'dialog_help', type:'button', label: '{{ _('Preferences') }}',
|
attrs:{name:'dialog_help', type:'button', label: '{{ _('Preferences') }}',
|
||||||
url: '{{ url_for('help.static', filename='preferences.html') }}'}
|
url: '{{ url_for('help.static', filename='preferences.html') }}'}
|
||||||
},{
|
},{
|
||||||
text: "{{ _('OK') }}", key: 13, className: "btn btn-primary fa fa-lg fa-save pg-alertify-button"
|
text: t('OK'), key: 13, className: "btn btn-primary fa fa-lg fa-save pg-alertify-button"
|
||||||
},{
|
},{
|
||||||
text: "{{ _('Cancel') }}", className: "btn btn-danger fa fa-lg fa-times pg-alertify-button"
|
text: t('Cancel'), className: "btn btn-danger fa fa-lg fa-times pg-alertify-button"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
focus: { element: 0 },
|
focus: { element: 0 },
|
||||||
options: {
|
options: {
|
||||||
padding: !1,
|
padding: !1,
|
||||||
overflow: !1,
|
overflow: !1,
|
||||||
title: '{{ _('Preferences')|safe }}',
|
title: t('Preferences'),
|
||||||
closableByDimmer: false,
|
closableByDimmer: false,
|
||||||
modal:false,
|
modal:false,
|
||||||
pinnable: false
|
pinnable: false
|
||||||
@ -378,7 +379,7 @@ define(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.button.text == "{{ _('OK') }}"){
|
if (e.button.text == t('OK')){
|
||||||
preferences.updateAll();
|
preferences.updateAll();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
define(
|
define(
|
||||||
['jquery', 'alertify', 'pgadmin', 'underscore', 'backform', 'pgadmin.backform'],
|
['jquery', 'alertify', 'pgadmin', 'underscore', 'backform', 'sources/translate', 'pgadmin.backform'],
|
||||||
|
|
||||||
// This defines the Preference/Options Dialog for pgAdmin IV.
|
// This defines the Preference/Options Dialog for pgAdmin IV.
|
||||||
function($, alertify, pgAdmin, _, Backform) {
|
function($, alertify, pgAdmin, _, Backform, t) {
|
||||||
pgAdmin = pgAdmin || window.pgAdmin || {};
|
pgAdmin = pgAdmin || window.pgAdmin || {};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -23,8 +23,8 @@ define(
|
|||||||
// and reload the window
|
// and reload the window
|
||||||
show: function() {
|
show: function() {
|
||||||
var obj = this;
|
var obj = this;
|
||||||
alertify.confirm("{{ _('Reset layout') }}",
|
alertify.confirm(t('Reset layout'),
|
||||||
"{{ _('Are you sure you want to reset the current layout? This will cause the application to reload and any un-saved data will be lost.') }}",
|
t('Are you sure you want to reset the current layout? This will cause the application to reload and any un-saved data will be lost.'),
|
||||||
function() {
|
function() {
|
||||||
var reloadingIndicator = $('<div id="reloading-indicator"></div>');
|
var reloadingIndicator = $('<div id="reloading-indicator"></div>');
|
||||||
$('body').append(reloadingIndicator);
|
$('body').append(reloadingIndicator);
|
||||||
|
Loading…
Reference in New Issue
Block a user