String improvements.

pull/3/head
Dave Page 2016-06-17 14:21:14 +01:00
parent bc4703c5b7
commit fd6c43b393
6 changed files with 30 additions and 30 deletions

View File

@ -56,8 +56,8 @@ class BGProcessModule(PgAdminModule):
'STATUS': _('Status'),
'EXECUTION_TIME': _('Execution time'),
'running': _('Running...'),
'successfully_finished': _("Successfully Finished!"),
'failed_with_exit_code': _("Failed (Exit code: %%s).")
'successfully_finished': _("Successfully completed."),
'failed_with_exit_code': _("Failed (exit code: %%s).")
}
# Initialise the module
@ -69,7 +69,7 @@ blueprint = BGProcessModule(
@blueprint.route('/')
@login_required
def index():
return bad_request(errormsg=_('User can not call this url directly'))
return bad_request(errormsg=_('This URL can not be called directly.'))
@blueprint.route('/status/<pid>/', methods=['GET'])

View File

@ -209,7 +209,7 @@ def read_configs(data):
else:
return None
else:
raise ValueError("Please verify process id and db_file arguments")
raise ValueError("Please verify pid and db_file arguments.")
def update_configs(kwargs):
@ -246,7 +246,7 @@ def update_configs(kwargs):
# Commit & close cursor
conn.close()
else:
raise ValueError("Please verify pid and db_file arguments")
raise ValueError("Please verify pid and db_file arguments.")
def execute(configs):
@ -360,13 +360,13 @@ def execute(configs):
process_stdout = None
else:
raise ValueError("Please verify configs")
raise ValueError("Please verify process configs.")
if __name__ == '__main__':
# Read command line arguments
parser = argparse.ArgumentParser(
description='Process executor for pgAdmin4'
description='Process executor for pgAdmin 4'
)
parser.add_argument(
'-p', '--process_id', help='Process ID', required=True

View File

@ -73,7 +73,7 @@ class BatchProcess(object):
if p is None:
raise LookupError(gettext(
"Couldn't find the process specified by the id!"
"Could not find a process with the specified ID."
))
# ID
@ -170,9 +170,9 @@ class BatchProcess(object):
def start(self):
if self.stime is not None:
if self.etime is None:
raise Exception(gettext('Process has already been started!'))
raise Exception(gettext('The process has already been started.'))
raise Exception(gettext(
'Process has already been finished, it can not be restared!'
'The process has already finished and can not be restarted.'
))
executor = os.path.join(
@ -351,7 +351,7 @@ class BatchProcess(object):
if p is None:
raise LookupError(gettext(
"Couldn't find the process specified by the id!"
"Could not find a process with the specified ID."
))
if _release:

View File

@ -584,14 +584,14 @@ class Filemanager(object):
oldpath_sys = "{0}{1}".format(dir, old)
newpath_sys = "{0}{1}".format(dir, newpath)
error_msg = gettext('Renamed Successfully.')
error_msg = gettext('Renamed successfully.')
code = 1
try:
os.rename(oldpath_sys, newpath_sys)
code = 0
except Exception as e:
error_msg = "{0} - {1}".format(
gettext('There was an error renaming the file.'),
error_msg = "{0} {1}".format(
gettext('There was an error renaming the file:'),
str(e))
result = {

View File

@ -97,17 +97,17 @@ class BackupMessage(IProcessDesc):
if self.backup_type == BACKUP.OBJECT:
return _(
"Backing up an object on the server - '{0}' on database '{1}'..."
"Backing up an object on the server '{0}' from database '{1}'..."
).format(
"{0} ({1}:{2})".format(s.name, s.host, s.port),
self.database
)
if self.backup_type == BACKUP.GLOBALS:
return _("Backing up the globals for the server - '{0}'...").format(
return _("Backing up the global objects on the server - '{0}'...").format(
"{0} ({1}:{2})".format(s.name, s.host, s.port)
)
elif self.backup_type == BACKUP.SERVER:
return _("Backing up the server - '{0}'...").format(
return _("Backing up the server '{0}'...").format(
"{0} ({1}:{2})".format(s.name, s.host, s.port)
)
else:
@ -125,7 +125,7 @@ class BackupMessage(IProcessDesc):
if self.backup_type == BACKUP.OBJECT:
res += html.safe_str(
_(
"Backing up an object on the server - '{0}' on database '{1}'"
"Backing up an object on the server '{0}' from database '{1}'..."
).format(
"{0} ({1}:{2})".format(s.name, s.host, s.port),
self.database
@ -133,13 +133,13 @@ class BackupMessage(IProcessDesc):
)
if self.backup_type == BACKUP.GLOBALS:
res += html.safe_str(
_("Backing up the globals for the server - '{0}'").format(
_("Backing up the global objects on the server '{0}'").format(
"{0} ({1}:{2})".format(s.name, s.host, s.port)
)
)
elif self.backup_type == BACKUP.SERVER:
res += html.safe_str(
_("Backing up the server - '{0}'").format(
_("Backing up the server '{0}'").format(
"{0} ({1}:{2})".format(s.name, s.host, s.port)
)
)
@ -185,7 +185,7 @@ class BackupMessage(IProcessDesc):
@blueprint.route("/")
@login_required
def index():
return bad_request(errormsg=_("This URL can not be called directly!"))
return bad_request(errormsg=_("This URL can not be called directly."))
@blueprint.route("/backup.js")
@ -247,7 +247,7 @@ def create_backup_job(sid):
if server is None:
return make_json_response(
success=0,
errormsg=_("Couldn't find the given server")
errormsg=_("Could not find the specified server.")
)
# To fetch MetaData for the server
@ -260,7 +260,7 @@ def create_backup_job(sid):
if not connected:
return make_json_response(
success=0,
errormsg=_("Please connect to the server first...")
errormsg=_("Please connect to the server first.")
)
utility = manager.utility('backup_server')
@ -341,7 +341,7 @@ def create_backup_objects_job(sid):
if server is None:
return make_json_response(
success=0,
errormsg=_("Couldn't find the given server")
errormsg=_("Could not find the specified server.")
)
# To fetch MetaData for the server
@ -354,7 +354,7 @@ def create_backup_objects_job(sid):
if not connected:
return make_json_response(
success=0,
errormsg=_("Please connect to the server first...")
errormsg=_("Please connect to the server first.")
)
utility = manager.utility('backup')

View File

@ -69,7 +69,7 @@ class RestoreMessage(IProcessDesc):
id=self.sid, user_id=current_user.id
).first()
return _("Restoring backup on the server - '{0}'").format(
return _("Restoring backup on the server '{0}'...").format(
"{0} ({1}:{2})".format(s.name, s.host, s.port),
)
@ -83,7 +83,7 @@ class RestoreMessage(IProcessDesc):
res += html.safe_str(
_(
"Restoring the backup on the server - '{0}'"
"Restoring the backup on the server '{0}'..."
).format(
"{0} ({1}:{2})".format(s.name, s.host, s.port)
)
@ -127,7 +127,7 @@ class RestoreMessage(IProcessDesc):
@blueprint.route("/")
@login_required
def index():
return bad_request(errormsg=_("This URL can not be called directly!"))
return bad_request(errormsg=_("This URL can not be called directly."))
@blueprint.route("/restore.js")
@ -189,7 +189,7 @@ def create_restore_job(sid):
if server is None:
return make_json_response(
success=0,
errormsg=_("Couldn't find the given server")
errormsg=_("Could not find the specified server")
)
# To fetch MetaData for the server
@ -203,7 +203,7 @@ def create_restore_job(sid):
if not connected:
return make_json_response(
success=0,
errormsg=_("Please connect to the server first...")
errormsg=_("Please connect to the server first.")
)
utility = manager.utility('restore')