public inbox for [email protected]
help / color / mirror / Atom feedFrom: Libor M. <[email protected]>
To: Akshay Joshi <[email protected]>
Cc: Aditya Toshniwal <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: pgAdmin 4 - next gettext usage fixes
Date: Sun, 19 Apr 2020 14:20:39 +0200
Message-ID: <CAMavuw386ArDGj8Tjkt_tdC9MX5CXcAGBYepxGq6srOxxYkNJg@mail.gmail.com> (raw)
In-Reply-To: <CANxoLDd+vUyTpRokZGsgWTmkC=84POUYyXvhwHubwsoxRy2L6Q@mail.gmail.com>
References: <CAMavuw0OE=bo6a3Pf+cXUTa0UDrFSyQxsffUrf5uXcvLnTSajg@mail.gmail.com>
<CANxoLDcg=Jpkj5+16KNgAG171mz1bSF-+oFLRb_B4KAEO8Lb4w@mail.gmail.com>
<CAM9w-_kyiCB-FFtkXpvUNYKsz2iauZcm-vDs30dgW7rXDdDD-A@mail.gmail.com>
<CANxoLDdedErpGjjAs0GgywptNGpn8DzeL7v6=CsYDG+Wt59cPw@mail.gmail.com>
<CAM9w-_mMS=oe0WzeU49Ox2utU_n2Nr4BXe0_2RkXt01acLQQUg@mail.gmail.com>
<CANxoLDeezR6piQbCMXw7QChLJXROQ0FFQpu9+1zyZTc1O03wNQ@mail.gmail.com>
<CAMavuw0m+GPUmD2Nd=po2AYazQb6eZp-F_2FxMpoHZN15MLS+A@mail.gmail.com>
<CANxoLDd+vUyTpRokZGsgWTmkC=84POUYyXvhwHubwsoxRy2L6Q@mail.gmail.com>
Hi,
I sending patch for slightly modified the use of gettext:
- fixed `%` vs. `.format()`
- unified texts and usage `%s` vs. `{}`/`{0}`
- improved text sentences for translate
- added gettext for next texts
Best regards,
Libor M.
E-mail: [email protected]
GitHub: https://github.com/liborm85
čt 16. 4. 2020 v 9:51 odesílatel Akshay Joshi
<[email protected]> napsal:
>
> Thanks, patch applied.
>
> On Wed, Apr 15, 2020 at 5:17 PM Libor M. <[email protected]> wrote:
>>
>> Hi,
>> next minor gettext and format fixes in patch.
>>
>> Best regards,
>>
>> Libor M.
>>
>> E-mail: [email protected]
>> GitHub: https://github.com/liborm85
>>
>> st 15. 4. 2020 v 13:17 odesílatel Akshay Joshi
>> <[email protected]> napsal:
>> >
>> > Thanks, patch applied.
>> >
>> > On Wed, Apr 15, 2020 at 2:55 PM Aditya Toshniwal <[email protected]> wrote:
>> >>
>> >> Hi,
>> >>
>> >> Please find the updated patch.
>> >>
>> >> On Wed, Apr 15, 2020 at 1:33 PM Akshay Joshi <[email protected]> wrote:
>> >>>
>> >>> Hi Aditya
>> >>>
>> >>> I think the fix is incorrect. .format method should be applied after gettext() like gettext().format(). Please check for other places too and send the updated patch.
>> >>>
>> >>> On Wed, Apr 15, 2020 at 11:38 AM Aditya Toshniwal <[email protected]> wrote:
>> >>>>
>> >>>> Hi Hackers/Libor,
>> >>>>
>> >>>> The changes like below are incorrect. Try "Count rows" from a table's context menu.
>> >>>>
>> >>>> - info=gettext("Table rows counted: %s" % count),
>> >>>>
>> >>>> + info=gettext("Table rows counted: %s") % count,
>> >>>>
>> >>>>
>> >>>> Attached is the patch to fix all such changes in pgAdmin, to use format() instead.
>> >>>> Please review.
>> >>>>
>> >>>> On Fri, Apr 10, 2020 at 2:57 PM Akshay Joshi <[email protected]> wrote:
>> >>>>>
>> >>>>> Hi Libor
>> >>>>>
>> >>>>> Thanks, patch applied. Please make sure to run the PEP8 checks before sending the patch.
>> >>>>> I have fixed and committed the code.
>> >>>>>
>> >>>>> On Wed, Apr 8, 2020 at 9:30 PM Libor M. <[email protected]> wrote:
>> >>>>>>
>> >>>>>> Hello,
>> >>>>>> I fixed next gettext usage:
>> >>>>>>
>> >>>>>> - fixed gettext usage with .format() only for original text with %s
>> >>>>>> - fixed typos
>> >>>>>> - fixed translation yes/no buttons in dialog
>> >>>>>> - improved translating sentences without "connecting" words (eg. see
>> >>>>>> web/pgadmin/dashboard/static/js/dashboard.js, word 'cancel' needs to
>> >>>>>> be translated in Czech language as 'zrušit' but in another sentence as
>> >>>>>> 'zrušení')
>> >>>>>> - added gettext for text translations
>> >>>>>>
>> >>>>>> Diff file is attached.
>> >>>>>>
>> >>>>>> Best regards,
>> >>>>>>
>> >>>>>> Libor M.
>> >>>>>>
>> >>>>>> E-mail: [email protected]
>> >>>>>> GitHub: https://github.com/liborm85
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> Thanks & Regards
>> >>>>> Akshay Joshi
>> >>>>> Sr. Software Architect
>> >>>>> EnterpriseDB Software India Private Limited
>> >>>>> Mobile: +91 976-788-8246
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Thanks and Regards,
>> >>>> Aditya Toshniwal
>> >>>> pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
>> >>>> "Don't Complain about Heat, Plant a TREE"
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Thanks & Regards
>> >>> Akshay Joshi
>> >>> Sr. Software Architect
>> >>> EnterpriseDB Software India Private Limited
>> >>> Mobile: +91 976-788-8246
>> >>
>> >>
>> >>
>> >> --
>> >> Thanks and Regards,
>> >> Aditya Toshniwal
>> >> pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
>> >> "Don't Complain about Heat, Plant a TREE"
>> >
>> >
>> >
>> > --
>> > Thanks & Regards
>> > Akshay Joshi
>> > Sr. Software Architect
>> > EnterpriseDB Software India Private Limited
>> > Mobile: +91 976-788-8246
>
>
>
> --
> Thanks & Regards
> Akshay Joshi
> Sr. Software Architect
> EnterpriseDB Software India Private Limited
> Mobile: +91 976-788-8246
Attachments:
[application/octet-stream] pgadmin4_gettext_fix.diff (24.3K, 2-pgadmin4_gettext_fix.diff)
download | inline diff:
diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py
index a1b19fb7e..ae4a0d3f4 100644
--- a/web/pgadmin/__init__.py
+++ b/web/pgadmin/__init__.py
@@ -502,8 +502,8 @@ def create_app(app_name=None):
svr_port = winreg.QueryValueEx(inst_key, 'Port')[0]
svr_discovery_id = inst_id
svr_comment = gettext(
- "Auto-detected %s installation with the data "
- "directory at {}").format(
+ "Auto-detected {0} installation with the data "
+ "directory at {1}").format(
winreg.QueryValueEx(
inst_key, 'Display Name'
)[0],
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
index 83bec30ca..22fe68963 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
@@ -378,7 +378,7 @@ class EventTriggerView(PGChildNodeView):
status=400,
success=0,
errormsg=gettext(
- "Could not find the required parameter {}.").format(err)
+ "Could not find the required parameter ({}).").format(err)
)
try:
sql = render_template(
@@ -636,7 +636,7 @@ class EventTriggerView(PGChildNodeView):
status=410,
success=0,
errormsg=gettext(
- "Could not find the required parameter {}."
+ "Could not find the required parameter ({})."
).format(arg)
)
sql = render_template(
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py
index 8f6fefe2c..a5b2ffbfe 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py
@@ -216,9 +216,8 @@ class DomainView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare):
status=410,
success=0,
errormsg=gettext(
- "Could not find the required parameter (%s)." %
- arg
- )
+ "Could not find the required parameter ({})."
+ ).format(arg)
)
try:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/__init__.py
index 38c686a3b..b599425e9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/__init__.py
@@ -211,9 +211,8 @@ class DomainConstraintView(PGChildNodeView):
status=410,
success=0,
errormsg=gettext(
- "Could not find the required parameter (%s)." %
- arg
- )
+ "Could not find the required parameter ({})."
+ ).format(arg)
)
try:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py
index 28b30164c..d86695653 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py
@@ -260,9 +260,8 @@ class ForeignTableView(PGChildNodeView, DataTypeReader,
status=410,
success=0,
errormsg=gettext(
- "Could not find the required parameter (%s)." %
- arg
- )
+ "Could not find the required parameter ({})."
+ ).format(arg)
)
try:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js
index 551677322..7a4ed5edc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js
@@ -213,7 +213,7 @@ define('pgadmin.node.fts_configuration', [
' </div>',
' <div class="col-6" header="token"></div>',
' <div class="col-2">',
- ' <button class="btn btn-sm-sq btn-secondary add fa fa-plus" <%=canAdd ? "" : "disabled=\'disabled\'"%> ><span class="sr-only">Add Token</span></button>',
+ ' <button class="btn btn-sm-sq btn-secondary add fa fa-plus" <%=canAdd ? "" : "disabled=\'disabled\'"%> ><span class="sr-only">' + gettext('Add Token') + '</span></button>',
' </div>',
' </div>',
' </div>',
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py
index 6858ec8d6..805bd0efa 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py
@@ -431,7 +431,8 @@ class FtsDictionaryView(PGChildNodeView, SchemaDiffObjectCompare):
status=410,
success=0,
errormsg=_(
- "Could not find the required parameter (%s)." % arg)
+ "Could not find the required parameter ({})."
+ ).format(arg)
)
# Fetch schema name from schema oid
sql = render_template(
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py
index 35d9e4216..d343b394a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py
@@ -277,9 +277,8 @@ class FunctionView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare):
status=410,
success=0,
errormsg=gettext(
- "Could not find the required parameter (%s)." %
- arg
- )
+ "Could not find the required parameter ({})."
+ ).format(arg)
)
list_params = []
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py
index f3d24df14..e1ec7cacf 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py
@@ -557,8 +557,9 @@ class PackageView(PGChildNodeView, SchemaDiffObjectCompare):
status=400,
success=0,
errormsg=_(
- "Could not find the required parameter (%s).")
- % arg)
+ "Could not find the required parameter ({})."
+ ).format(arg)
+ )
SQL, name = self.getSQL(gid, sid, did, data, scid, pkgid)
# Most probably this is due to error
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py
index 03d2da1e6..c5f6c4e9b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py
@@ -381,8 +381,8 @@ class SequenceView(PGChildNodeView, SchemaDiffObjectCompare):
status=400,
success=0,
errormsg=_(
- "Could not find the required parameter (%s)." % arg
- )
+ "Could not find the required parameter ({})."
+ ).format(arg)
)
try:
@@ -590,8 +590,8 @@ class SequenceView(PGChildNodeView, SchemaDiffObjectCompare):
status=400,
success=0,
errormsg=_(
- "Could not find the required parameter (%s)." % arg
- )
+ "Could not find the required parameter ({})."
+ ).format(arg)
)
SQL, name = self.getSQL(gid, sid, did, data, scid, seid)
# Most probably this is due to error
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/__init__.py
index 26c79881b..f4f500b28 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/__init__.py
@@ -341,8 +341,8 @@ class RuleView(PGChildNodeView, SchemaDiffObjectCompare):
status=410,
success=0,
errormsg=gettext(
- "Could not find the required parameter (%s)." % arg
- )
+ "Could not find the required parameter ({})."
+ ).format(arg)
)
try:
SQL = render_template("/".join(
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py
index 7383d7ad2..b15adae2e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py
@@ -542,9 +542,8 @@ class TriggerView(PGChildNodeView, SchemaDiffObjectCompare):
status=410,
success=0,
errormsg=gettext(
- "Could not find the required parameter (%s)." %
- required_args[arg]
- )
+ "Could not find the required parameter ({})."
+ ).format(required_args[arg])
)
# Adding parent into data dict, will be using it while creating sql
diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js
index 4df8e0517..c13b325f7 100644
--- a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js
+++ b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js
@@ -190,8 +190,7 @@ define('pgadmin.node.pga_jobstep', [
id: 'jstconnstr', label: gettext('Connection string'), type: 'text',
deps: ['jstkind', 'jstconntype'], disabled: function(m) {
return !m.get('jstkind') || m.get('jstconntype');
- }, helpMessage: gettext('Please specify the connection string for the remote database server. Each parameter setting is in the form keyword = value. Spaces around the equal sign are optional. To write an empty value, or a value containing spaces, surround it with single quotes, e.g., keyword = \'a value\'. Single quotes and backslashes within the value must be escaped with a backslash, i.e., \' and \\.<br>For more information, please see the documentation on %s',
- '<a href="https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING" target="_blank">libpq connection strings</a>'
+ }, helpMessage: gettext('Please specify the connection string for the remote database server. Each parameter setting is in the form keyword = value. Spaces around the equal sign are optional. To write an empty value, or a value containing spaces, surround it with single quotes, e.g., keyword = \'a value\'. Single quotes and backslashes within the value must be escaped with a backslash, i.e., \' and \\.<br>For more information, please see the documentation on <a href="https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING" target="_blank">libpq connection strings</a>.'
), mode: ['create', 'edit'],
},{
id: 'jstonerror', label: gettext('On error'), cell: 'select2',
diff --git a/web/pgadmin/browser/server_groups/servers/templates/servers/password.html b/web/pgadmin/browser/server_groups/servers/templates/servers/password.html
index 9fc0b3945..0cb15f2c9 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/servers/password.html
+++ b/web/pgadmin/browser/server_groups/servers/templates/servers/password.html
@@ -3,7 +3,7 @@
<div><span class="font-weight-bold" >{{ _('Please enter the password for the user \'{0}\' to connect the server - "{1}"').format(username,
server_label) }}</span></div>
<div class="input-group row py-2">
- <label for="password" class="col-sm-2 col-form-label" aria-hidden="true">Password</label>
+ <label for="password" class="col-sm-2 col-form-label" aria-hidden="true">{{ _('Password') }}</label>
<div class="col-sm-10">
<input id="password" class="form-control" name="password" type="password">
</div>
diff --git a/web/pgadmin/browser/server_groups/servers/templates/servers/tunnel_password.html b/web/pgadmin/browser/server_groups/servers/templates/servers/tunnel_password.html
index 8724c8035..ea1dc178c 100644
--- a/web/pgadmin/browser/server_groups/servers/templates/servers/tunnel_password.html
+++ b/web/pgadmin/browser/server_groups/servers/templates/servers/tunnel_password.html
@@ -17,7 +17,7 @@
<input class="custom-control-input" id="save_tunnel_password" name="save_tunnel_password" type="checkbox"
{% if not config.ALLOW_SAVE_TUNNEL_PASSWORD %}disabled{% endif %}
>
- <label class="custom-control-label" for="save_tunnel_password" class="ml-1">Save Password</label>
+ <label class="custom-control-label" for="save_tunnel_password" class="ml-1">{{ _('Save Password') }}</label>
</div>
</div>
</div>
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index a2bcd78c6..9a2980a81 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -226,7 +226,7 @@ define('pgadmin.browser', [
width: 500,
isCloseable: false,
isPrivate: true,
- content: '<label for="sql-textarea" class="sr-only">SQL Code</label><div class="sql_textarea"><textarea id="sql-textarea" name="sql-textarea" title="'+gettext('SQL Code')+'"></textarea></div>',
+ content: '<label for="sql-textarea" class="sr-only">' + gettext('SQL Code') + '</label><div class="sql_textarea"><textarea id="sql-textarea" name="sql-textarea" title="' + gettext('SQL Code') + '"></textarea></div>',
}),
// Dependencies of the object
'dependencies': new pgAdmin.Browser.Panel({
diff --git a/web/pgadmin/misc/file_manager/static/js/utility.js b/web/pgadmin/misc/file_manager/static/js/utility.js
index 04060b77d..353baf560 100644
--- a/web/pgadmin/misc/file_manager/static/js/utility.js
+++ b/web/pgadmin/misc/file_manager/static/js/utility.js
@@ -1552,7 +1552,7 @@ define([
'<div id="multiple-uploads" class="dropzone flex-grow-1 d-flex p-1">'+
'<div class="dz-default dz-message d-none"></div>'+
'</div>' +
- '<div class="prompt-info">Drop files here to upload. ' + lg.file_size_limit +
+ '<div class="prompt-info">' + gettext('Drop files here to upload.') + ' ' + lg.file_size_limit +
config.upload.fileSizeLimit + ' ' + lg.mb + '.</div>',
path = $('.currentpath').val(),
filesizelimit = config.upload.fileSizeLimit,
diff --git a/web/pgadmin/misc/static/explain/js/explain.js b/web/pgadmin/misc/static/explain/js/explain.js
index c3f6ed7dd..f20a427e2 100644
--- a/web/pgadmin/misc/static/explain/js/explain.js
+++ b/web/pgadmin/misc/static/explain/js/explain.js
@@ -490,44 +490,44 @@ define('pgadmin.misc.explain', [
if ('Join Filter' in _planData) {
node_extra_info.push(
- '<strong>Join Filter</strong>: ' + _.escape(_planData['Join Filter'])
+ '<strong>' + gettext('Join Filter') + '</strong>: ' + _.escape(_planData['Join Filter'])
);
}
if ('Filter' in _planData) {
- node_extra_info.push('<strong>Filter</strong>: ' + _.escape(_planData['Filter']));
+ node_extra_info.push('<strong>' + gettext('Filter') + '</strong>: ' + _.escape(_planData['Filter']));
}
if ('Index Cond' in _planData) {
- node_extra_info.push('<strong>Index Cond</strong>: ' + _.escape(_planData['Index Cond']));
+ node_extra_info.push('<strong>' + gettext('Index Cond') + '</strong>: ' + _.escape(_planData['Index Cond']));
}
if ('Hash Cond' in _planData) {
- node_extra_info.push('<strong>Hash Cond</strong>: ' + _.escape(_planData['Hash Cond']));
+ node_extra_info.push('<strong>' + gettext('Hash Cond') + '</strong>: ' + _.escape(_planData['Hash Cond']));
}
if ('Rows Removed by Filter' in _planData) {
node_extra_info.push(
- '<strong>Rows Removed by Filter</strong>: ' +
+ '<strong>' + gettext('Rows Removed by Filter') + '</strong>: ' +
_.escape(_planData['Rows Removed by Filter'])
);
}
if ('Peak Memory Usage' in _planData) {
var buffer = [
- '<strong>Buckets</strong>:', _.escape(_planData['Hash Buckets']),
- '<strong>Batches</strong>:', _.escape(_planData['Hash Batches']),
- '<strong>Memory Usage</strong>:', _.escape(_planData['Peak Memory Usage']), 'kB',
+ '<strong>' + gettext('Buckets') + '</strong>:', _.escape(_planData['Hash Buckets']),
+ '<strong>' + gettext('Batches') + '</strong>:', _.escape(_planData['Hash Batches']),
+ '<strong>' + gettext('Memory Usage') + '</strong>:', _.escape(_planData['Peak Memory Usage']), 'kB',
].join(' ');
node_extra_info.push(buffer);
}
if ('Recheck Cond' in _planData) {
- node_extra_info.push('<strong>Recheck Cond</strong>: ' + _planData['Recheck Cond']);
+ node_extra_info.push('<strong>' + gettext('Recheck Cond') + '</strong>: ' + _planData['Recheck Cond']);
}
if ('Exact Heap Blocks' in _planData) {
- node_extra_info.push('<strong>Heap Blocks</strong>: exact=' + _planData['Exact Heap Blocks']);
+ node_extra_info.push('<strong>' + gettext('Heap Blocks') + '</strong>: exact=' + _planData['Exact Heap Blocks']);
}
info.rows.push(_explainRowTemplate({
diff --git a/web/pgadmin/static/js/backgrid.pgadmin.js b/web/pgadmin/static/js/backgrid.pgadmin.js
index e196efa0d..84009a152 100644
--- a/web/pgadmin/static/js/backgrid.pgadmin.js
+++ b/web/pgadmin/static/js/backgrid.pgadmin.js
@@ -1081,7 +1081,7 @@ define([
},
render: function() {
this.$el.empty();
- this.$el.html('<label><a><span style=\'font-weight:normal;\'>Array Values</a></span></label> <button class=\'btn-sm btn-secondary add\'>Add</button>');
+ this.$el.html('<label><a><span style=\'font-weight:normal;\'>' + gettext('Array Values') + '</a></span></label> <button class=\'btn-sm btn-secondary add\'>' + gettext('Add') + '</button>');
this.delegateEvents();
return this;
},
@@ -2055,7 +2055,7 @@ define([
$(`<div class="custom-control custom-checkbox custom-checkbox-no-label ${align_center?'text-center':''}">
<input tabindex="0" type="checkbox" class="custom-control-input" id="${id}" ${!editable?'disabled':''} ${checked?'checked':''}/>
<label class="custom-control-label" for="${id}">
- <span class="sr-only">Select<span>
+ <span class="sr-only">` + gettext('Select') + `<span>
</label>
</div>`)
);
diff --git a/web/pgadmin/static/js/sqleditor/history/query_history_details.js b/web/pgadmin/static/js/sqleditor/history/query_history_details.js
index 8a884da00..d5bfac86a 100644
--- a/web/pgadmin/static/js/sqleditor/history/query_history_details.js
+++ b/web/pgadmin/static/js/sqleditor/history/query_history_details.js
@@ -128,7 +128,7 @@ export default class QueryHistoryDetails {
this.$errMsgBlock.removeClass('d-none');
this.$errMsgBlock.empty().append(
`<div class='history-error-text'>
- <span>Error Message</span> ${_.escape(this.parseErrorMessage(this.entry.message))}
+ <span>` + gettext('Error Message') + `</span> ${_.escape(this.parseErrorMessage(this.entry.message))}
</div>`
);
} else {
diff --git a/web/pgadmin/static/vendor/backgrid/backgrid-select-all.js b/web/pgadmin/static/vendor/backgrid/backgrid-select-all.js
index 8cc11698b..ab882f364 100644
--- a/web/pgadmin/static/vendor/backgrid/backgrid-select-all.js
+++ b/web/pgadmin/static/vendor/backgrid/backgrid-select-all.js
@@ -126,7 +126,7 @@
'<div class="custom-control custom-checkbox custom-checkbox-no-label">',
' <input tabindex="0" type="checkbox" class="custom-control-input" id="'+ id +'" />',
' <label class="custom-control-label" for="'+ id +'">',
- ' <span class="sr-only">Select All<span>',
+ ' <span class="sr-only">' + gettext('Select All') + '<span>',
' </label>',
'</div>'
].join('\n'));
diff --git a/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js b/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js
index 0c4a315db..6c3b4fa39 100644
--- a/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js
+++ b/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js
@@ -150,8 +150,7 @@ export default class SearchObjectsDialogWrapper extends DialogWrapper {
if(count != 0 && !count) {
count = gettext('Unknown');
}
- this.searchResultCount.innerHTML = count + ' ' +
- (count===1 ? gettext('match found.'): gettext('matches found.'));
+ this.searchResultCount.innerHTML = (count===1 ? gettext('%s match found.', count): gettext('%s matches found.', count));
}
showOtherInfo(rowno) {
@@ -256,8 +255,7 @@ export default class SearchObjectsDialogWrapper extends DialogWrapper {
if(!rowData.show_node) {
this.showMessage(
- gettext('%s objects are disabled in the browser.', rowData.type_label) + ' ' +
- gettext('You can enable them in the') + ' <a class="pref-dialog-link">' + gettext('preferences dialog') + '</a>.',
+ gettext('%s objects are disabled in the browser. You can enable them in the <a class="pref-dialog-link">preferences dialog</a>.', rowData.type_label),
true,
(statusBar)=>{
statusBar.querySelector('.pref-dialog-link').addEventListener('click', ()=>{
@@ -465,7 +463,7 @@ export default class SearchObjectsDialogWrapper extends DialogWrapper {
).then((res)=>{
let types = [{
id: 'all',
- text: 'All types',
+ text: gettext('All types'),
}];
for (const key of Object.keys(res.data.data).sort()) {
view thread (11+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: pgAdmin 4 - next gettext usage fixes
In-Reply-To: <CAMavuw386ArDGj8Tjkt_tdC9MX5CXcAGBYepxGq6srOxxYkNJg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox