public inbox for [email protected]  
help / color / mirror / Atom feed
From: Dave Page <[email protected]>
To: Rahul Shirsat <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure
Date: Tue, 29 Jun 2021 09:26:07 +0100
Message-ID: <CA+OCxozh_DV2m7vcEAaD0rsY31OntJF5GdRBXmqj0PCWULStew@mail.gmail.com> (raw)
In-Reply-To: <CAKtn9dOWXDQo9K_HuqGOmhq=AeVVzcE8d=J+8obRj014G=0jxQ@mail.gmail.com>
References: <CAKtn9dP2TmBCqHxV0szjdmCEVLbJwBNXA6rsumoOKeQJG1qyUw@mail.gmail.com>
	<CA+OCxoxE+OK3_KW_vu_pWY4+t5qyH985_Znp7v+uA2vmYRo2BQ@mail.gmail.com>
	<CAKtn9dOWXDQo9K_HuqGOmhq=AeVVzcE8d=J+8obRj014G=0jxQ@mail.gmail.com>

Hi

On Tue, Jun 29, 2021 at 4:38 AM Rahul Shirsat <
[email protected]> wrote:

> I feel gettext sometimes won't escape the characters as it should be.
>
> I now tried to escape those using some utils.
>

That won't work either. The string being passed to gettext() *must* be in
the gettext call.

When gettext extracts strings to create/update the catalogs, it will search
the code for all gettext calls, and then extract a string constant from the
first argument. You cannot have variables, function calls or expressions in
there. It *must* be a string constant.

Keep in mind that msgextract is scanning the source code; it's not
executing it. There are many examples in the code, e.g. (from node.js):

title = gettext('Drop %s?', obj.label);

I don't see anything obviously wrong with the existing code. Are you sure
there are no weird unprintable characters in there?


>
> Please find the updated patch.
>
> On Mon, Jun 28, 2021 at 9:33 PM Dave Page <[email protected]> wrote:
>
>> Hi
>>
>> On Mon, Jun 28, 2021 at 4:57 PM Rahul Shirsat <
>> [email protected]> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch for fixation of jenkins failure.
>>>
>>
>> That won't work - you can't include variables (or string building
>> operations) in the first argument to gettext calls, as there won't be any
>> way to extract a complete message into the catalogs. The way it's being
>> done at the moment is correct (I don't know why it's failing, but it's the
>> correct way to structure the gettext calls).
>>
>> --
>> Dave Page
>> Blog: https://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EDB: https://www.enterprisedb.com
>>
>>
>
> --
> *Rahul Shirsat*
> Senior Software Engineer | EnterpriseDB Corporation.
>


-- 
Dave Page
Blog: https://pgsnake.blogspot.com
Twitter: @pgsnake

EDB: https://www.enterprisedb.com


view thread (22+ 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]
  Subject: Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure
  In-Reply-To: <CA+OCxozh_DV2m7vcEAaD0rsY31OntJF5GdRBXmqj0PCWULStew@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