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 1lyECq-0003p7-Q1 for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 13:55:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyECp-0001za-O7 for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 13:55:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyECp-0001zQ-GA for pgadmin-hackers@lists.postgresql.org; Tue, 29 Jun 2021 13:55:15 +0000 Received: from mail-vs1-xe32.google.com ([2607:f8b0:4864:20::e32]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lyECm-00005O-5H for pgadmin-hackers@postgresql.org; Tue, 29 Jun 2021 13:55:15 +0000 Received: by mail-vs1-xe32.google.com with SMTP id o7so12145295vss.5 for ; Tue, 29 Jun 2021 06:55:11 -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=BKeKp3qfAw5FhF+gte/wemxz5xUnKy2zDg4U33Skn/M=; b=ctJN8Av6CGVvMLQtMRFL2eQxDQWu2ocAuh6H8OEhFIOqWar46k/rp074RefzW9MmEF btmDsHSWam43dL5c4cL4YXVAUuE2USi4QRwnWsN+EX6L9vcsleF5HjiGJOxMsxoAxmAY te/HCSSqMCMfDN7tefy+/KgqPz9s31ij+X4m9QU7g7/bqxVXSU3pz6hFMUuAZ3ArlN4G 3cgMFPMox/QY+UIoRE/6nYNoNcHpk4gpFLs95I4GxpWC1W1Hw+y8CzupeJOO1YHXnJRF LUjHQO9I+a2Z3HYk2TU/+uJnHRuXMmjQC5eNBvfT6xEXTbCRkcOe+BKHSJUVY/gE8kVb jBNw== 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=BKeKp3qfAw5FhF+gte/wemxz5xUnKy2zDg4U33Skn/M=; b=R6O+eYgwxPIQzH0LM4IH5+gGs9y+rmQ1pxaI/r//cVSunaGJ7BqE6Y+q+kKhaVi49n tmFYa1gbf2OTQRJ0IOluahlK4CUkd+4WFOYXZ3AioLB6eR4zepZcyrD8y3Hz2IjVdZxk DhM2KRNmR63UQLbULl4idDycr90bM/L5wwHFHmNHUlfCLA23BmFNgoSaA4dWXAlbDB+U JkMLswEr5C8CD2tyoFIZaR/MD/G8jiHww5AOgdeBzYy0MY7FSMI/9txiDW7DHMA6JoZl wCrIlru/urZ6tnyDz/OJjy23NAYduiJF1Q/N1LWYPa9RpgNCiJe5TU5ldmdtkMaD5i7e NzRg== X-Gm-Message-State: AOAM532A44VRvONscly7AHzxkliC5Z4ojYqk/9HJa6Y6wneXTJzI+qjV Dm66G//QKwI+M+8UHCoSsUnqHlx9/bQqzn66UWMxZ1wlCd9DnHyzk3WqIQ7GGk9qI9hY3sPC11H S+MyFG428Qc/FZWxSpHzwzKmNGC7fRHzSZNcKnzmH6MT8EmCaWBOe3hZ23JQ9ti3ksEwAUICtr+ tOBnLjHYUMG6dxEQIJ5Ms8w1sTBxEpK2KCfMBmBDsKr86/wpiCghp3m7cljA== X-Google-Smtp-Source: ABdhPJwDrA/eVT7qlQ7MuXaIGkyaGGcKFxQT5gFCaOVhxkb1Gi5Zuoh4tQ38CvmHNgPcEGEjA6/cIAlBZfozVUkSa+g= X-Received: by 2002:a67:fd7a:: with SMTP id h26mr24878221vsa.51.1624974909533; Tue, 29 Jun 2021 06:55:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Tue, 29 Jun 2021 19:24:33 +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="000000000000407f1f05c5e7f400" 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 --000000000000407f1f05c5e7f400 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 to > release anyway. > The translations submitted by translators are updated in the PO file right ? And then they're compiled to MO ? It's the same like Rahul will be submitting the translations. Please correct me if I'm wrong. > > >> >> 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 update= d >>> 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 >>>>> 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 b= e. >>>>>>> >>>>>>> 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 con= stant >>>>>> from the first argument. You cannot have variables, function calls o= r >>>>>> 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.j= s): >>>>>> >>>>>> 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 = 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 > > --=20 Thanks, Aditya Toshniwal pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com* "Don't Complain about Heat, Plant a TREE" --000000000000407f1f05c5e7f400 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

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


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 s= hould be empty or fixed.

Then t= he source problem should be fixed. There's no point at all in putting f= ixes directly in the PO files as they'll be overwritten prior to releas= e anyway.
The translations submitted by tran= slators are updated in the PO file right ? And then they're compiled to= MO ?
It's the same like Rahul will be submitting the tran= slations. Please correct me if I'm wrong.
=C2=A0

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

Ple= ase send the patch without updates to the po files. Those get updated as pa= rt of the release process.

Thanks.

=
On Tue, Ju= n 29, 2021 at 2:00 PM Rahul Shirsat <rahul.shirsat@enterprisedb.com> wro= te:
Hi Hackers,

Thanks Aditya for pointi= ng out the issue. Please=C2=A0find the attached patch which contains all th= e .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=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 g= ettext 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 being passe= d 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 fi= rst argument. You cannot have variables, function calls or expressions in t= here. It *must* be a string constant.=C2=A0

Keep i= n 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?
=C2=A0

Please=C2=A0find the updated patch.

On M= on, 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 fixati= on of jenkins failure.

That won= 't work - you can't include variables (or string building operation= s) in the first argument=C2=A0to gettext calls, as there won't be any w= ay 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 i= t's the correct way to structure the gettext calls).
=C2=A0
--
=


--
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. Softwa= re Engineer | edbpostgres.com<= /font>
"Don't Complain about Heat, Plant a TREE&qu= ot;
--000000000000407f1f05c5e7f400--