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 1lyEIc-00041h-3V for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 14:01:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyEIb-0002wF-1Q for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 14:01:13 +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 1lyEIa-0002w7-JU for pgadmin-hackers@lists.postgresql.org; Tue, 29 Jun 2021 14:01:12 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lyEIX-0006FW-GV for pgadmin-hackers@postgresql.org; Tue, 29 Jun 2021 14:01:11 +0000 Received: by mail-ej1-x636.google.com with SMTP id bu12so36660181ejb.0 for ; Tue, 29 Jun 2021 07:01:08 -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=qjzsCifX+Lj4mw7Uylc8vRxtRObZo1uRNePUrfvyKq8=; b=JbcMZr2t4HpT7Z1jOo2bC7uZPujDnidwU03v/xXsTnnMfV8g+jKe+gEwNXTjVd/y39 HjOsF4ZW2BhR3/Bj5oSmPQjkXKkNLVZHXJzTIGJMzGss4Q+Zp7TBgT03B7Ssx0Vvhj7t o86QWlSW3jG05SeVwjlARvwScAHxYvqd46DMtpk8FpxJkcUsc0CbQTPwtV7Wh3myv9tA XtPbMi57HKEEI8+7S6iwDgsi43sFg+nZxy1TDvwi1/+q9ujBUsd+Wl+jLmM0C2If0kfX kx1zkYKuvEPZKzUnXMzB2CNmPGn50jAThCL49B0LuISJbnIJ3/7Ig/D2mmhGjdowyKmN T25w== 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=qjzsCifX+Lj4mw7Uylc8vRxtRObZo1uRNePUrfvyKq8=; b=Om4NUUDmYZiUde+fveG/qD74/wrCCbfNyrd8KxVIVdFCCEsykJyw6IWn07lQGA2qcu SniIRBkL5umvjlk4mOFtVDfH5bmFV+sxJiXGhKJzp4aQpEGRRYRLeqd5NmTMWTugW7yA lF1r2ketdHkGcscDKyOZhFB5rEYW9c6OOoAKs/ubkKmp8aaYG/uY8z1tZaeUe/tIp493 JbjdhLk9KhKrNxwGTb1iOAuQDs+BYttO+LkFD9SJhex1YtI5oBGpfOfSIdFrAE568WCl G3+wqCjBdNCjJUbUDM9/L9PYCYuiUpRx9d5NM4LmEFvlA+rT0HNXfIICXf+rtP6gv+Ix 6Kiw== X-Gm-Message-State: AOAM530lXhcTmUc4iGHdSjS8co05mK41P5lS2N3O34OgpllChqnv0Xj0 0QRf/3kRukYiELzKhpRrXr79tU+nZV10iS9f79cWGstfUw7yEw== X-Google-Smtp-Source: ABdhPJwkmDy0UYnJbb4HXhN//cVUfVnA56Cm5xNmpQRUzSp995exIiyU0vw1Bb9fnhOfZMu6H2YQii99p237lo7LzU4= X-Received: by 2002:a17:906:b0c8:: with SMTP id bk8mr30886412ejb.412.1624975267209; Tue, 29 Jun 2021 07:01:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Tue, 29 Jun 2021 15:00:55 +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="00000000000092329d05c5e8096c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000092329d05c5e8096c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 29, 2021 at 2:55 PM Aditya Toshniwal < aditya.toshniwal@enterprisedb.com> wrote: > Hi, > > On Tue, Jun 29, 2021 at 7:14 PM Dave Page wrote: > >> >> >> 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 t= o >> release anyway. >> > The translations submitted by translators are updated in the PO file righ= t > ? And then they're compiled to MO ? > Right. > It's the same like Rahul will be submitting the translations. Please > correct me if I'm wrong. > That depends if he's changed the original message or the translated message. It's impossible to see without reading megabytes of text. And in any case, he's updated translations that haven't been touched in ages - why would they suddenly have broken? (hint: if the upstream message has changed, it'll be marked as fuzzy or untranslated - in other words, gettext knows how to handle that). > >> >>> >>> 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 >>>>> patch 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 i= t >>>>>> 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 zal= e=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* >>>>>>> be in the gettext call. >>>>>>> >>>>>>> When gettext extracts strings to create/update the catalogs, it wil= l >>>>>>> search the code for all gettext calls, and then extract a string co= nstant >>>>>>> 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 yo= u >>>>>>> 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= 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 >>>>>>> >>>>>>> >>>>>> >>>>>> -- >>>>>> 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" >>> >> >> >> -- >> 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 --00000000000092329d05c5e8096c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


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

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


On Tue, Jun 29, 202= 1 at 2:41 PM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wro= te:
Dave,
=
Somehow, the new te= xt strings are added to PO with incorrect translations. That is causing the= issue.
Either they shou= ld be empty or fixed.

Then the = source problem should be fixed. There's no point at all in putting fixe= s directly in the PO files as they'll be overwritten prior to release a= nyway.
The translations submitted by transla= tors are updated in the PO file right ? And then they're compiled to MO= ?

Right.
=C2=A0
=
It's the same like Rahul will be submitting the translations. Please c= orrect me if I'm wrong.

<= /div>
That depends if he's changed the original message or the tran= slated message. It's impossible to see without reading megabytes of tex= t.

And in any case, he's updated translations = that haven't been touched in ages - why would they suddenly have broken= ? (hint: if the upstream message has changed, it'll be marked as fuzzy = or untranslated - in other words, gettext knows how to handle that).
<= div>=C2=A0
=C2=A0<= /div>

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

Please sen= d the patch without updates to the po files. Those get updated as part of t= he release process.

Thanks.

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

=
Thanks Aditya for pointing out the issue. Please=C2=A0find the a= ttached patch 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> wrot= e:
Hi Rahul,
I=C2=A0did "ma= ke msg-extract" and "make msg-update" and looking a= t the PO files I think it is not updated correctly.
For instance, the be= low message has msgstr without %s. I corrected it and the error was gone.
#: pgadmin/browser/server_groups/servers/roles/static/js/role.js:766<= br>#, 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/stati= c/js/role.js:767
#, fuzzy, python-format
msgid "Are you sure you= wish to %s all the objects owned by the selected role?"
msgstr &qu= ot;Czy na pewno skasowa=C4=87 %s \"%s\" i wszystkie obiekty zale= =C5=BCne od niego?"


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

On Tue, Jun 29, 2021 at 1:56 PM D= ave Page <dpage@p= gadmin.org> 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.<= div>
I now tried to escape those using some utils.

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

=
When gettext extracts strings to create/update the catalogs, it will s= earch the code for all gettext calls, and then extract a string constant fr= om the first argument. You cannot have variables, function calls or express= ions in there. It *must* be a string constant.=C2=A0

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

title =3D gettext('Drop %s?', obj.label);
<= /div>

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

Please=C2=A0find the updated patch.

On Mon, Jun 28, 2021 at 9:33= PM Dave Page <dp= age@pgadmin.org> wrote:
<= div>Hi

On Mon, Jun 28, 2021 at 4:57 PM Rahul Shirsat <rahul.shirsat@enterprisedb= .com> wrote:
Hi Hackers,<= div>
Please find the attached patch for fixation of jenkins f= ailure.

That won't work - y= ou 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 message into the catalogs. The way it's being done at the mom= ent is correct (I don't know why it's failing, but it's the cor= rect 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"


--
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> --00000000000092329d05c5e8096c--