Using the client-side translation using the client-side 'gettext'

implementation.

This is the first step towards 'Avoid creating the javascript modules
using Jinja templates'.
This commit is contained in:
Ashesh Vashi committed 2017-06-07 15:53:05 +05:30
1 parent 7e9f82bc17
commit ae80976689
77 files changed
+2603 -2624

No files matched your search

+10 -8
View File
@@ -1,7 +1,7 @@
define([
'underscore', 'underscore.string', 'jquery', 'pgadmin.browser',
'alertify', 'pgadmin.alertifyjs', 'pgadmin.browser.messages',
], function(_, S, $, pgBrowser, Alertify) {
'sources/gettext', 'underscore', 'underscore.string', 'jquery', 'pgadmin.browser',
'alertify', 'pgadmin.alertifyjs'
], function(gettext, _, S, $, pgBrowser, Alertify) {
pgBrowser.ShowNodeSQL = pgBrowser.ShowNodeSQL || {};
@@ -68,7 +68,7 @@ define([
function() {
var sql = '';
if (node) {
sql = '-- ' + pgBrowser.messages.NODE_HAS_NO_SQL;
sql = '-- ' + gettext("No SQL could be generated for the selected object.");
var self = this,
n_type = data._type,
n_value = -1,
@@ -95,7 +95,9 @@ define([
timer = setTimeout(function(){
// notify user if request is taking longer than 1 second
pgAdmin.Browser.editor.setValue(pgBrowser.messages['LOADING_MESSAGE']);
pgAdmin.Browser.editor.setValue(
gettext("Retrieving data from the server...")
);
}, 1000);
},
success: function(res) {
@@ -116,9 +118,9 @@ define([
) {
Alertify.pgNotifier(
error, xhr,
S(
pgBrowser.messages['ERR_RETRIEVAL_INFO']
).sprintf(message || _label).value(),
S(gettext("Error retrieving the information - %s")).sprintf(
message || _label
).value(),
function() {
console.log(arguments);
}