From a3007b7335d73cb2042cf4b2d3939b69ae4bcaac Mon Sep 17 00:00:00 2001 From: Khushboo Vashi Date: Tue, 18 Apr 2017 13:33:27 +0100 Subject: [PATCH] Ensure database driver names and description strings can be translated. Fixes #2190 --- web/pgadmin/browser/server_groups/servers/ppas.py | 6 ++++++ web/pgadmin/browser/server_groups/servers/types.py | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/ppas.py b/web/pgadmin/browser/server_groups/servers/ppas.py index fe58d12f2..56f9322a5 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 7f7326312..b85fd3a39 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