public inbox for [email protected]  
help / color / mirror / Atom feed
From: 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: Wed, 15 Apr 2020 13:46:49 +0200
Message-ID: <CAMavuw0m+GPUmD2Nd=po2AYazQb6eZp-F_2FxMpoHZN15MLS+A@mail.gmail.com> (raw)
In-Reply-To: <CANxoLDeezR6piQbCMXw7QChLJXROQ0FFQpu9+1zyZTc1O03wNQ@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>

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


Attachments:

  [application/octet-stream] pgadmin4_gettext.diff (3.2K, 2-pgadmin4_gettext.diff)
  download | inline diff:
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 aa35fb5d4..83bec30ca 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(
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py
index 444ed0b2b..8bd4790fb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py
@@ -737,7 +737,7 @@ class IndexConstraintView(PGChildNodeView):
 
             return make_json_response(
                 success=1,
-                info=_("{0} dropped.".format(self.node_label)),
+                info=_("{0} dropped.").format(self.node_label),
                 data={
                     'id': cid,
                     'sid': sid,
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index 409488587..57f89919a 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -425,7 +425,7 @@ define('pgadmin.node.server', [
             Alertify.dialog('changeServerPassword' ,function factory() {
               return {
                 main: function(params) {
-                  var title = gettext('Change Password ');
+                  var title = gettext('Change Password');
                   this.set('title', title);
                   this.user_name = params.user.name;
                 },
diff --git a/web/pgadmin/misc/file_manager/__init__.py b/web/pgadmin/misc/file_manager/__init__.py
index e34a69a68..5311034f4 100644
--- a/web/pgadmin/misc/file_manager/__init__.py
+++ b/web/pgadmin/misc/file_manager/__init__.py
@@ -910,7 +910,7 @@ class Filemanager(object):
             Filemanager.check_access_permission(dir, path)
         except Exception as e:
             res = {
-                'Error': gettext(u"Error: {0}".format(e)),
+                'Error': gettext(u"Error: {0}").format(e),
                 'Code': 0
             }
             return res
@@ -1131,7 +1131,7 @@ class Filemanager(object):
                 path, name))
         except Exception as e:
             res = {
-                'Error': gettext(u"Error: {0}".format(e)),
+                'Error': gettext(u"Error: {0}").format(e),
                 'Code': 0
             }
             return res


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: <CAMavuw0m+GPUmD2Nd=po2AYazQb6eZp-F_2FxMpoHZN15MLS+A@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