Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyE2H-0003Z7-QZ for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 13:44:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyE2G-0007ur-IH for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 13:44:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyE2G-0007uj-4L for pgadmin-hackers@lists.postgresql.org; Tue, 29 Jun 2021 13:44:20 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lyE29-00060m-8w for pgadmin-hackers@postgresql.org; Tue, 29 Jun 2021 13:44:19 +0000 Received: by mail-ej1-x634.google.com with SMTP id v20so17904558eji.10 for ; Tue, 29 Jun 2021 06:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9JzPu3b7ZpxaB6z3f69uRe0JLbEuoX2zC0mi7tLAxlY=; b=iu9JnQ89t1RjftPH2/iVQInugZgK1JeJ7ponl+q60ia0K5DX2SlT+XMGbJpXHPfiQ3 7yIipM3Bb+SFh6yjura04K3Omwa93cwTT8yJMVFTVGMSLvobjyDwejyhzYKcvY0s4hkB py2Ubbl2rIPrHn0WpzLbqK431MfNAaO1OSJTbRrzS/oOOhIXIOvPqRY1VKeLoS8KrVGS 9UIUJ6VbvOKM93uuO/6UyG6feyV47Agt7h0jdavg/g3iprsO1SqwShJa3EUCWxWLxVEd D9Th4awztPLKHhTRfIaAqRHeO+drIvNq/VFF+susNQpIsaWpk0NRpGLP8C8ibzjyo8nu 7H8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9JzPu3b7ZpxaB6z3f69uRe0JLbEuoX2zC0mi7tLAxlY=; b=qikWjvYfUCf12aodYOLOH2+5ryggurfCGbYZi8ST2+6rPWd7tWb4DcgEMKnTEJycKS Lz3B7NZu4UCYX0Md+pUVn9F5s7QqQZPAdEKH8oyKTpPMzsg1Av9Ezki2lDhYLZPI5CW1 dSrPgfF7D9qIeCPqePcZoIP6SCQgjItpFFk019OqUqsbNrLwDQNydEHZnl2JH5ws1STl snkB8Vh7+dnu0/ePEiMBrkKjXWsWVLbUq4jvsp33kCWNru0ZfnlZ12IFprJHahG/OuKH YmxaTKOhXKydXe4Fc562ioeyrZB2SBG6S7Fetosyw+aqQtpmTkKFe7O1bGYyPwNBiBlq iBEw== X-Gm-Message-State: AOAM533HUrj4vujOSc8Ov698i8Ac+6BaOJD+nBeBKyeiwYpoOpK4ZPKh b7/nMjgay6/H/NkvnLTu9FNWenVo/weWHQE2BmZSbg== X-Google-Smtp-Source: ABdhPJxD+gMYqAN8prntyoV86UZyJFb21ymmzmRInlxjBt92s9bz/m/hwcqlUHHsYXU7To0V700E1864VD3xboYuEx4= X-Received: by 2002:a17:906:31c6:: with SMTP id f6mr20722950ejf.386.1624974251593; Tue, 29 Jun 2021 06:44:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Tue, 29 Jun 2021 14:44:00 +0100 Message-ID: Subject: Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure To: Aditya Toshniwal Cc: Rahul Shirsat , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000009263b05c5e7cdb9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000009263b05c5e7cdb9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 29, 2021 at 2:41 PM Aditya Toshniwal < aditya.toshniwal@enterprisedb.com> wrote: > Dave, > > Somehow, the new text strings are added to PO with incorrect translations= . > That is causing the issue. > Either they should be empty or fixed. > Then the source problem should be fixed. There's no point at all in putting fixes directly in the PO files as they'll be overwritten prior to release anyway. > > On Tue, Jun 29, 2021 at 7:01 PM Dave Page wrote: > >> Hi >> >> Please send the patch without updates to the po files. Those get updated >> as part of the release process. >> >> Thanks. >> >> On Tue, Jun 29, 2021 at 2:00 PM Rahul Shirsat < >> rahul.shirsat@enterprisedb.com> wrote: >> >>> Hi Hackers, >>> >>> Thanks Aditya for pointing out the issue. Please find the attached patc= h >>> which contains all the .po files corrected with %s. >>> >>> Regards, >>> Rahul Shirsat. >>> >>> On Tue, Jun 29, 2021 at 4:31 PM Aditya Toshniwal < >>> aditya.toshniwal@enterprisedb.com> wrote: >>> >>>> Hi Rahul, >>>> >>>> I did "make msg-extract" and "make msg-update" and looking at the PO >>>> files I think it is not updated correctly. >>>> For instance, the below message has msgstr without %s. I corrected it >>>> and the error was gone. >>>> >>>> #: pgadmin/browser/server_groups/servers/roles/static/js/role.js:766 >>>> #, fuzzy, python-format >>>> msgid "%s Objects" >>>> msgstr "Obiekty" >>>> >>>> The one below had 2 %s in msgstr and I corrected it to fix the error. >>>> >>>> #: pgadmin/browser/server_groups/servers/roles/static/js/role.js:767 >>>> #, fuzzy, python-format >>>> msgid "Are you sure you wish to %s all the objects owned by the >>>> selected role?" >>>> msgstr "Czy na pewno skasowa=C4=87 %s \"%s\" i wszystkie obiekty zale= =C5=BCne od >>>> niego?" >>>> >>>> >>>> You have to update the .po files to match the total %s and send the >>>> patch. >>>> >>>> On Tue, Jun 29, 2021 at 1:56 PM Dave Page wrote: >>>> >>>>> Hi >>>>> >>>>> On Tue, Jun 29, 2021 at 4:38 AM Rahul Shirsat < >>>>> rahul.shirsat@enterprisedb.com> 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* b= e >>>>> 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 cons= tant >>>>> 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 =3D 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 wrote: >>>>>> >>>>>>> Hi >>>>>>> >>>>>>> On Mon, Jun 28, 2021 at 4:57 PM Rahul Shirsat < >>>>>>> rahul.shirsat@enterprisedb.com> 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 b= eing >>>>>>> done at the moment is correct (I don't know why it's failing, but i= t'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 >>>>> >>>>> >>>> >>>> -- >>>> Thanks, >>>> Aditya Toshniwal >>>> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com* >>>> >>>> "Don't Complain about Heat, Plant a TREE" >>>> >>> >>> >>> -- >>> *Rahul Shirsat* >>> Senior Software Engineer | EnterpriseDB Corporation. >>> >> >> >> -- >> Dave Page >> Blog: https://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EDB: https://www.enterprisedb.com >> >> > > -- > Thanks, > Aditya Toshniwal > pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com* > > "Don't Complain about Heat, Plant a TREE" > --=20 Dave Page Blog: https://pgsnake.blogspot.com Twitter: @pgsnake EDB: https://www.enterprisedb.com --00000000000009263b05c5e7cdb9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Jun 29, 2021 at 2:41 PM Adity= a Toshniwal <aditya= .toshniwal@enterprisedb.com> wrote:
Dave,

Somehow, the new text strings are added to PO with inco= rrect translations. That is causing the issue.
Either they should be empty or fixed.

Then the source problem should be fixed. Ther= e's no point at all in putting fixes directly in the PO files as they&#= 39;ll be overwritten prior to release anyway.
=C2=A0

On Tue, Jun 29, 2021 at 7:01 PM Dave Page <dpage@pgadmin.org> wrote:
Hi

Please send the patch = without updates to the po files. Those get updated as part of the release p= rocess.

Thanks.

On Tue, Jun 29, 2021 at 2:00 = PM Rahul Shirsat <rahul.shirsat@enterprisedb.com> wrote:
Hi Hackers,

T= hanks Aditya for pointing out the issue. Please=C2=A0find the attached patc= h which contains all the .po files corrected with %s.

<= div>Regards,
Rahul Shirsat.

On Tue, Jun 29, 2021 at 4:31 PM = Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
=
H= i Rahul,

I=C2=A0did "make msg-extra= ct&q= uot; and "make msg-update" and looking at the PO fil= es I think it is not updated correctly.
For instance, the below message = has msgstr without %s. I corrected it and the error was gone.

#: pga= dmin/browser/server_groups/servers/roles/static/js/role.js:766
#, fuzzy,= python-format
msgid "%s Objects"
msgstr "Obiekty"= ;

The one below had 2 %s in msgstr and I corrected it to fix the err= or.

#: pgadmin/browser/server_groups/servers/roles/static/js/role.js= :767
#, fuzzy, python-format
msgid "Are you sure you wish to %s = all the objects owned by the selected role?"
msgstr "Czy na pe= wno skasowa=C4=87 %s \"%s\" i wszystkie obiekty zale=C5=BCne od n= iego?"


You have to update the .po files to match the total = %s and send the patch.

On Tue, Jun 29, 2021 at 1:56 PM Dave Page <= ;dpage@pgadmin.org> wrote:

I feel gette= xt 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 get= text extracts strings to create/update the catalogs, it will search the cod= e 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.=C2=A0

Keep in mi= nd 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 =3D 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?
=C2=A0

Please= =C2=A0find the updated patch.

On Mon, Jun 28, 2021 at 9:33 PM Dave Pag= e <dpage@pgadmin.= org> wrote:
Hi
=
On Mon= , Jun 28, 2021 at 4:57 PM Rahul Shirsat <rahul.shirsat@enterprisedb.com>= 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=C2= =A0to gettext calls, as there won't be any way to extract a complete me= ssage into the catalogs. The way it's being done at the moment is corre= ct (I don't know why it's failing, but it's the correct way to = structure the gettext calls).
=C2=A0
--
Dave Page
Blog: https://pgsnake.blogspot.com
Twitter: @= pgsnake

EDB: https://www.enterprisedb.com



--
Rahul Shirsat
Senior Software Engin= eer=C2=A0|=C2=A0EnterpriseDB=C2=A0Corporation.


--
Dave Page
Blog: https://pgsnake.blogspot.com
Twitter: @pgsnake<= br>
EDB: http= s://www.enterprisedb.com



--
Thanks,
Aditya Toshniwal=
pgAdmin hacker=C2=A0| Sr. Software Engineer | edbpostgres.com
&quo= t;Don't Complain about Heat, Plant a TREE"


--
Rahul Shirsat
Senior Software Engin= eer=C2=A0|=C2=A0EnterpriseDB=C2=A0Corporation.


--
Dave Page
Blog: https://pgsnake.blogspot.com
Twitter: @pgsnake<= br>
EDB: http= s://www.enterprisedb.com



--
Thanks,
Aditya Toshniwal=
pgAdmin hacker=C2=A0| Sr. Software Engineer | edbpostgres.com
&quo= t;Don't Complain about Heat, Plant a TREE"


--
<= /div> --00000000000009263b05c5e7cdb9--