mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
First round of string review and cleanup.
This commit is contained in:
committed by
Dave Page
parent
894002b06d
commit
949e536bae
@@ -240,7 +240,7 @@ class DatabaseView(PGChildNodeView):
|
||||
status=200
|
||||
)
|
||||
|
||||
return gone(errormsg=_("Couldn't find the database in the server!"))
|
||||
return gone(errormsg=_("Could not find the database on the server."))
|
||||
|
||||
|
||||
@check_precondition(action="properties")
|
||||
@@ -342,7 +342,7 @@ class DatabaseView(PGChildNodeView):
|
||||
|
||||
return make_json_response(
|
||||
success=1,
|
||||
info=_("Database Connected."),
|
||||
info=_("Database connected."),
|
||||
data={
|
||||
'icon': 'pg-icon-database',
|
||||
'connected': True
|
||||
@@ -359,11 +359,11 @@ class DatabaseView(PGChildNodeView):
|
||||
status = manager.release(did=did)
|
||||
|
||||
if not status:
|
||||
return unauthorized(_("Database Could Not Disconnect."))
|
||||
return unauthorized(_("Database could not be disconnected."))
|
||||
else:
|
||||
return make_json_response(
|
||||
success=1,
|
||||
info=_("Database Disconnected."),
|
||||
info=_("Database disconnected."),
|
||||
data={
|
||||
'icon': 'icon-database-not-connected',
|
||||
'connected': False
|
||||
@@ -443,7 +443,7 @@ class DatabaseView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=_(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
try:
|
||||
@@ -526,7 +526,7 @@ class DatabaseView(PGChildNodeView):
|
||||
|
||||
if len(rset['rows']) == 0:
|
||||
return gone(
|
||||
_("Couldn't find the database on the server!")
|
||||
_("Couldnot find the database on the server.")
|
||||
)
|
||||
|
||||
data['old_name'] = (rset['rows'][0])['name']
|
||||
@@ -663,7 +663,7 @@ class DatabaseView(PGChildNodeView):
|
||||
|
||||
if len(rset['rows']) == 0:
|
||||
return False, gone(
|
||||
_("Couldn't find the database on the server!")
|
||||
_("Could not find the database on the server.")
|
||||
)
|
||||
|
||||
data['old_name'] = (rset['rows'][0])['name']
|
||||
|
||||
@@ -349,7 +349,7 @@ class CastView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
try:
|
||||
@@ -616,14 +616,14 @@ class CastView(PGChildNodeView):
|
||||
status, res = self.conn.execute_scalar(sql)
|
||||
if not status:
|
||||
return internal_server_error(
|
||||
_("ERROR: Couldn't generate reversed engineered SQL for the cast!\n{0}").format(
|
||||
_("Could not generate reversed engineered SQL for the cast.\n\n{0}").format(
|
||||
res
|
||||
)
|
||||
)
|
||||
|
||||
if res is None:
|
||||
return gone(
|
||||
_("ERROR: Couldn't generate reversed engineered SQL for the cast node!")
|
||||
_("Could not generate reversed engineered SQL for the cast node.\n")
|
||||
)
|
||||
|
||||
return ajax_response(response=res)
|
||||
|
||||
@@ -277,7 +277,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
// validate source type control
|
||||
if (_.isUndefined(srctype) || _.isNull(srctype) || String(srctype).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Source type must be selected!') }}';
|
||||
var msg = '{{ _('Source type must be selected.') }}';
|
||||
this.errorModel.set('srctyp', msg);
|
||||
return msg;
|
||||
}
|
||||
@@ -288,7 +288,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
// validate target type control
|
||||
if (_.isUndefined(trgtype) || _.isNull(trgtype) || String(trgtype).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Target type must be selected!') }}';
|
||||
var msg = '{{ _('Target type must be selected.') }}';
|
||||
this.errorModel.set('trgtyp', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ class EventTriggerView(PGChildNodeView):
|
||||
status=400,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter/s %s." % err
|
||||
"Could not find the required parameter %s." % err
|
||||
)
|
||||
)
|
||||
try:
|
||||
@@ -536,7 +536,7 @@ class EventTriggerView(PGChildNodeView):
|
||||
status=400,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter/s %s." % err
|
||||
"Could not find the required parameter %s." % err
|
||||
)
|
||||
)
|
||||
sql = render_template("/".join([self.template_path, 'create.sql']), data=data)
|
||||
|
||||
@@ -18,12 +18,12 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
this.errorModel.clear()
|
||||
if (_.isUndefined(this.get('provider')) || String(this.get('provider')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Provider can not be empty!') }}';
|
||||
var msg = '{{ _('Provider cannot be empty.') }}';
|
||||
this.errorModel.set('provider',msg);
|
||||
return msg;
|
||||
}
|
||||
if (_.isUndefined(this.get('securitylabel')) || String(this.get('securitylabel')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Security Label can not be empty!') }}';
|
||||
var msg = '{{ _('Security Label cannot be empty.') }}';
|
||||
this.errorModel.set('securitylabel',msg);
|
||||
return msg;
|
||||
}
|
||||
@@ -158,33 +158,33 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (_.isUndefined(this.get('name'))
|
||||
|| String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
msg = '{{ _('Event trigger name can not be empty!') }}';
|
||||
msg = '{{ _('Event trigger name cannot be empty.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('eventowner'))
|
||||
|| String(this.get('eventowner')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
msg = '{{ _('Event trigger owner can not be empty!') }}';
|
||||
msg = '{{ _('Event trigger owner cannot be empty.') }}';
|
||||
this.errorModel.set('eventowner', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('enabled'))) {
|
||||
msg = '{{ _('Event trigger enabled status can not be empty!') }}';
|
||||
msg = '{{ _('Event trigger enabled status cannot be empty.') }}';
|
||||
this.errorModel.set('enabled', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('eventfunname'))
|
||||
|| String(this.get('eventfunname')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
msg = '{{ _('Event trigger function can not be empty!') }}';
|
||||
msg = '{{ _('Event trigger function cannot be empty.') }}';
|
||||
this.errorModel.set('eventfunname', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('eventname'))) {
|
||||
msg = '{{ _('Event trigger event can not be empty!') }}';
|
||||
msg = '{{ _('Event trigger event cannot be empty.') }}';
|
||||
this.errorModel.set('eventname', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ class ExtensionView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ function($, _, S, pgAdmin, pgBrowser) {
|
||||
name = this.get('name');
|
||||
if (_.isUndefined(name) || _.isNull(name) ||
|
||||
String(name).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['name'] = '{{ _('Name can not be empty!') }}';
|
||||
err['name'] = '{{ _('Name cannot be empty.') }}';
|
||||
errmsg = errmsg || err['name'];
|
||||
this.errorModel.set('name', errmsg);
|
||||
return errmsg;
|
||||
|
||||
@@ -357,7 +357,7 @@ class ForeignDataWrapperView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -358,7 +358,7 @@ class ForeignServerView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
try:
|
||||
|
||||
@@ -165,7 +165,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (_.isUndefined(name) || _.isNull(name) ||
|
||||
String(name).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Name can not be empty!') }}';
|
||||
var msg = '{{ _('Name cannot be empty.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
return msg;
|
||||
} else {
|
||||
|
||||
@@ -366,7 +366,7 @@ class UserMappingView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (_.isUndefined(name) || _.isNull(name) ||
|
||||
String(name).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Name can not be empty!') }}';
|
||||
var msg = '{{ _('Name cannot be empty.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
return msg;
|
||||
} else {
|
||||
|
||||
@@ -165,7 +165,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (_.isUndefined(name) || _.isNull(name) ||
|
||||
String(name).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Name can not be empty!') }}';
|
||||
var msg = '{{ _('Name cannot be empty.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
return msg;
|
||||
} else {
|
||||
|
||||
@@ -188,7 +188,7 @@ define(
|
||||
|
||||
if (_.isUndefined(name) || _.isNull(name) ||
|
||||
String(name).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Name can not be empty!') }}';
|
||||
var msg = '{{ _('Name cannot be empty.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
return msg;
|
||||
} else {
|
||||
|
||||
@@ -501,7 +501,7 @@ It may have been removed by another user.
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter (%s)." %
|
||||
"Could not find the required parameter (%s)." %
|
||||
required_args[arg]
|
||||
)
|
||||
)
|
||||
@@ -718,7 +718,7 @@ It may have been removed by another user.
|
||||
|
||||
for arg in required_args:
|
||||
if arg not in data:
|
||||
return " -- " + gettext("definition incomplete")
|
||||
return " -- " + gettext("Definition incomplete.")
|
||||
|
||||
# Privileges
|
||||
self.format_request_acls(data, specific=['nspacl'])
|
||||
|
||||
@@ -389,7 +389,7 @@ class CollationView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
if self._check_definition(data):
|
||||
@@ -397,8 +397,7 @@ class CollationView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Incomplete definition, Please provide Locale \
|
||||
OR Copy collation OR LC_TYPE/LC_COLLATE"
|
||||
"Incomplete definition. Please provide Locale OR Copy Collation OR LC_TYPE/LC_COLLATE"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (_.has(changedAttrs,data.name) && _.isUndefined(this.get('name'))
|
||||
|| String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
msg = '{{ _('Name can not be empty!') }}';
|
||||
msg = '{{ _('Name cannot be empty.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
}
|
||||
if (_.has(changedAttrs,data.locale) && (_.isUndefined(this.get('locale'))
|
||||
|
||||
@@ -204,8 +204,7 @@ class DomainView(PGChildNodeView, DataTypeReader):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter \
|
||||
(%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
|
||||
@@ -358,8 +357,7 @@ class DomainView(PGChildNodeView, DataTypeReader):
|
||||
if len(res['rows']) == 0:
|
||||
return gone(gettext("""
|
||||
Could not find the domain in the database.
|
||||
It may have been removed by another user or
|
||||
shifted to the another schema.
|
||||
It may have been removed by another user or moved to another schema.
|
||||
"""))
|
||||
|
||||
data = res['rows'][0]
|
||||
|
||||
@@ -208,8 +208,7 @@ class DomainConstraintView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter \
|
||||
(%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
'string', group: '{{ _('Definition') }}', mode: ['properties',
|
||||
'create', 'edit'], disabled: function(m) { return !m.isNew(); }
|
||||
},{
|
||||
id: 'connoinherit', label: '{{ _('No Inherit') }}', type:
|
||||
id: 'connoinherit', label: '{{ _('No inherit') }}', type:
|
||||
'switch', cell: 'boolean', group: '{{ _('Definition') }}', mode:
|
||||
['properties', 'create', 'edit'], disabled: 'isDisabled',
|
||||
visible: false
|
||||
@@ -106,12 +106,12 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
errmsg;
|
||||
|
||||
if (_.isUndefined(this.get('name')) || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['name'] = '{{ _('Name can not be empty!') }}';
|
||||
err['name'] = '{{ _('Name cannot be empty.') }}';
|
||||
errmsg = errmsg || err['name'];
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('consrc')) || String(this.get('consrc')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['consrc'] = '{{ _('Check can not be empty!') }}';
|
||||
err['consrc'] = '{{ _('Check cannot be empty.') }}';
|
||||
errmsg = errmsg || err['consrc'];
|
||||
}
|
||||
|
||||
|
||||
@@ -308,12 +308,12 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
seclabels = this.get('seclabels');
|
||||
|
||||
if (_.isUndefined(this.get('name')) || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['name'] = '{{ _('Name can not be empty!') }}';
|
||||
err['name'] = '{{ _('Name cannot be empty.') }}';
|
||||
errmsg = errmsg || err['name'];
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('basetype')) || String(this.get('basetype')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['basetype'] = '{{ _('Base Type can not be empty!') }}';
|
||||
err['basetype'] = '{{ _('Base Type cannot be empty.') }}';
|
||||
errmsg = errmsg || err['basetype'];
|
||||
}
|
||||
|
||||
|
||||
@@ -415,7 +415,7 @@ class FtsDictionaryView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=_(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
try:
|
||||
@@ -760,7 +760,7 @@ class FtsDictionaryView(PGChildNodeView):
|
||||
if not status:
|
||||
return internal_server_error(
|
||||
_(
|
||||
"ERROR: Couldn't generate reversed engineered query for the FTS Dictionary!\n{0}").format(
|
||||
"Couldn't generate reversed engineered query for the FTS Dictionary!\n{0}").format(
|
||||
res
|
||||
)
|
||||
)
|
||||
@@ -768,7 +768,7 @@ class FtsDictionaryView(PGChildNodeView):
|
||||
if res is None:
|
||||
return gone(
|
||||
_(
|
||||
"ERROR: Couldn't generate reversed engineered query for FTS Dictionary node!")
|
||||
"Couldn't generate reversed engineered query for FTS Dictionary node!")
|
||||
)
|
||||
|
||||
return ajax_response(response=res)
|
||||
|
||||
@@ -350,7 +350,7 @@ class FtsParserView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=_(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
try:
|
||||
@@ -486,9 +486,7 @@ class FtsParserView(PGChildNodeView):
|
||||
return internal_server_error(errormsg=res)
|
||||
|
||||
if len(res['rows']) == 0:
|
||||
return gone(_("""
|
||||
Could not find the FTS Parser node.
|
||||
"""))
|
||||
return gone(_("Could not find the FTS Parser node."))
|
||||
|
||||
# Drop fts Parser
|
||||
result = res['rows'][0]
|
||||
@@ -568,9 +566,7 @@ class FtsParserView(PGChildNodeView):
|
||||
return internal_server_error(errormsg=res)
|
||||
|
||||
if len(res['rows']) == 0:
|
||||
return gone(_("""
|
||||
Could not find the FTS Parser node.
|
||||
"""))
|
||||
return gone(_("Could not find the FTS Parser node."))
|
||||
|
||||
old_data = res['rows'][0]
|
||||
|
||||
@@ -798,16 +794,14 @@ class FtsParserView(PGChildNodeView):
|
||||
if not status:
|
||||
return internal_server_error(
|
||||
_(
|
||||
"ERROR: Couldn't generate reversed engineered \
|
||||
query for the FTS Parser!\n{0}"
|
||||
"Could not generate reversed engineered query for the FTS Parser.\n{0}"
|
||||
).format(res)
|
||||
)
|
||||
|
||||
if res is None:
|
||||
return gone(
|
||||
_(
|
||||
"ERROR: Couldn't generate reversed engineered \
|
||||
query for FTS Parser node!"
|
||||
"Could not generate reversed engineered query for FTS Parser node"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
if (_.isUndefined(name) ||
|
||||
_.isNull(name) ||
|
||||
String(name).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Name must be specified!') }}';
|
||||
var msg = '{{ _('Name must be specified.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
return msg;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
else if (_.isUndefined(start) ||
|
||||
_.isNull(start) ||
|
||||
String(start).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Start function must be selected!') }}';
|
||||
var msg = '{{ _('Start function must be selected.') }}';
|
||||
this.errorModel.set('prsstart', msg);
|
||||
return msg;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
else if (_.isUndefined(token) ||
|
||||
_.isNull(token) ||
|
||||
String(token).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Get next token function must be selected!') }}';
|
||||
var msg = '{{ _('Get next token function must be selected.') }}';
|
||||
this.errorModel.set('prstoken', msg);
|
||||
return msg;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
else if (_.isUndefined(end) ||
|
||||
_.isNull(end) ||
|
||||
String(end).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('End function must be selected!') }}';
|
||||
var msg = '{{ _('End function must be selected.') }}';
|
||||
this.errorModel.set('prsend', msg);
|
||||
return msg;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
else if (_.isUndefined(lextype) ||
|
||||
_.isNull(lextype) ||
|
||||
String(lextype).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Lextype function must be selected!') }}';
|
||||
var msg = '{{ _('Lextype function must be selected.') }}';
|
||||
this.errorModel.set('prslextype', msg);
|
||||
return msg;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
else if (_.isUndefined(schema) ||
|
||||
_.isNull(schema) ||
|
||||
String(schema).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Schema must be selected!') }}';
|
||||
var msg = '{{ _('Schema must be selected.') }}';
|
||||
this.errorModel.set('schema', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ class FtsTemplateView(PGChildNodeView):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
try:
|
||||
@@ -662,7 +662,7 @@ class FtsTemplateView(PGChildNodeView):
|
||||
if not status:
|
||||
return internal_server_error(
|
||||
_(
|
||||
"ERROR: Couldn't generate reversed engineered Query for the FTS Template!\n{0}").format(
|
||||
"Could not generate reversed engineered Query for the FTS Template.\n{0}").format(
|
||||
res
|
||||
)
|
||||
)
|
||||
@@ -670,7 +670,7 @@ class FtsTemplateView(PGChildNodeView):
|
||||
if res is None:
|
||||
return gone(
|
||||
_(
|
||||
"ERROR: Couldn't generate reversed engineered Query for FTS Template node!")
|
||||
"Could not generate reversed engineered Query for FTS Template node.")
|
||||
)
|
||||
|
||||
return ajax_response(response=res)
|
||||
|
||||
@@ -107,21 +107,21 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
// Validate fts template name
|
||||
if (_.isUndefined(name) || _.isNull(name) || String(name).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Name must be specified!') }}';
|
||||
var msg = '{{ _('Name must be specified.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
// Validate lexize function control
|
||||
else if (_.isUndefined(lexize) || _.isNull(lexize) || String(lexize).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Lexize function must be selected!') }}';
|
||||
var msg = '{{ _('Lexize function must be selected.') }}';
|
||||
this.errorModel.set('tmpllexize', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
// Validate schema for fts template
|
||||
else if (_.isUndefined(schema) || _.isNull(schema) || String(schema).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Schema must be selected!') }}';
|
||||
var msg = '{{ _('Schema must be selected.') }}';
|
||||
this.errorModel.set('schema', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -255,8 +255,7 @@ class FunctionView(PGChildNodeView, DataTypeReader):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter \
|
||||
(%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
|
||||
@@ -792,7 +791,7 @@ class FunctionView(PGChildNodeView, DataTypeReader):
|
||||
|
||||
return make_json_response(
|
||||
success=1,
|
||||
info=gettext("Function Dropped."),
|
||||
info=gettext("Function dropped."),
|
||||
data={
|
||||
'id': fnid,
|
||||
'scid': scid,
|
||||
@@ -1108,9 +1107,8 @@ class FunctionView(PGChildNodeView, DataTypeReader):
|
||||
|
||||
if len(res['rows']) == 0:
|
||||
return gone(gettext("""
|
||||
Could not find the function in the database.
|
||||
It may have been removed by another user or
|
||||
created/shifted to the another schema.
|
||||
Could not find the function in the database.\n
|
||||
It may have been removed by another user or moved to another schema.
|
||||
"""))
|
||||
|
||||
resp_data = res['rows'][0]
|
||||
|
||||
@@ -347,45 +347,45 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
seclabels = this.get('seclabels');
|
||||
|
||||
if (_.isUndefined(this.get('name')) || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['name'] = '{{ _('Name can not be empty!') }}';
|
||||
err['name'] = '{{ _('Name cannot be empty.') }}';
|
||||
errmsg = errmsg || err['name'];
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('funcowner')) || String(this.get('funcowner')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['funcowner'] = '{{ _('Owner can not be empty!') }}';
|
||||
err['funcowner'] = '{{ _('Owner cannot be empty.') }}';
|
||||
errmsg = errmsg || err['funcowner'];
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('pronamespace')) || String(this.get('pronamespace')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['pronamespace'] = '{{ _('Schema can not be empty!') }}';
|
||||
err['pronamespace'] = '{{ _('Schema cannot be empty.') }}';
|
||||
errmsg = errmsg || err['pronamespace'];
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('prorettypename')) || String(this.get('prorettypename')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['prorettypename'] = '{{ _('Return Type can not be empty!') }}';
|
||||
err['prorettypename'] = '{{ _('Return Type cannot be empty.') }}';
|
||||
errmsg = errmsg || err['prorettypename'];
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('lanname')) || String(this.get('lanname')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['lanname'] = '{{ _('Language can not be empty!') }}';
|
||||
err['lanname'] = '{{ _('Language cannot be empty.') }}';
|
||||
errmsg = errmsg || err['lanname'];
|
||||
}
|
||||
|
||||
if (String(this.get('lanname')) == 'c') {
|
||||
if (_.isUndefined(this.get('probin')) || String(this.get('probin'))
|
||||
.replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['probin'] = '{{ _('Object File can not be empty!') }}';
|
||||
err['probin'] = '{{ _('Object File cannot be empty.') }}';
|
||||
errmsg = errmsg || err['probin'];
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('prosrc_c')) || String(this.get('prosrc_c')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['prosrc_c'] = '{{ _('Link Symbol can not be empty!') }}';
|
||||
err['prosrc_c'] = '{{ _('Link Symbol cannot be empty.') }}';
|
||||
errmsg = errmsg || err['prosrc_c'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (_.isUndefined(this.get('prosrc')) || String(this.get('prosrc')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['prosrc'] = '{{ _('Code can not be empty!') }}';
|
||||
err['prosrc'] = '{{ _('Code cannot be empty.') }}';
|
||||
errmsg = errmsg || err['prosrc'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,22 +127,22 @@ function($, _, S, pgAdmin, pgBrowser, alertify, Function) {
|
||||
seclabels = this.get('seclabels');
|
||||
|
||||
if (_.isUndefined(this.get('name')) || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['name'] = '{{ _('Name can not be empty!') }}';
|
||||
err['name'] = '{{ _('Name cannot be empty.') }}';
|
||||
errmsg = errmsg || err['name'];
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('pronamespace')) || String(this.get('pronamespace')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['pronamespace'] = '{{ _('Schema can not be empty!') }}';
|
||||
err['pronamespace'] = '{{ _('Schema cannot be empty.') }}';
|
||||
errmsg = errmsg || err['pronamespace'];
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('lanname')) || String(this.get('lanname')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['lanname'] = '{{ _('Language can not be empty!') }}';
|
||||
err['lanname'] = '{{ _('Language cannot be empty.') }}';
|
||||
errmsg = errmsg || err['lanname'];
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('prosrc')) || String(this.get('prosrc')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
err['prosrc'] = '{{ _('Code can not be empty!') }}';
|
||||
err['prosrc'] = '{{ _('Code cannot be empty.') }}';
|
||||
errmsg = errmsg || err['prosrc'];
|
||||
}
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ class SequenceView(PGChildNodeView):
|
||||
status=400,
|
||||
success=0,
|
||||
errormsg=_(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
try:
|
||||
@@ -479,7 +479,7 @@ class SequenceView(PGChildNodeView):
|
||||
status=400,
|
||||
success=0,
|
||||
errormsg=_(
|
||||
"Couldn't find the required parameter (%s)." % arg
|
||||
"Could not find the required parameter (%s)." % arg
|
||||
)
|
||||
)
|
||||
try:
|
||||
|
||||
@@ -230,21 +230,21 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (_.isUndefined(this.get('name'))
|
||||
|| String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
msg = '{{ _('Sequence name can not be empty!') }}';
|
||||
msg = '{{ _('Name cannot be empty.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('seqowner'))
|
||||
|| String(this.get('seqowner')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
msg = '{{ _('Sequence owner can not be empty!') }}';
|
||||
msg = '{{ _('Owner can not be empty.') }}';
|
||||
this.errorModel.set('seqowner', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
if (_.isUndefined(this.get('schema'))
|
||||
|| String(this.get('schema')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
msg = '{{ _('Sequence schema can not be empty!') }}';
|
||||
msg = '{{ _('Schema cannot be empty.') }}';
|
||||
this.errorModel.set('schema', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -190,13 +190,13 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) {
|
||||
if (_.isUndefined(this.get('name')) ||
|
||||
_.isNull(this.get('name')) ||
|
||||
String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
errmsg = '{{ _('Name can not be empty.')}}';
|
||||
errmsg = '{{ _('Name cannot be empty.')}}';
|
||||
this.errorModel.set('name', errmsg);
|
||||
return errmsg;
|
||||
} else if (_.isUndefined(this.get('namespaceowner')) ||
|
||||
_.isNull(this.get('namespaceowner')) ||
|
||||
String(this.get('namespaceowner')).replace(/^\s+|\s+$/g, '') == '') {
|
||||
errmsg = '{{ _('Owner can not be empty.')}}';
|
||||
errmsg = '{{ _('Owner cannot be empty.')}}';
|
||||
this.errorModel.set('namespaceowner', errmsg);
|
||||
return errmsg;
|
||||
}
|
||||
|
||||
@@ -791,7 +791,7 @@ class TypeView(PGChildNodeView, DataTypeReader):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
"Couldn't find the required parameter (%s)." %
|
||||
"Could not find the required parameter (%s)." %
|
||||
required_args[arg]
|
||||
)
|
||||
)
|
||||
@@ -803,7 +803,7 @@ class TypeView(PGChildNodeView, DataTypeReader):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
'Composite types requires at least two members'
|
||||
'Composite types require at least two members.'
|
||||
)
|
||||
)
|
||||
# If type is enum then check if it has minimum one label
|
||||
@@ -813,7 +813,7 @@ class TypeView(PGChildNodeView, DataTypeReader):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
'Enumeration types requires at least one label'
|
||||
'Enumeration types require at least one label.'
|
||||
)
|
||||
)
|
||||
# If type is range then check if subtype is defined or not
|
||||
@@ -823,7 +823,7 @@ class TypeView(PGChildNodeView, DataTypeReader):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
'Subtype must be defined for range types'
|
||||
'Subtype must be defined for range types.'
|
||||
)
|
||||
)
|
||||
# If type is external then check if input/output
|
||||
@@ -835,8 +835,7 @@ class TypeView(PGChildNodeView, DataTypeReader):
|
||||
status=410,
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
'External types require both Input & \
|
||||
Output conversion function.'
|
||||
'External types require both Input and Output conversion functions.'
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -737,35 +737,35 @@ function($, _, S, pgAdmin, pgBrowser, alertify, Backgrid) {
|
||||
if (_.has(changedAttrs, 'name') &&
|
||||
(_.isUndefined(this.get('name'))
|
||||
|| String(this.get('name')).replace(/^\s+|\s+$/g, '') == '')) {
|
||||
msg = '{{ _('Name can not be empty!') }}';
|
||||
msg = '{{ _('Name cannot be empty.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
} else if (_.has(changedAttrs, 'schema') &&
|
||||
(_.isUndefined(this.get('schema'))
|
||||
|| String(this.get('schema')).replace(/^\s+|\s+$/g, '') == '')) {
|
||||
msg = '{{ _('Schema can not be empty!') }}';
|
||||
msg = '{{ _('Schema cannot be empty.') }}';
|
||||
this.errorModel.set('schema', msg);
|
||||
} else if (_.has(changedAttrs, 'typtype') &&
|
||||
(_.isUndefined(this.get('typtype'))
|
||||
|| String(this.get('name')).replace(/^\s+|\s+$/g, '') == '')) {
|
||||
msg = '{{ _('Type can not be empty!') }}';
|
||||
msg = '{{ _('Type can not be empty.') }}';
|
||||
this.errorModel.set('typtype', msg);
|
||||
} else if (this.get('typtype') == 'r' &&
|
||||
_.has(changedAttrs, 'typname')
|
||||
&& (_.isUndefined(this.get('typname'))
|
||||
|| String(this.get('typname')).replace(/^\s+|\s+$/g, '') == '')) {
|
||||
msg = '{{ _('Subtype Name can not be empty!') }}';
|
||||
msg = '{{ _('Subtype name cannot be empty.') }}';
|
||||
this.errorModel.set('typname', msg);
|
||||
} else if (this.get('typtype') == 'x' &&
|
||||
_.has(changedAttrs, 'typinput')
|
||||
&& (_.isUndefined(this.get('typinput'))
|
||||
|| String(this.get('typinput')).replace(/^\s+|\s+$/g, '') == '')) {
|
||||
msg = '{{ _('Input function can not be empty!') }}';
|
||||
msg = '{{ _('Input function can not be empty.') }}';
|
||||
this.errorModel.set('typinput', msg);
|
||||
} else if (this.get('typtype') == 'x' &&
|
||||
_.has(changedAttrs, 'typoutput')
|
||||
&& (_.isUndefined(this.get('typoutput'))
|
||||
|| String(this.get('typoutput')).replace(/^\s+|\s+$/g, '') == '')) {
|
||||
msg = '{{ _('Output function can not be empty!') }}';
|
||||
msg = '{{ _('Output function can not be empty.') }}';
|
||||
this.errorModel.set('typoutput', msg);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -277,15 +277,15 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
|
||||
disabled: function(m) { return !m.isNew(); }, url: 'get_ctypes',
|
||||
control: 'node-ajax-options', cache_level: 'server'
|
||||
},{
|
||||
id: 'datctype', label: '{{ _('Character Type') }}',
|
||||
id: 'datctype', label: '{{ _('Character type') }}',
|
||||
editable: false, type: 'text', group: 'Definition',
|
||||
disabled: function(m) { return !m.isNew(); }, url: 'get_ctypes',
|
||||
control: 'node-ajax-options', cache_level: 'server'
|
||||
},{
|
||||
id: 'datconnlimit', label: '{{ _('Connection Limit') }}',
|
||||
id: 'datconnlimit', label: '{{ _('Connection limit') }}',
|
||||
editable: false, type: 'int', group: 'Definition', min: -1
|
||||
},{
|
||||
id: 'datallowconn', label: '{{ _('Allow Connections?') }}',
|
||||
id: 'datallowconn', label: '{{ _('Allow connections?') }}',
|
||||
editable: false, type: 'switch', group: 'Definition',
|
||||
mode: ['properties'], disabled: true,
|
||||
options: {
|
||||
@@ -350,7 +350,7 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
|
||||
var name = this.get('name');
|
||||
if (_.isUndefined(name) || _.isNull(name) ||
|
||||
String(name).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = '{{ _('Database name cannot be empty!') }}';
|
||||
var msg = '{{ _('Name cannot be empty.') }}';
|
||||
this.errorModel.set('name', msg);
|
||||
return msg;
|
||||
} else {
|
||||
@@ -372,7 +372,7 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
|
||||
Alertify.pgNotifier('error', xhr, error, function(msg) {
|
||||
setTimeout(function() {
|
||||
Alertify.dlgServerPass(
|
||||
'{{ _('Connect to Database') }}',
|
||||
'{{ _('Connect to database') }}',
|
||||
msg, _model, _data, _tree, _item
|
||||
).resizeTo();
|
||||
}, 100);
|
||||
|
||||
Reference in New Issue
Block a user