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 1lyDqL-0003GR-Q1 for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 13:32:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyDqK-0003q0-PS for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 13:32:00 +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 1lyDqJ-0003ps-Li for pgadmin-hackers@lists.postgresql.org; Tue, 29 Jun 2021 13:32:00 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lyDqG-0005vj-FZ for pgadmin-hackers@postgresql.org; Tue, 29 Jun 2021 13:31:58 +0000 Received: by mail-ed1-x52e.google.com with SMTP id n20so31335574edv.8 for ; Tue, 29 Jun 2021 06:31:55 -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=mN6j/ZQ+ep/+wA4q+W2WCk/v8amy6BWPyl+8BA+dmks=; b=inXPij6SlzuKFKjJt9PiByszE/NEdoR624HZcJuVckF9ZbHYg5Bq2nnoDz4SJOnWdU k6pVsRGyh2CsWxtef/uV8Wur/R/ZJjyUaeYo7+c8tF+G2OutHpL8/9N2zi2zEjY/Gy33 pNVXNLr08QQZ7EFjQ57O4nePhFRvElRccM+bP3YSGDCT0Yf22LCpizKJQka0AU6+LKFU me6cxks7sTCIl0H6OVSzGViodItS1yzfkrlQ8K0d5SstVr52f+/Gr6lm4ASJvcHZ28Sd 9LwpNO0YmEtdTgzW5PZnllIN8j8dEQllMCxLCkdDlWX1ILw/kfuZynZy0SH5N0ujX6E9 uN0Q== 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=mN6j/ZQ+ep/+wA4q+W2WCk/v8amy6BWPyl+8BA+dmks=; b=ZcHvE3RIWP/hO+hBVnSdgiXj602XInp4m0271vKxyVzwJ6oXdkF4seWy6lYkYMM/wG e1zwcT9TCmV+dO3/nL1Zhxv2KtvA1DOJ4Sopx0bJPAx+Nm8jZjlW61LCWETl4Y/xuMzP I8vRlsoAlClNOVTKh+Thy52jAHYoRfSjUvdR9kpMd6mpEU290+exF8wuDTbw/uHnTXUC UAg0CCIEThDD3WKl381UV5Hx+JbEL+Xo/x1sjGmYiViOB9TpD9l+5iL/TOfWRC3IcPVb 0kcgDVV1TaMqaSnqEXh1ls+59fBqO8LBMK1HJ9NjniRJrEYkCpQC3pJXQER7xvpI01zL Xuog== X-Gm-Message-State: AOAM530Mx6v3WlS+nA/wlxOyaxhyPTXVYKKSkQDMm1fpvEFnE9cVO82b Q360AIlj2lL6eG7c4S02sk1+JbkLJMGLmeCG0ImBxA== X-Google-Smtp-Source: ABdhPJxyLMkrwn+ndbMiiNnMn2GGDvdjWX76PeFu5l0yp7eW4j/xv4DgyGVT67h0tyTa34JJAdYFC06qtiOl6LroSW4= X-Received: by 2002:aa7:d918:: with SMTP id a24mr41813335edr.235.1624973513986; Tue, 29 Jun 2021 06:31:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Tue, 29 Jun 2021 14:31:42 +0100 Message-ID: Subject: Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure To: Rahul Shirsat Cc: Aditya Toshniwal , pgadmin-hackers Content-Type: multipart/alternative; boundary="0000000000001224ab05c5e7a1b6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001224ab05c5e7a1b6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 an= d >> 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 patc= h. >> >> 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 consta= nt >>> 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 bei= ng >>>>> 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. > --=20 Dave Page Blog: https://pgsnake.blogspot.com Twitter: @pgsnake EDB: https://www.enterprisedb.com --0000000000001224ab05c5e7a1b6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

Please send the patch without update= s to the po files. Those get updated as part of the release process.
<= div>
Thanks.

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

Thanks Aditya for pointing out th= e issue. Please=C2=A0find the attached patch which contains all the .po fil= es corrected with %s.

Regards,
Rahul Shi= rsat.

On Tue, Jun 29, 2021 at 4:31 PM Aditya Toshniwal <aditya.toshniwa= l@enterprisedb.com> wrote:
Hi Rahul,=
I=C2=A0did "make msg-extract" and "make msg-update" and looki= ng at the PO files I think it is not updated correctly.
For instance, th= e below message has msgstr without %s. I corrected it and the error was gon= e.

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

The one below had 2 %s in msgstr and I corrected i= t to fix the error.

#: pgadmin/browser/server_groups/servers/roles/s= tatic/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 z= ale=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 P= M Dave Page <dpag= e@pgadmin.org> wrote:
Hi

On Tue, Jun 29, 2021 at 4:38 AM Rahul Shirsat <rahul.shirs= at@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 constant = from the first argument. You cannot have variables, function calls or expre= ssions in there. It *must* be a string constant.=C2=A0

=
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 th= e 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 Page <= dpage@pgadmin.org> wrote:
Hi

On Mon, Jun 28, 2021 at 4:57 PM Rahul Shirsat <rahul.shirsat@enterprise= db.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 fir= st 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 m= oment is correct (I don't know why it's failing, but it's the c= orrect 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.


--
--0000000000001224ab05c5e7a1b6--