Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Rahul Shirsat <rahul(dot)shirsat(at)enterprisedb(dot)com>, Khushboo Vashi <khushboo(dot)vashi(at)enterprisedb(dot)com>, Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure
Date: 2021-07-05 08:22:30
Message-ID: CANxoLDfFRGHiSmaVntKKCPQg5iZp2vPbpP4VngaGvyn1ymi0gw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

On Mon, Jul 5, 2021 at 1:40 PM Dave Page <dpage(at)pgadmin(dot)org> wrote:

>
>
> On Fri, Jul 2, 2021 at 8:41 PM Rahul Shirsat <
> rahul(dot)shirsat(at)enterprisedb(dot)com> wrote:
>
>> +1 for --no-fuzzy-matching for updating translations.
>>
>> On Thu, Jul 1, 2021 at 11:18 AM Khushboo Vashi <
>> khushboo(dot)vashi(at)enterprisedb(dot)com> wrote:
>>
>>>
>>>
>>> On Wed, Jun 30, 2021 at 6:55 PM Dave Page <dpage(at)pgadmin(dot)org> wrote:
>>>
>>>> Hi
>>>>
>>>> On Wed, Jun 30, 2021 at 9:22 AM Dave Page <dpage(at)pgadmin(dot)org> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> On Wed, Jun 30, 2021 at 8:28 AM Rahul Shirsat <
>>>>> rahul(dot)shirsat(at)enterprisedb(dot)com> wrote:
>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> Please find the attached patch for resolving this issue wrt above
>>>>>> suggestion.
>>>>>>
>>>>>
>>>>> Well that may fix the problem (and is a reasonable change), however, I
>>>>> think it's important that we understand the root cause. Why is this failing
>>>>> on Linux only? Why does the following from node.js (which follows the same
>>>>> pattern) work fine?
>>>>>
>>>>> var type_label = gettext('%s Script',stype.toUpperCase());
>>>>>
>>>>
>>>> Rahul and I figured out the root cause. The issue is occuring because
>>>> the previous string had no parameters (i.e. no %s's). Because fuzzy
>>>> matching is used for the translations, when updating the catalogs it was
>>>> matching with the old translation, which at runtime would likely have
>>>> caused a crash because the catalogs would have contained something like:
>>>>
>>>> #: pgadmin/browser/static/js/node.js:209
>>>> #, fuzzy, python-format
>>>> msgid "Search %s Objects"
>>>> msgstr "Typy obiektów"
>>>>
>>>> There are a few of ways around this:
>>>>
>>>> - Manually fix the translations in each catalog. This is not a good
>>>> idea because we don't speak all those languages and will probably mess the
>>>> translations up.
>>>>
>>>> - Run something like 'make msg-extract && pybabel update
>>>> --no-fuzzy-matching -i web/pgadmin/messages.pot -d web/pgadmin/translations
>>>> && make msg-compile', then commit the results. This will remove all fuzzy
>>>> matches from the catalogs, which means more work for the translators on the
>>>> next release, but will likely also result in them becoming much cleaner.
>>>>
>>>> +1 for pybabel update with -N option
>>>
>>>
> Akshay?
>

Yes, I'll also go with the second option "--no-fuzzy-matching".

>
>
> --
> Dave Page
> Blog: https://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EDB: https://www.enterprisedb.com
>
>

--
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2021-07-05 08:49:58 pgAdmin 4 commit: Don't use fuzzy matching when updating message catalo
Previous Message Dave Page 2021-07-05 08:10:46 Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure