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 1lyDzd-0003VW-VA for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 13:41:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyDzc-0007NU-JI for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 13:41:36 +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 1lyDzc-0007LT-4x for pgadmin-hackers@lists.postgresql.org; Tue, 29 Jun 2021 13:41:36 +0000 Received: from mail-ua1-x934.google.com ([2607:f8b0:4864:20::934]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lyDzZ-00060K-AJ for pgadmin-hackers@postgresql.org; Tue, 29 Jun 2021 13:41:35 +0000 Received: by mail-ua1-x934.google.com with SMTP id c47so7674523uad.1 for ; Tue, 29 Jun 2021 06:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/bzohwbhRFOWlGRw6ZU7zdW4VU76d+HYNEuoVY0MXfc=; b=u20ftX2l4yckKeHTOmUNd5+jLFJgVNNJtkoy21O/+lBUPYXs++E3TOrsJ2GFZkZmWM JT36/ylmOc5p319LaBGCZpW8e4s3diW+s6PUKI+/l8t/9MbW0KulfHRox2FfYweWfQb0 TfALcPH6zr3S6seUr+72Qi8Ey6MInrDVRzkBtIOmVtV/UhYfMFUwNGeieMeIKXuPGMWv 7qvOmGegq42fM/dahu/oNbaE43RkzdpQT7UGEK4Vs+TR3xG8muCCdihE7Vn+ZAhlgsMb hjVnvRRN2cab5Yp8/nWJnCgEtD14Iz2PWTNZluczPUzD1A/N8D0WwXpilvzGULjOadjh 3K7A== 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=/bzohwbhRFOWlGRw6ZU7zdW4VU76d+HYNEuoVY0MXfc=; b=IDKADRHk9v5hPgQPIMX6XD60aQad3zdXyG73n+FHpqk17ioG52AN/6iSpaQp5ekae2 6chGy2OYNzaPX3MFUtC2RjgcrYUOgJ5I6xAf3dJycQsw1izqIIeFwXBmHyF6bjBZeg1u W/7mxO16oVCtP0xHpqwH4NjIGHLHFot9YDxIrWklGNIeAqd8Bpc05viTP9LzczV1yR2a UCXnp1+nJweKMF6iMFA4Ve2bRHOEORNXaM0ZrJ2aKSiddIKmr1iJtY5A0S6p8Vi4gvuC YC/zPRVBijOETIIyEBPoDZgEIgRvt1qPlJN1B674jpBN5wyaF5G8QykRjOV66eyNn8Ma 9NcA== X-Gm-Message-State: AOAM530dOyOA9BFIfBLCLXAheKvN1U7zQ3zD+cJBPUHMw4u4qUwod2tT hLdGh68IOocKgsw5Am8zclw3ybRY6C4PLToWbJtaD0QxpUYAxKpBQm9NxjO9S2KkawxEUv3bbb4 Z0FRpJXo532S1lE5mCLeyxUeUbcMbEkuRGwqn0CCj53UaYzvygIDOTyqWYZ7G8qXCnHQBWWIu/0 XvPFscgf5D0aO6X1oDj4ywZ7Pi/OaYYon2PTDxbWqFPHlkfhn6MSXU88hy6A== X-Google-Smtp-Source: ABdhPJw65/mSpK+9nIQEsDuZngPfxS+9movaSB0CNGdW0sm9bJpFPt8dHzxFG+czPt9cnZJ5MaSF5P+22yCAEPrkMvY= X-Received: by 2002:ab0:6392:: with SMTP id y18mr27047090uao.139.1624974091939; Tue, 29 Jun 2021 06:41:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Tue, 29 Jun 2021 19:10:55 +0530 Message-ID: Subject: Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure To: Dave Page Cc: Rahul Shirsat , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000850b6d05c5e7c32e" X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000850b6d05c5e7c32e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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. 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 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 selecte= d >>> 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* 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 const= ant >>>> 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 b= e any >>>>>> way to extract a complete message into the catalogs. The way it's be= ing >>>>>> 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 > > --=20 Thanks, Aditya Toshniwal pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com* "Don't Complain about Heat, Plant a TREE" --000000000000850b6d05c5e7c32e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dave,

Somehow, the new text strings are added to PO with i= ncorrect translations. That is causing the issue.
Either they should be emp= ty or fixed.

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 upd= ated 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=C2=A0find the attached patch which conta= ins all the .po files corrected with %s.

Regards,<= /div>
Rahul Shirsat.

Hi Rahul,

I=C2=A0did "make msg-extract"<= /span> and "make msg-update" and looking at the PO files I = think it is not updated correctly.
For instance, the below message has m= sgstr without %s. I corrected it and the error was gone.

#: pgadmin/= browser/server_groups/servers/roles/static/js/role.js:766
#, fuzzy, pyth= on-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<= br>#, fuzzy, python-format
msgid "Are you sure you wish to %s all t= he objects owned by the selected role?"
msgstr "Czy na pewno s= kasowa=C4=87 %s \"%s\" i wszystkie obiekty zale=C5=BCne od niego?= "


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

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

On Tue, Jun 29, 2021 at 4:38 AM Rahul Shir= sat <rahul.shirsat@enterprisedb.com> wrote:
I feel gettext sometimes = won't escape the characters as it should be.

I now t= ried to escape those using some utils.

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

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

Keep in mind that msgex= tract is scanning the source code; it's not executing it. There are man= y 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 sur= e 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 Page <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 fa= ilure.

That won't work - yo= u 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 mome= nt is correct (I don't know why it's failing, but it's the corr= ect way to structure the gettext calls).
=C2=A0
--
Dave Page
Blog: https://pgsnake.blogspot.com
T= witter: @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. Softwa= re Engineer | edbpostgres.com<= /font>
"Don't Complain about Heat, Plant a TREE&qu= ot;
--000000000000850b6d05c5e7c32e--