public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ashesh Vashi <[email protected]>
To: Aditya Toshniwal <[email protected]>
Cc: Akshay Joshi <[email protected]>
Cc: Libor M. <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: pgAdmin 4 - next gettext usage fixes
Date: Wed, 15 Apr 2020 11:47:57 +0530
Message-ID: <CAG7mmoyvU=uWoRkeS9WKi=tHCZ83HqR_6Adv44qt5C7JkpweEA@mail.gmail.com> (raw)
In-Reply-To: <CAM9w-_kyiCB-FFtkXpvUNYKsz2iauZcm-vDs30dgW7rXDdDD-A@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>

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,
>
I would also avoid using this syntax, when multiple variables need to be
replaced.
e.g.
gettext("Test(#%s) -> %s") % test_no % test_result

Each language has different semantics, and the position of these variables
may change based on them.
We should use the 'format' function with proper variables in such cases.
e.g.
gettext("Test(#{test_no}) ->{test_result}").format(test_no, test_result).

I've not reviewed the patch, but - please look at this aspect while
reviewing the patch.

-- Thanks, Ashesh

>
> 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"
>


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], [email protected]
  Subject: Re: pgAdmin 4 - next gettext usage fixes
  In-Reply-To: <CAG7mmoyvU=uWoRkeS9WKi=tHCZ83HqR_6Adv44qt5C7JkpweEA@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