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 1ly94f-0002Wx-M4 for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 08:26:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ly94d-0005jr-Ej for pgadmin-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 08:26:27 +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 1ly94d-0005jK-7w for pgadmin-hackers@lists.postgresql.org; Tue, 29 Jun 2021 08:26:27 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ly94W-0005su-2W for pgadmin-hackers@postgresql.org; Tue, 29 Jun 2021 08:26:26 +0000 Received: by mail-ej1-x635.google.com with SMTP id hq39so34897461ejc.5 for ; Tue, 29 Jun 2021 01:26:19 -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=3n+GTPZYXcv8JJFilCmI1kxseN3lFMHzM3dkA2v0/mk=; b=dmMPqHKsCtrP+rJ8D1CuEzQGTJCDihOFKaCKTzJcQFqG5qqYYzfIuggEh5CmLfOk+9 XzwuzVxCAqmZ7/F7Ivf6Gei3BheRVJrY+jELoXDyKFRn3br3TNvkK2wUTI1UG4IbchLs iK3gYX+c6AvnWpYDSJxmJY7mMjPno2sG5RwxYBbifzevFYUT7MWA5ooyB9QTIyecowkI iAz6qQx+Sg0m8gjvA6gktswrl855vKEPShoHyykXzKDtqeaEpvHsU9Ou04a3RBi2G7I7 Aewb0iQk62p1Z70UJKO5GKVVvZgINPbJANZQ5aXzuHTX05euI8Yk+04dKheHPAKQfgWx BCzA== 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=3n+GTPZYXcv8JJFilCmI1kxseN3lFMHzM3dkA2v0/mk=; b=sjSZJOtlv+Kwr8nWI4HRJNeVKn+nq78K0mDCrUxlQk2ySDMOaqeG68DRLDFkUhQ3Sz dutBvsWi1M6aWCH7x79fAVgbkfrH39jdW5ZQ4S2D+wMuDE68Lpf75BjADjg4roXScSDs VGKBV5/aoRk2R6zVRIhNL+IWO3VmZsORuta+lfYLXfZRJeTf/M0+ctj0NIy7aznpvO7N xtP5aOYOpMsw/gURD8Eu4I/6WVW/G4KDjfNKisNUhC/uhDZKsY+Jlk6y1ClZ3AK3BKM1 fQT7P8niVdX0cJGjFhDrNul1MnLPYcOrcWrFcW6uFqt3NzLTy8biR61c1oo9dtXuMmDw 0dMA== X-Gm-Message-State: AOAM531Ta0zkJma2cNG+4rOl0zS3DyOmWST35lQx7UERyJHyMC/s63/b kHKkZNTowd5aPhF/6IHlYLPgk+1shhKe1O4hKwWy1Q== X-Google-Smtp-Source: ABdhPJyqBVLFuxF66dUUHwUs1QB5vHrNzfwfXvoVbhboiKAts4/1GVSgm6g+jYar/ZzScvDzqzHG52rzuyF6301CzQw= X-Received: by 2002:a17:906:31c6:: with SMTP id f6mr19442661ejf.386.1624955178195; Tue, 29 Jun 2021 01:26:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Tue, 29 Jun 2021 09:26:07 +0100 Message-ID: Subject: Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure To: Rahul Shirsat Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="0000000000002c317205c5e35c6e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002c317205c5e35c6e Content-Type: text/plain; charset="UTF-8" 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 constant 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 = 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 --0000000000002c317205c5e35c6e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Tue, Jun 29, 2021 at 4:38 AM Ra= hul Shirsat <rahul.shi= rsat@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.
<= /div>

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

When gettext extracts strings to create/update the catalogs, it wi= ll search the code for all gettext calls, and then extract a string constan= t from the first argument. You cannot have variables, function calls or exp= ressions in there. It *must* be a string constant.=C2=A0

Keep in mind that msgextract is scanning the source code; it's n= ot executing it. There are many examples in the code, e.g. (from node.js):<= /div>

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

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

<= /div>
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@enterpri= sedb.com> wrote:
Hi Hacke= rs,

Please find the attached patch for fixation of jenki= ns failure.

That won't work= - you can't include variables (or string building operations) in the f= irst argument=C2=A0to gettext calls, as there won't be any way to extra= ct 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).
=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.


--
<= /div>
--0000000000002c317205c5e35c6e--