Hi, Please find the attached updated patch.
Thanks, Khushboo On Sat, Apr 1, 2017 at 12:12 PM, Dave Page <dp...@pgadmin.org> wrote: > Hi > > > On Friday, March 31, 2017, Khushboo Vashi <khushboo.va...@enterprisedb.com> > wrote: > >> Hi, >> >> On Mon, Mar 27, 2017 at 9:57 PM, Dave Page <dp...@pgadmin.org> wrote: >> >>> On Mon, Mar 27, 2017 at 7:49 AM, Khushboo Vashi >>> <khushboo.va...@enterprisedb.com> wrote: >>> > Hi Dave, >>> > >>> > I have fixed the issue and the patch for the same is attached, but the >>> > Binary path options are not translated properly. >>> >>> Thanks - committed. >>> >>> > We register the preferences before the first request of the app. In >>> this >>> > case we don't have any language loaded, so it will take only English. >>> > To fix this issue, I had explicitly added gettext for the labels and >>> help >>> > messages while opening the Preference dialogue. >>> > All the labels and help messages render properly except Binary paths; >>> as at >>> > run time we don't get the translation of 'EDB Advanced Server Binary >>> Path'. >>> > We have translations like below: >>> > >>> > #: pgadmin/browser/server_groups/servers/types.py:59 >>> > msgid "{0} Binary Path" >>> > msgstr "Ścieżka Binarna {0}" >>> > >>> > So, in this case my suggestion is to have the entire label/help >>> messages >>> > translations. >>> > So, that the Preference dialogue can translate run time. >>> >>> I'm fine with that; however, the strings should come from the >>> underlying drivers of course, as only they should have specific >>> knowledge of details such as the name of the database server they >>> provide access to. >>> >>> The string always comes from drivers as they are being registered from >> there. >> I have attached the patch to translate the entire string. >> I took the reference of the string from the messages.po file and >> translated, so someone has to validate that this is the correct translation. >> > > All I see in the patch is updates to the message catalog. It seems to me > there should be chunks in there to push the entire string back into the > relevant driver, otherwise the changes to the messages.po files will be > overwritten the next time I do an extract/merge. > > Essentially, I think we need to add properties to the drivers, such as: > > BIN_PATH_LABEL = _("PostgreSQL Binary Path") > BIN_PATH_HELP = _("Path to the directory containing the PostgreSQL utility > programs (pg_dump, pg_restore etc).") > > Then in types.py, we'd have something like: > > st.utility_path = paths.register( > 'bin_paths', st.stype + '_bin_dir', > st.BIN_PATH_LABEL, > 'text', default_path, category_label=_('Binary paths'), > help_str=st.BIN_PATH_HELP > ) > ) > > Fixed > Thanks. > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > >
diff --git a/web/pgadmin/browser/server_groups/servers/ppas.py b/web/pgadmin/browser/server_groups/servers/ppas.py index fe58d12..56f9322 100644 --- a/web/pgadmin/browser/server_groups/servers/ppas.py +++ b/web/pgadmin/browser/server_groups/servers/ppas.py @@ -12,6 +12,12 @@ from pgadmin.browser.server_groups.servers.types import ServerType class PPAS(ServerType): + UTILITY_PATH_LABEL = gettext("EDB Advanced Server Binary Path") + UTILITY_PATH_HELP = gettext( + "Path to the directory containing the EDB Advanced Server utility" + " programs (pg_dump, pg_restore etc)." + ) + def instanceOf(self, ver): return ver.startswith("EnterpriseDB") diff --git a/web/pgadmin/browser/server_groups/servers/types.py b/web/pgadmin/browser/server_groups/servers/types.py index 7f73263..b85fd3a 100644 --- a/web/pgadmin/browser/server_groups/servers/types.py +++ b/web/pgadmin/browser/server_groups/servers/types.py @@ -25,6 +25,11 @@ class ServerType(object): identification based on the version. """ registry = dict() + UTILITY_PATH_LABEL = _("PostgreSQL Binary Path") + UTILITY_PATH_HELP = _( + "Path to the directory containing the PostgreSQL utility programs" + " (pg_dump, pg_restore etc)." + ) def __init__(self, server_type, description, priority): self.stype = server_type @@ -53,14 +58,9 @@ class ServerType(object): st.utility_path = paths.register( 'bin_paths', st.stype + '_bin_dir', - _("{0} Binary Path").format(st.desc), + st.UTILITY_PATH_LABEL, 'text', default_path, category_label=_('Binary paths'), - help_str=_( - "Path to the directory containing the {0} utility" - " programs (pg_dump, pg_restore etc).".format( - st.desc - ) - ) + help_str=st.UTILITY_PATH_HELP ) @property
-- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers