diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py index 5ca2ae67a..4a8dd6cb0 100644 --- a/web/pgadmin/__init__.py +++ b/web/pgadmin/__init__.py @@ -503,15 +503,13 @@ def create_app(app_name=None): svr_discovery_id = inst_id svr_comment = gettext( "Auto-detected %s installation with the data " - "directory at %s" % ( + "directory at %s") % ( winreg.QueryValueEx( inst_key, 'Display Name' )[0], winreg.QueryValueEx( inst_key, 'Data Directory' - )[0] - ) - ) + )[0]) add_server( user_id, servergroup_id, svr_name, @@ -560,11 +558,10 @@ def create_app(app_name=None): description = description.decode('utf-8') data_directory = data_directory.decode('utf-8') svr_comment = gettext(u"Auto-detected %s installation " - u"with the data directory at %s" % ( + u"with the data directory at %s") % ( description, data_directory - ) - ) + ) add_server(user_id, servergroup_id, svr_name, svr_superuser, svr_port, svr_discovery_id, svr_comment) diff --git a/web/pgadmin/browser/register_browser_preferences.py b/web/pgadmin/browser/register_browser_preferences.py index 5f57f9fa1..2857fc7cd 100644 --- a/web/pgadmin/browser/register_browser_preferences.py +++ b/web/pgadmin/browser/register_browser_preferences.py @@ -39,14 +39,14 @@ def register_browser_preferences(self): gettext("Browser tree state saving interval"), 'integer', 30, category_label=gettext('Display'), help_str=gettext( - 'Browser tree state saving interval in seconds.' + 'Browser tree state saving interval in seconds. ' 'Use -1 to disable the tree saving mechanism.' ) ) self.preference.register( 'display', 'confirm_on_refresh_close', - gettext("Confirm on close or refresh ?"), 'boolean', + gettext("Confirm on close or refresh?"), 'boolean', True, category_label=gettext('Display'), help_str=gettext( 'Confirm closure or refresh of the browser or browser tab is ' @@ -56,7 +56,7 @@ def register_browser_preferences(self): self.preference.register( 'display', 'confirm_on_properties_close', - gettext("Confirm before Close/Reset in object properties dialog ?"), + gettext("Confirm before Close/Reset in object properties dialog?"), 'boolean', True, category_label=gettext('Display'), help_str=gettext( diff --git a/web/pgadmin/browser/server_groups/servers/__init__.py b/web/pgadmin/browser/server_groups/servers/__init__.py index 1a9eb6a8f..3b32cfcdb 100644 --- a/web/pgadmin/browser/server_groups/servers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/__init__.py @@ -741,8 +741,7 @@ class ServerNode(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) if 'hostaddr' in data and data['hostaddr'] and data['hostaddr'] != '': @@ -838,7 +837,7 @@ class ServerNode(PGChildNodeView): status=401, success=0, errormsg=gettext( - u"Unable to connect to server:\n\n%s" % errmsg) + u"Unable to connect to server:\n\n%s") % errmsg ) else: if 'save_password' in data and data['save_password'] and \ diff --git a/web/pgadmin/browser/server_groups/servers/databases/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/__init__.py index ebf7ae7ff..085ee35b6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/__init__.py @@ -175,7 +175,7 @@ class DatabaseView(PGChildNodeView): kwargs['sid'] ) if self.manager is None: - return gone(errormsg="Could not find the server.") + return gone(errormsg=_("Could not find the server.")) if action and action in ["drop"]: self.conn = self.manager.connection() @@ -567,8 +567,7 @@ class DatabaseView(PGChildNodeView): status=410, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) # The below SQL will execute CREATE DDL only SQL = render_template( diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py index 99315a3e7..503192cb2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/casts/__init__.py @@ -368,8 +368,7 @@ class CastView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) try: sql = render_template("/".join([self.template_path, 'create.sql']), @@ -668,8 +667,8 @@ class CastView(PGChildNodeView): if res is None: return gone(gettext( - "Could not generate reversed engineered SQL for the cast \ - node." + "Could not generate reversed engineered SQL for the " + "cast node." )) return ajax_response(response=res) diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py index 369606952..42da4cfc4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py @@ -378,8 +378,7 @@ class EventTriggerView(PGChildNodeView): status=400, success=0, errormsg=gettext( - "Could not find the required parameter %s." % err - ) + "Could not find the required parameter %s.") % err ) try: sql = render_template( @@ -637,8 +636,7 @@ class EventTriggerView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter %s." % err - ) + "Could not find the required parameter %s.") % err ) sql = render_template( "/".join([self.template_path, 'create.sql']), diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py index 2339914d8..9605b9b4a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/__init__.py @@ -262,8 +262,7 @@ class ExtensionView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) status, res = self.conn.execute_dict( diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py index f6def506e..e5bf06357 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py @@ -393,8 +393,7 @@ class ForeignDataWrapperView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) try: diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py index 90487dff3..66fcf424b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py @@ -388,8 +388,7 @@ class ForeignServerView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) try: if 'fsrvacl' in data: diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js index 8b6427850..ad6f1f76b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js @@ -36,7 +36,7 @@ define('pgadmin.node.foreign_server', [ if (_.isUndefined(this.get('fsrvoption')) || _.isNull(this.get('fsrvoption')) || String(this.get('fsrvoption')).replace(/^\s+|\s+$/g, '') == '') { - var msg = 'Please enter an option name'; + var msg = gettext('Please enter an option name.'); this.errorModel.set('fsrvoption', msg); return msg; } else { diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/__init__.py index ee7648fd4..47e55570a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/__init__.py @@ -396,8 +396,7 @@ class UserMappingView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) try: diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/static/js/user_mapping.js b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/static/js/user_mapping.js index 39e0726b2..400a6722f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/static/js/user_mapping.js +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/static/js/user_mapping.js @@ -39,7 +39,7 @@ define('pgadmin.node.user_mapping', [ if (_.isUndefined(this.get('umoption')) || _.isNull(this.get('umoption')) || String(this.get('umoption')).replace(/^\s+|\s+$/g, '') == '') { - var msg = 'Please enter an option name'; + var msg = gettext('Please enter an option name.'); this.errorModel.set('umoption', msg); return msg; } else { diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js index f79a72da2..ff412dcbc 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js @@ -37,7 +37,7 @@ define('pgadmin.node.foreign_data_wrapper', [ if (_.isUndefined(this.get('fdwoption')) || _.isNull(this.get('fdwoption')) || String(this.get('fdwoption')).replace(/^\s+|\s+$/g, '') == '') { - var msg = 'Please enter an option name'; + var msg = gettext('Please enter an option name.'); this.errorModel.set('fdwoption', msg); return msg; } else { diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py index 341743c57..77f22e6fa 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py @@ -453,8 +453,7 @@ class LanguageView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) try: diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py index f9bffb76f..38cdec02c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py @@ -136,7 +136,7 @@ def check_precondition(f): kwargs['sid'] ) if not self.manager: - return gone(errormsg="Could not find the server.") + return gone(errormsg=gettext("Could not find the server.")) self.conn = self.manager.connection(did=kwargs['did']) # Set the template path for the SQL scripts @@ -570,9 +570,8 @@ It may have been removed by another user. status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % - required_args[arg] - ) + "Could not find the required parameter (%s).") % + required_args[arg] ) try: self.format_request_acls(data) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py index 34227cd11..8cf703987 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/__init__.py @@ -458,8 +458,7 @@ class CollationView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) if self._check_definition(data): return make_json_response( diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py index 6bf03e8ef..bd7153c0e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py @@ -216,10 +216,8 @@ class DomainView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % - arg - ) - ) + "Could not find the required parameter (%s).") + % arg) try: list_params = [] diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py index 87083f34d..fca3e200a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py @@ -260,10 +260,8 @@ class ForeignTableView(PGChildNodeView, DataTypeReader, status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % - arg - ) - ) + "Could not find the required parameter (%s).") + % arg) try: list_params = [] diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py index 7065c6630..362f7c6ce 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py @@ -422,8 +422,7 @@ class FtsConfigurationView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) # Either copy config or parser must be present in data diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py index 6b8232f07..a7eea04d7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/__init__.py @@ -431,7 +431,7 @@ class FtsDictionaryView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg) + "Could not find the required parameter (%s).") % arg ) # Fetch schema name from schema oid sql = render_template( diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/__init__.py index d4a1151f6..b79b6ef5b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/__init__.py @@ -379,8 +379,7 @@ class FtsParserView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) # Fetch schema name from schema oid sql = render_template( @@ -850,7 +849,7 @@ class FtsParserView(PGChildNodeView, SchemaDiffObjectCompare): return gone( _( "Could not generate reversed engineered query for " - "FTS Parser node" + "FTS Parser node." ) ) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py index 7032682f1..4d61e8dcb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/__init__.py @@ -354,8 +354,7 @@ class FtsTemplateView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) # Fetch schema name from schema oid sql = render_template("/".join([self.template_path, 'schema.sql']), diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py index 7e12863a6..a57de1d1a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/__init__.py @@ -277,10 +277,8 @@ class FunctionView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % - arg - ) - ) + "Could not find the required parameter (%s).") + % arg) list_params = [] if request.method == 'GET': diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py index e26de7c82..1f2bdc73e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/__init__.py @@ -379,8 +379,7 @@ class PackageView(PGChildNodeView, SchemaDiffObjectCompare): status=400, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) data['schema'] = self.schema @@ -557,9 +556,8 @@ class PackageView(PGChildNodeView, SchemaDiffObjectCompare): status=400, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg - ) - ) + "Could not find the required parameter (%s).") + % arg) SQL, name = self.getSQL(gid, sid, did, data, scid, pkgid) # Most probably this is due to error diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py index 6328de605..b33a7699b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py @@ -381,8 +381,7 @@ class SequenceView(PGChildNodeView, SchemaDiffObjectCompare): status=400, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) try: @@ -590,9 +589,8 @@ class SequenceView(PGChildNodeView, SchemaDiffObjectCompare): status=400, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg - ) - ) + "Could not find the required parameter (%s).") + % arg) SQL, name = self.getSQL(gid, sid, did, data, scid, seid) # Most probably this is due to error if not isinstance(SQL, (str, unicode)): diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py index 648fe401e..b50f50162 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/__init__.py @@ -450,8 +450,7 @@ class SynonymView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) try: diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py index e000076c0..bea7b33f4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py @@ -908,8 +908,7 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings, status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) # Parse privilege data coming from client according to database format @@ -1578,7 +1577,7 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings, return make_json_response( status=200, - info=gettext("Table rows counted: %s" % count), + info=gettext("Table rows counted: %s") % count, data={'total_rows': count} ) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py index 472a371de..280958a98 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py @@ -392,9 +392,8 @@ class ColumnsView(PGChildNodeView, DataTypeReader): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % - required_args[arg] - ) + "Could not find the required parameter (%s).") % + required_args[arg] ) # Parse privilege data coming from client according to database format diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/__init__.py index 0d2416245..553d06c31 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/__init__.py @@ -511,9 +511,8 @@ class CompoundTriggerView(PGChildNodeView, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % - required_args[arg] - ) + "Could not find the required parameter (%s).") % + required_args[arg] ) # Adding parent into data dict, will be using it while creating sql @@ -904,8 +903,8 @@ class CompoundTriggerView(PGChildNodeView, SchemaDiffObjectCompare): if not status: return internal_server_error(errormsg=res) if len(res['rows']) == 0: - return gone(gettext("""Could not find the compound - trigger in the table.""")) + return gone(gettext("Could not find the compound " + "trigger in the table.")) data = dict(res['rows'][0]) # Adding parent into data dict, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/static/js/compound_trigger.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/static/js/compound_trigger.js index 8b54f6d5d..3cb8d7969 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/static/js/compound_trigger.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/static/js/compound_trigger.js @@ -194,10 +194,10 @@ define('pgadmin.node.compound_trigger', [ return false; }, options: [ - {label: 'Enable', value: 'O'}, - {label: 'Enable Replica', value: 'R'}, - {label: 'Enable Always', value: 'A'}, - {label: 'Disable', value: 'D'}, + {label: gettext('Enable'), value: 'O'}, + {label: gettext('Enable Replica'), value: 'R'}, + {label: gettext('Enable Always'), value: 'A'}, + {label: gettext('Disable'), value: 'D'}, ], control: 'select2', select2: { allowClear: false, width: '100%' }, },{ diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py index 484e7dcce..2f1ba57bb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py @@ -476,8 +476,7 @@ class CheckConstraintView(PGChildNodeView): status=400, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) data['schema'] = self.schema diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/__init__.py index 96045bac1..ab3ee6ab5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/__init__.py @@ -496,16 +496,14 @@ class ExclusionConstraintView(PGChildNodeView): status=400, success=0, errormsg=_( - "Could not find required parameter (%s)." % str(arg) - ) + "Could not find required parameter (%s).") % str(arg) ) elif isinstance(data[arg], list) and len(data[arg]) < 1: return make_json_response( status=400, success=0, errormsg=_( - "Could not find required parameter (%s)." % str(arg) - ) + "Could not find required parameter (%s).") % str(arg) ) data['schema'] = self.schema diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/__init__.py index 6a3d70afe..3bd124ed6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/__init__.py @@ -506,16 +506,14 @@ class ForeignKeyConstraintView(PGChildNodeView): status=400, success=0, errormsg=_( - "Could not find required parameter (%s)." % str(arg) - ) + "Could not find required parameter (%s).") % str(arg) ) elif isinstance(data[arg], list) and len(data[arg]) < 1: return make_json_response( status=400, success=0, errormsg=_( - "Could not find required parameter (%s)." % str(arg) - ) + "Could not find required parameter (%s).") % str(arg) ) data['schema'] = self.schema diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py index 4b0a0918c..05c5f84d1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py @@ -287,9 +287,10 @@ class IndexConstraintView(PGChildNodeView): return res if len(res) == 0: - return gone(_("""Could not find the {} in the table.""".format( - "primary key" if self.constraint_type == "p" else "unique key" - ))) + return gone(_("""Could not find the {} in the table.""").format( + _("primary key") if self.constraint_type == "p" + else _("unique key") + )) result = res if cid: @@ -386,9 +387,10 @@ class IndexConstraintView(PGChildNodeView): return internal_server_error(errormsg=rset) if len(rset['rows']) == 0: - return gone(_("""Could not find the {} in the table.""".format( - "primary key" if self.constraint_type == "p" else "unique key" - ))) + return gone(_("""Could not find the {} in the table.""").format( + _("primary key") if self.constraint_type == "p" + else _("unique key") + )) res = self.blueprint.generate_browser_node( rset['rows'][0]['oid'], @@ -533,8 +535,7 @@ class IndexConstraintView(PGChildNodeView): success=0, errormsg=_( "Could not find at least one required " - "parameter (%s)." % str(param) - ) + "parameter (%s).") % str(param) ) elif arg not in data: @@ -542,8 +543,7 @@ class IndexConstraintView(PGChildNodeView): status=400, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) data['schema'] = self.schema @@ -824,9 +824,10 @@ class IndexConstraintView(PGChildNodeView): if not status: return internal_server_error(errormsg=res) if len(res['rows']) == 0: - return gone(_("""Could not find the {} in the table.""".format( - "primary key" if self.constraint_type == "p" else "unique key" - ))) + return gone(_("""Could not find the {} in the table.""").format( + _("primary key") if self.constraint_type == "p" + else _("unique key") + )) data = res['rows'][0] data['schema'] = self.schema @@ -916,10 +917,10 @@ class IndexConstraintView(PGChildNodeView): return internal_server_error(errormsg=res) if len(res['rows']) == 0: return gone( - _("""Could not find the {} in the table.""".format( - "primary key" if self.constraint_type == "p" - else "unique key" - )) + _("""Could not find the {} in the table.""").format( + _("primary key") if self.constraint_type == "p" + else _("unique key") + ) ) result = res['rows'][0] diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js index dad06e2f9..812618490 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js @@ -649,7 +649,7 @@ define('pgadmin.node.primary_key', [ if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') && (_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) { - var msg = gettext('Please specify columns for %s', gettext('Primary key')); + var msg = gettext('Please specify columns for %s.', gettext('Primary key')); this.errorModel.set('columns', msg); return msg; } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js index a03b8a165..cc7472eac 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js @@ -638,7 +638,7 @@ define('pgadmin.node.unique_constraint', [ if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') && (_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) { - var msg = gettext('Please specify columns for %s', gettext('Unique constraint')); + var msg = gettext('Please specify columns for %s.', gettext('Unique constraint')); this.errorModel.set('columns', msg); return msg; } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py index 23709d6d5..c68804520 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/__init__.py @@ -576,11 +576,12 @@ class IndexesView(PGChildNodeView, SchemaDiffObjectCompare): for arg in required_args: err_msg = None if arg == 'columns' and len(data['columns']) < 1: - err_msg = "You must provide one or more column to create index" + err_msg = gettext("You must provide one or more column to " + "create index.") if arg not in data: - err_msg = "Could not find the required parameter (%s)." % \ - required_args[arg] + err_msg = gettext("Could not find the required parameter (%s)" + ".") % required_args[arg] # Check if we have at least one column if err_msg is not None: return make_json_response( diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js index 928342895..9ce744cfa 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js @@ -60,12 +60,12 @@ function( pgBrowser.add_menus([{ name: 'truncate_table', node: 'partition', module: this, applies: ['object', 'context'], callback: 'truncate_table', - category: 'Truncate', priority: 3, label: gettext('Truncate'), + category: gettext('Truncate'), priority: 3, label: gettext('Truncate'), icon: 'fa fa-eraser', enable : 'canCreate', },{ name: 'truncate_table_cascade', node: 'partition', module: this, applies: ['object', 'context'], callback: 'truncate_table_cascade', - category: 'Truncate', priority: 3, label: gettext('Truncate Cascade'), + category: gettext('Truncate'), priority: 3, label: gettext('Truncate Cascade'), icon: 'fa fa-eraser', enable : 'canCreate', },{ // To enable/disable all triggers for the table diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js index a4e6f4ede..5ffed4617 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js @@ -196,10 +196,10 @@ define('pgadmin.node.trigger', [ return false; }, options: [ - {label: 'Enable', value: 'O'}, - {label: 'Enable Replica', value: 'R'}, - {label: 'Enable Always', value: 'A'}, - {label: 'Disable', value: 'D'}, + {label: gettext('Enable'), value: 'O'}, + {label: gettext('Enable Replica'), value: 'R'}, + {label: gettext('Enable Always'), value: 'A'}, + {label: gettext('Disable'), value: 'D'}, ], control: 'select2', select2: { allowClear: false, width: '100%' }, },{ diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py index 8512a9b9b..cc1c3d1d8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py @@ -946,9 +946,8 @@ class TypeView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % - required_args[arg] - ) + "Could not find the required parameter (%s).") % + required_args[arg] ) # Additional checks goes here # If type is range then check if subtype is defined or not diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js index 8babb2bbd..17a7b84aa 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js @@ -218,9 +218,9 @@ define('pgadmin.node.type', [ else if (this.get('is_tlength') && !_.isUndefined(this.get('tlength'))) { if (this.get('tlength') < this.get('min_val')) - errmsg = gettext('Length/Precision should not be less than %s', this.get('min_val')); + errmsg = gettext('Length/Precision should not be less than %s.', this.get('min_val')); if (this.get('tlength') > this.get('max_val') ) - errmsg = gettext('Length/Precision should not be greater than %s', this.get('max_val')); + errmsg = gettext('Length/Precision should not be greater than %s.', this.get('max_val')); // If we have any error set then throw it to user if(errmsg) { this.errorModel.set('tlength', errmsg); @@ -231,9 +231,9 @@ define('pgadmin.node.type', [ else if (this.get('is_precision') && !_.isUndefined(this.get('precision'))) { if (this.get('precision') < this.get('min_val')) - errmsg = gettext('Scale should not be less than %s', this.get('min_val')); + errmsg = gettext('Scale should not be less than %s.', this.get('min_val')); if (this.get('precision') > this.get('max_val')) - errmsg = gettext('Scale should not be greater than %s', this.get('max_val')); + errmsg = gettext('Scale should not be greater than %s.', this.get('max_val')); // If we have any error set then throw it to user if(errmsg) { this.errorModel.set('precision', errmsg); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py index 28c445c48..aa03b02b0 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py @@ -493,8 +493,7 @@ class ViewNode(PGChildNodeView, VacuumSettings, SchemaDiffObjectCompare): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) try: SQL, nameOrError = self.getSQL(gid, sid, did, scid, data) diff --git a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js index 5dfed1abb..297116d24 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js +++ b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js @@ -190,7 +190,7 @@ define('pgadmin.node.database', [ Alertify.confirm( gettext('Disconnect the database'), - pgadminUtils.sprintf(gettext('Are you sure you want to disconnect the database - %s?'), d.label), + gettext('Are you sure you want to disconnect the database - %s?', d.label), function() { var data = d; $.ajax({ @@ -228,7 +228,11 @@ define('pgadmin.node.database', [ t.unload(i); }); }, - function() { return true; }); + function() { return true; } + ).set('labels', { + ok: gettext('Yes'), + cancel: gettext('No'), + }); return false; }, diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/__init__.py b/web/pgadmin/browser/server_groups/servers/pgagent/__init__.py index 08ca3dc99..28a8e5901 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/pgagent/__init__.py @@ -284,8 +284,7 @@ SELECT EXISTS( status=410, success=0, errormsg=_( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) status, res = self.conn.execute_void('BEGIN') diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js index 5f42d75d0..4df8e0517 100644 --- a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js +++ b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js @@ -305,7 +305,7 @@ define('pgadmin.node.pga_jobstep', [ !_.isUndefined(val) && !_.isNull(val) && String(val).replace(/^\s+|\s+$/g, '') == '' ) { - msg = gettext('Please select valid on error option .'); + msg = gettext('Please select valid on error option.'); this.errorModel.set('jstonerror', msg); } else { this.errorModel.unset('jstonerror'); diff --git a/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py b/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py index 337e55cc4..24d3206ad 100644 --- a/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py @@ -363,8 +363,7 @@ class ResourceGroupView(NodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % arg - ) + "Could not find the required parameter (%s).") % arg ) try: # Below logic will create new resource group diff --git a/web/pgadmin/browser/server_groups/servers/static/js/variable.js b/web/pgadmin/browser/server_groups/servers/static/js/variable.js index 981582945..b99e709e4 100644 --- a/web/pgadmin/browser/server_groups/servers/static/js/variable.js +++ b/web/pgadmin/browser/server_groups/servers/static/js/variable.js @@ -203,7 +203,7 @@ function(gettext, _, $, Backbone, Backform, Backgrid, Alertify, pgAdmin, pgNode) } else if (_.isUndefined(this.get('value')) || _.isNull(this.get('value')) || String(this.get('value')).replace(/^\s+|\s+$/g, '') == '') { - msg = ('Please enter a value for the parameter.'); + msg = gettext('Please enter a value for the parameter.'); this.errorModel.set('value', msg); this.errorModel.unset('name'); } else { diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/__init__.py b/web/pgadmin/browser/server_groups/servers/tablespaces/__init__.py index 62436aa88..73e81e1b1 100644 --- a/web/pgadmin/browser/server_groups/servers/tablespaces/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/tablespaces/__init__.py @@ -295,9 +295,8 @@ class TablespaceView(PGChildNodeView): status=410, success=0, errormsg=gettext( - "Could not find the required parameter (%s)." % - required_args[arg] - ) + "Could not find the required parameter (%s).") % + required_args[arg] ) # To format privileges coming from client diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js b/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js index e328eb770..fe214d4b1 100644 --- a/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js +++ b/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js @@ -261,7 +261,7 @@ define('pgadmin.node.tablespace', [ self.__internal.buttons[2].element.disabled = false; } else { self.__internal.buttons[2].element.disabled = true; - this.errorModel.set('tblspc', gettext('Please select tablespace')); + this.errorModel.set('tblspc', gettext('Please select tablespace.')); } }); }, diff --git a/web/pgadmin/browser/server_groups/servers/types.py b/web/pgadmin/browser/server_groups/servers/types.py index ba7d23fbe..2cc0cd251 100644 --- a/web/pgadmin/browser/server_groups/servers/types.py +++ b/web/pgadmin/browser/server_groups/servers/types.py @@ -74,7 +74,7 @@ class ServerType(object): return self.spriority def __str__(self): - return "Type: {0}, Description:{1}, Priority: {2}".format( + return _("Type: {0}, Description: {1}, Priority: {2}").format( self.stype, self.desc, self.spriority ) @@ -115,9 +115,9 @@ class ServerType(object): res = 'psql' else: raise Exception( - _("Could not find the utility for the operation '%s'".format( + _("Could not find the utility for the operation '%s'").format( operation - )) + ) ) bin_path = self.utility_path.get() if "$DIR" in bin_path: diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js index e8ac4afef..ed54c3ccb 100644 --- a/web/pgadmin/browser/static/js/browser.js +++ b/web/pgadmin/browser/static/js/browser.js @@ -623,7 +623,7 @@ define('pgadmin.browser', [ Alertify.confirm(gettext('Reset Master Password'), gettext('This will remove all the saved passwords. This will also remove established connections to ' - + 'the server and you may need to reconnect again. Do you wish to continue ?'), + + 'the server and you may need to reconnect again. Do you wish to continue?'), function() { /* If user clicks Yes */ self.reset_master_password(); diff --git a/web/pgadmin/browser/static/js/collection.js b/web/pgadmin/browser/static/js/collection.js index a3c9ad96e..7a2785f20 100644 --- a/web/pgadmin/browser/static/js/collection.js +++ b/web/pgadmin/browser/static/js/collection.js @@ -179,7 +179,7 @@ define([