pgadmin4 l10n issues

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: pgadmin4 l10n issues
Date: 2017-10-19 05:08:09
Message-ID: 5c7914c8-db5f-cb70-a81e-6e9145039935@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hello,

I would like to to add Russian translation to pgAdmin 4, but having
complete messages.po, I get incomplete UI translation.
(See ss1.png attached.)
I found two issues with the i18n in the current master.
The first one is with web/pgadmin/tools/templates/js/translations.js.
I don't understand why, but commit 4a91bcde makes the function return an
empty array instead of translations.
Patch for fixing it is attached.

The second one is more complex and related to get_locale() method. This
method is called when first gettext() invoked and it occurs on early
stage, where the Preference module 'miscellaneous' is not registered
yet. To be precise, first call to gettext() occurs when registering the
'Browser' module. But even if MiscModule will register first, it had to
call  _('Miscellaneous') before it gets registered.
So I propose to implement some way to get current language when the misc
preference module is not registered. Please look at the proposed patch.

After these two fixes I get (almost) complete Russian interface (See
ss2.png attached.)
(May be some more strings should be made localizeable, but that is
another question.)

------
Alexander Lakhin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
ss1.png image/png 74.2 KB
ss2.png image/png 76.6 KB
fix-get_locale.patch text/x-patch 1.7 KB
fix-js-translations.patch text/x-patch 582 bytes

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2017-10-19 13:13:01 Re: pgadmin4 l10n issues
Previous Message pgAdmin 4 Jenkins 2017-10-16 15:36:18 Build failed in Jenkins: pgadmin4-master-python33 #356