mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed gettext usage:
- fixed gettext usage with .format() only for original text with %s
- fixed typos
- fixed translation yes/no buttons in the dialog.
- improved translating sentences without "connecting" words (eg. see web/pgadmin/dashboard/static/js/dashboard.js,
word 'cancel' needs to be translated in the Czech language as 'zrušit' but in another sentence as 'zrušení')
- added gettext for text translations.
This commit is contained in:
@@ -503,15 +503,13 @@ def create_app(app_name=None):
|
|||||||
svr_discovery_id = inst_id
|
svr_discovery_id = inst_id
|
||||||
svr_comment = gettext(
|
svr_comment = gettext(
|
||||||
"Auto-detected %s installation with the data "
|
"Auto-detected %s installation with the data "
|
||||||
"directory at %s" % (
|
"directory at %s") % (
|
||||||
winreg.QueryValueEx(
|
winreg.QueryValueEx(
|
||||||
inst_key, 'Display Name'
|
inst_key, 'Display Name'
|
||||||
)[0],
|
)[0],
|
||||||
winreg.QueryValueEx(
|
winreg.QueryValueEx(
|
||||||
inst_key, 'Data Directory'
|
inst_key, 'Data Directory'
|
||||||
)[0]
|
)[0])
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
add_server(
|
add_server(
|
||||||
user_id, servergroup_id, svr_name,
|
user_id, servergroup_id, svr_name,
|
||||||
@@ -560,11 +558,10 @@ def create_app(app_name=None):
|
|||||||
description = description.decode('utf-8')
|
description = description.decode('utf-8')
|
||||||
data_directory = data_directory.decode('utf-8')
|
data_directory = data_directory.decode('utf-8')
|
||||||
svr_comment = gettext(u"Auto-detected %s installation "
|
svr_comment = gettext(u"Auto-detected %s installation "
|
||||||
u"with the data directory at %s" % (
|
u"with the data directory at %s") % (
|
||||||
description,
|
description,
|
||||||
data_directory
|
data_directory
|
||||||
)
|
)
|
||||||
)
|
|
||||||
add_server(user_id, servergroup_id, svr_name,
|
add_server(user_id, servergroup_id, svr_name,
|
||||||
svr_superuser, svr_port, svr_discovery_id,
|
svr_superuser, svr_port, svr_discovery_id,
|
||||||
svr_comment)
|
svr_comment)
|
||||||
|
|||||||
@@ -39,14 +39,14 @@ def register_browser_preferences(self):
|
|||||||
gettext("Browser tree state saving interval"), 'integer',
|
gettext("Browser tree state saving interval"), 'integer',
|
||||||
30, category_label=gettext('Display'),
|
30, category_label=gettext('Display'),
|
||||||
help_str=gettext(
|
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.'
|
'Use -1 to disable the tree saving mechanism.'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
self.preference.register(
|
self.preference.register(
|
||||||
'display', 'confirm_on_refresh_close',
|
'display', 'confirm_on_refresh_close',
|
||||||
gettext("Confirm on close or refresh ?"), 'boolean',
|
gettext("Confirm on close or refresh?"), 'boolean',
|
||||||
True, category_label=gettext('Display'),
|
True, category_label=gettext('Display'),
|
||||||
help_str=gettext(
|
help_str=gettext(
|
||||||
'Confirm closure or refresh of the browser or browser tab is '
|
'Confirm closure or refresh of the browser or browser tab is '
|
||||||
@@ -56,7 +56,7 @@ def register_browser_preferences(self):
|
|||||||
|
|
||||||
self.preference.register(
|
self.preference.register(
|
||||||
'display', 'confirm_on_properties_close',
|
'display', 'confirm_on_properties_close',
|
||||||
gettext("Confirm before Close/Reset in object properties dialog ?"),
|
gettext("Confirm before Close/Reset in object properties dialog?"),
|
||||||
'boolean',
|
'boolean',
|
||||||
True, category_label=gettext('Display'),
|
True, category_label=gettext('Display'),
|
||||||
help_str=gettext(
|
help_str=gettext(
|
||||||
|
|||||||
@@ -741,8 +741,7 @@ class ServerNode(PGChildNodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
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'] != '':
|
if 'hostaddr' in data and data['hostaddr'] and data['hostaddr'] != '':
|
||||||
@@ -838,7 +837,7 @@ class ServerNode(PGChildNodeView):
|
|||||||
status=401,
|
status=401,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
u"Unable to connect to server:\n\n%s" % errmsg)
|
u"Unable to connect to server:\n\n%s") % errmsg
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if 'save_password' in data and data['save_password'] and \
|
if 'save_password' in data and data['save_password'] and \
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ class DatabaseView(PGChildNodeView):
|
|||||||
kwargs['sid']
|
kwargs['sid']
|
||||||
)
|
)
|
||||||
if self.manager is None:
|
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"]:
|
if action and action in ["drop"]:
|
||||||
self.conn = self.manager.connection()
|
self.conn = self.manager.connection()
|
||||||
@@ -567,8 +567,7 @@ class DatabaseView(PGChildNodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
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
|
# The below SQL will execute CREATE DDL only
|
||||||
SQL = render_template(
|
SQL = render_template(
|
||||||
|
|||||||
@@ -368,8 +368,7 @@ class CastView(PGChildNodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
sql = render_template("/".join([self.template_path, 'create.sql']),
|
sql = render_template("/".join([self.template_path, 'create.sql']),
|
||||||
@@ -668,8 +667,8 @@ class CastView(PGChildNodeView):
|
|||||||
|
|
||||||
if res is None:
|
if res is None:
|
||||||
return gone(gettext(
|
return gone(gettext(
|
||||||
"Could not generate reversed engineered SQL for the cast \
|
"Could not generate reversed engineered SQL for the "
|
||||||
node."
|
"cast node."
|
||||||
))
|
))
|
||||||
|
|
||||||
return ajax_response(response=res)
|
return ajax_response(response=res)
|
||||||
|
|||||||
@@ -378,8 +378,7 @@ class EventTriggerView(PGChildNodeView):
|
|||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter %s." % err
|
"Could not find the required parameter %s.") % err
|
||||||
)
|
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
sql = render_template(
|
sql = render_template(
|
||||||
@@ -637,8 +636,7 @@ class EventTriggerView(PGChildNodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter %s." % err
|
"Could not find the required parameter %s.") % err
|
||||||
)
|
|
||||||
)
|
)
|
||||||
sql = render_template(
|
sql = render_template(
|
||||||
"/".join([self.template_path, 'create.sql']),
|
"/".join([self.template_path, 'create.sql']),
|
||||||
|
|||||||
@@ -262,8 +262,7 @@ class ExtensionView(PGChildNodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
status, res = self.conn.execute_dict(
|
status, res = self.conn.execute_dict(
|
||||||
|
|||||||
@@ -393,8 +393,7 @@ class ForeignDataWrapperView(PGChildNodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -388,8 +388,7 @@ class ForeignServerView(PGChildNodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
if 'fsrvacl' in data:
|
if 'fsrvacl' in data:
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ define('pgadmin.node.foreign_server', [
|
|||||||
if (_.isUndefined(this.get('fsrvoption')) ||
|
if (_.isUndefined(this.get('fsrvoption')) ||
|
||||||
_.isNull(this.get('fsrvoption')) ||
|
_.isNull(this.get('fsrvoption')) ||
|
||||||
String(this.get('fsrvoption')).replace(/^\s+|\s+$/g, '') == '') {
|
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);
|
this.errorModel.set('fsrvoption', msg);
|
||||||
return msg;
|
return msg;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -396,8 +396,7 @@ class UserMappingView(PGChildNodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ define('pgadmin.node.user_mapping', [
|
|||||||
if (_.isUndefined(this.get('umoption')) ||
|
if (_.isUndefined(this.get('umoption')) ||
|
||||||
_.isNull(this.get('umoption')) ||
|
_.isNull(this.get('umoption')) ||
|
||||||
String(this.get('umoption')).replace(/^\s+|\s+$/g, '') == '') {
|
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);
|
this.errorModel.set('umoption', msg);
|
||||||
return msg;
|
return msg;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ define('pgadmin.node.foreign_data_wrapper', [
|
|||||||
if (_.isUndefined(this.get('fdwoption')) ||
|
if (_.isUndefined(this.get('fdwoption')) ||
|
||||||
_.isNull(this.get('fdwoption')) ||
|
_.isNull(this.get('fdwoption')) ||
|
||||||
String(this.get('fdwoption')).replace(/^\s+|\s+$/g, '') == '') {
|
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);
|
this.errorModel.set('fdwoption', msg);
|
||||||
return msg;
|
return msg;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -453,8 +453,7 @@ class LanguageView(PGChildNodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ def check_precondition(f):
|
|||||||
kwargs['sid']
|
kwargs['sid']
|
||||||
)
|
)
|
||||||
if not self.manager:
|
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'])
|
self.conn = self.manager.connection(did=kwargs['did'])
|
||||||
# Set the template path for the SQL scripts
|
# Set the template path for the SQL scripts
|
||||||
@@ -570,9 +570,8 @@ It may have been removed by another user.
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." %
|
"Could not find the required parameter (%s).") %
|
||||||
required_args[arg]
|
required_args[arg]
|
||||||
)
|
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
self.format_request_acls(data)
|
self.format_request_acls(data)
|
||||||
|
|||||||
@@ -458,8 +458,7 @@ class CollationView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
if self._check_definition(data):
|
if self._check_definition(data):
|
||||||
return make_json_response(
|
return make_json_response(
|
||||||
|
|||||||
@@ -216,10 +216,8 @@ class DomainView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." %
|
"Could not find the required parameter (%s).")
|
||||||
arg
|
% arg)
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
list_params = []
|
list_params = []
|
||||||
|
|||||||
@@ -260,10 +260,8 @@ class ForeignTableView(PGChildNodeView, DataTypeReader,
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." %
|
"Could not find the required parameter (%s).")
|
||||||
arg
|
% arg)
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
list_params = []
|
list_params = []
|
||||||
|
|||||||
@@ -422,8 +422,7 @@ class FtsConfigurationView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
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
|
# Either copy config or parser must be present in data
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ class FtsDictionaryView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
errormsg=_(
|
||||||
"Could not find the required parameter (%s)." % arg)
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
)
|
||||||
# Fetch schema name from schema oid
|
# Fetch schema name from schema oid
|
||||||
sql = render_template(
|
sql = render_template(
|
||||||
|
|||||||
@@ -379,8 +379,7 @@ class FtsParserView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
errormsg=_(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
# Fetch schema name from schema oid
|
# Fetch schema name from schema oid
|
||||||
sql = render_template(
|
sql = render_template(
|
||||||
@@ -850,7 +849,7 @@ class FtsParserView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
return gone(
|
return gone(
|
||||||
_(
|
_(
|
||||||
"Could not generate reversed engineered query for "
|
"Could not generate reversed engineered query for "
|
||||||
"FTS Parser node"
|
"FTS Parser node."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -354,8 +354,7 @@ class FtsTemplateView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
# Fetch schema name from schema oid
|
# Fetch schema name from schema oid
|
||||||
sql = render_template("/".join([self.template_path, 'schema.sql']),
|
sql = render_template("/".join([self.template_path, 'schema.sql']),
|
||||||
|
|||||||
@@ -277,10 +277,8 @@ class FunctionView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." %
|
"Could not find the required parameter (%s).")
|
||||||
arg
|
% arg)
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
list_params = []
|
list_params = []
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
|
|||||||
@@ -379,8 +379,7 @@ class PackageView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
errormsg=_(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
data['schema'] = self.schema
|
data['schema'] = self.schema
|
||||||
|
|
||||||
@@ -557,9 +556,8 @@ class PackageView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
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)
|
SQL, name = self.getSQL(gid, sid, did, data, scid, pkgid)
|
||||||
# Most probably this is due to error
|
# Most probably this is due to error
|
||||||
|
|||||||
@@ -381,8 +381,7 @@ class SequenceView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
errormsg=_(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -590,9 +589,8 @@ class SequenceView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
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)
|
SQL, name = self.getSQL(gid, sid, did, data, scid, seid)
|
||||||
# Most probably this is due to error
|
# Most probably this is due to error
|
||||||
if not isinstance(SQL, (str, unicode)):
|
if not isinstance(SQL, (str, unicode)):
|
||||||
|
|||||||
@@ -450,8 +450,7 @@ class SynonymView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -908,8 +908,7 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings,
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
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
|
# Parse privilege data coming from client according to database format
|
||||||
@@ -1578,7 +1577,7 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings,
|
|||||||
|
|
||||||
return make_json_response(
|
return make_json_response(
|
||||||
status=200,
|
status=200,
|
||||||
info=gettext("Table rows counted: %s" % count),
|
info=gettext("Table rows counted: %s") % count,
|
||||||
data={'total_rows': count}
|
data={'total_rows': count}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -392,9 +392,8 @@ class ColumnsView(PGChildNodeView, DataTypeReader):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." %
|
"Could not find the required parameter (%s).") %
|
||||||
required_args[arg]
|
required_args[arg]
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Parse privilege data coming from client according to database format
|
# Parse privilege data coming from client according to database format
|
||||||
|
|||||||
@@ -511,9 +511,8 @@ class CompoundTriggerView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." %
|
"Could not find the required parameter (%s).") %
|
||||||
required_args[arg]
|
required_args[arg]
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Adding parent into data dict, will be using it while creating sql
|
# Adding parent into data dict, will be using it while creating sql
|
||||||
@@ -904,8 +903,8 @@ class CompoundTriggerView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
if not status:
|
if not status:
|
||||||
return internal_server_error(errormsg=res)
|
return internal_server_error(errormsg=res)
|
||||||
if len(res['rows']) == 0:
|
if len(res['rows']) == 0:
|
||||||
return gone(gettext("""Could not find the compound
|
return gone(gettext("Could not find the compound "
|
||||||
trigger in the table."""))
|
"trigger in the table."))
|
||||||
|
|
||||||
data = dict(res['rows'][0])
|
data = dict(res['rows'][0])
|
||||||
# Adding parent into data dict,
|
# Adding parent into data dict,
|
||||||
|
|||||||
@@ -194,10 +194,10 @@ define('pgadmin.node.compound_trigger', [
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
options: [
|
options: [
|
||||||
{label: 'Enable', value: 'O'},
|
{label: gettext('Enable'), value: 'O'},
|
||||||
{label: 'Enable Replica', value: 'R'},
|
{label: gettext('Enable Replica'), value: 'R'},
|
||||||
{label: 'Enable Always', value: 'A'},
|
{label: gettext('Enable Always'), value: 'A'},
|
||||||
{label: 'Disable', value: 'D'},
|
{label: gettext('Disable'), value: 'D'},
|
||||||
],
|
],
|
||||||
control: 'select2', select2: { allowClear: false, width: '100%' },
|
control: 'select2', select2: { allowClear: false, width: '100%' },
|
||||||
},{
|
},{
|
||||||
|
|||||||
@@ -476,8 +476,7 @@ class CheckConstraintView(PGChildNodeView):
|
|||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
errormsg=_(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data['schema'] = self.schema
|
data['schema'] = self.schema
|
||||||
|
|||||||
@@ -496,16 +496,14 @@ class ExclusionConstraintView(PGChildNodeView):
|
|||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
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:
|
elif isinstance(data[arg], list) and len(data[arg]) < 1:
|
||||||
return make_json_response(
|
return make_json_response(
|
||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
errormsg=_(
|
||||||
"Could not find required parameter (%s)." % str(arg)
|
"Could not find required parameter (%s).") % str(arg)
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data['schema'] = self.schema
|
data['schema'] = self.schema
|
||||||
|
|||||||
@@ -506,16 +506,14 @@ class ForeignKeyConstraintView(PGChildNodeView):
|
|||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
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:
|
elif isinstance(data[arg], list) and len(data[arg]) < 1:
|
||||||
return make_json_response(
|
return make_json_response(
|
||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
errormsg=_(
|
||||||
"Could not find required parameter (%s)." % str(arg)
|
"Could not find required parameter (%s).") % str(arg)
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data['schema'] = self.schema
|
data['schema'] = self.schema
|
||||||
|
|||||||
@@ -287,9 +287,10 @@ class IndexConstraintView(PGChildNodeView):
|
|||||||
return res
|
return res
|
||||||
|
|
||||||
if len(res) == 0:
|
if len(res) == 0:
|
||||||
return gone(_("""Could not find the {} in the table.""".format(
|
return gone(_("""Could not find the {} in the table.""").format(
|
||||||
"primary key" if self.constraint_type == "p" else "unique key"
|
_("primary key") if self.constraint_type == "p"
|
||||||
)))
|
else _("unique key")
|
||||||
|
))
|
||||||
|
|
||||||
result = res
|
result = res
|
||||||
if cid:
|
if cid:
|
||||||
@@ -386,9 +387,10 @@ class IndexConstraintView(PGChildNodeView):
|
|||||||
return internal_server_error(errormsg=rset)
|
return internal_server_error(errormsg=rset)
|
||||||
|
|
||||||
if len(rset['rows']) == 0:
|
if len(rset['rows']) == 0:
|
||||||
return gone(_("""Could not find the {} in the table.""".format(
|
return gone(_("""Could not find the {} in the table.""").format(
|
||||||
"primary key" if self.constraint_type == "p" else "unique key"
|
_("primary key") if self.constraint_type == "p"
|
||||||
)))
|
else _("unique key")
|
||||||
|
))
|
||||||
|
|
||||||
res = self.blueprint.generate_browser_node(
|
res = self.blueprint.generate_browser_node(
|
||||||
rset['rows'][0]['oid'],
|
rset['rows'][0]['oid'],
|
||||||
@@ -533,8 +535,7 @@ class IndexConstraintView(PGChildNodeView):
|
|||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
errormsg=_(
|
||||||
"Could not find at least one required "
|
"Could not find at least one required "
|
||||||
"parameter (%s)." % str(param)
|
"parameter (%s).") % str(param)
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
elif arg not in data:
|
elif arg not in data:
|
||||||
@@ -542,8 +543,7 @@ class IndexConstraintView(PGChildNodeView):
|
|||||||
status=400,
|
status=400,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
errormsg=_(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data['schema'] = self.schema
|
data['schema'] = self.schema
|
||||||
@@ -824,9 +824,10 @@ class IndexConstraintView(PGChildNodeView):
|
|||||||
if not status:
|
if not status:
|
||||||
return internal_server_error(errormsg=res)
|
return internal_server_error(errormsg=res)
|
||||||
if len(res['rows']) == 0:
|
if len(res['rows']) == 0:
|
||||||
return gone(_("""Could not find the {} in the table.""".format(
|
return gone(_("""Could not find the {} in the table.""").format(
|
||||||
"primary key" if self.constraint_type == "p" else "unique key"
|
_("primary key") if self.constraint_type == "p"
|
||||||
)))
|
else _("unique key")
|
||||||
|
))
|
||||||
|
|
||||||
data = res['rows'][0]
|
data = res['rows'][0]
|
||||||
data['schema'] = self.schema
|
data['schema'] = self.schema
|
||||||
@@ -916,10 +917,10 @@ class IndexConstraintView(PGChildNodeView):
|
|||||||
return internal_server_error(errormsg=res)
|
return internal_server_error(errormsg=res)
|
||||||
if len(res['rows']) == 0:
|
if len(res['rows']) == 0:
|
||||||
return gone(
|
return gone(
|
||||||
_("""Could not find the {} in the table.""".format(
|
_("""Could not find the {} in the table.""").format(
|
||||||
"primary key" if self.constraint_type == "p"
|
_("primary key") if self.constraint_type == "p"
|
||||||
else "unique key"
|
else _("unique key")
|
||||||
))
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
result = res['rows'][0]
|
result = res['rows'][0]
|
||||||
|
|||||||
@@ -649,7 +649,7 @@ define('pgadmin.node.primary_key', [
|
|||||||
|
|
||||||
if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') &&
|
if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') &&
|
||||||
(_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) {
|
(_.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);
|
this.errorModel.set('columns', msg);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -638,7 +638,7 @@ define('pgadmin.node.unique_constraint', [
|
|||||||
|
|
||||||
if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') &&
|
if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') &&
|
||||||
(_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) {
|
(_.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);
|
this.errorModel.set('columns', msg);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -576,11 +576,12 @@ class IndexesView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
for arg in required_args:
|
for arg in required_args:
|
||||||
err_msg = None
|
err_msg = None
|
||||||
if arg == 'columns' and len(data['columns']) < 1:
|
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:
|
if arg not in data:
|
||||||
err_msg = "Could not find the required parameter (%s)." % \
|
err_msg = gettext("Could not find the required parameter (%s)"
|
||||||
required_args[arg]
|
".") % required_args[arg]
|
||||||
# Check if we have at least one column
|
# Check if we have at least one column
|
||||||
if err_msg is not None:
|
if err_msg is not None:
|
||||||
return make_json_response(
|
return make_json_response(
|
||||||
|
|||||||
@@ -60,12 +60,12 @@ function(
|
|||||||
pgBrowser.add_menus([{
|
pgBrowser.add_menus([{
|
||||||
name: 'truncate_table', node: 'partition', module: this,
|
name: 'truncate_table', node: 'partition', module: this,
|
||||||
applies: ['object', 'context'], callback: 'truncate_table',
|
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',
|
icon: 'fa fa-eraser', enable : 'canCreate',
|
||||||
},{
|
},{
|
||||||
name: 'truncate_table_cascade', node: 'partition', module: this,
|
name: 'truncate_table_cascade', node: 'partition', module: this,
|
||||||
applies: ['object', 'context'], callback: 'truncate_table_cascade',
|
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',
|
icon: 'fa fa-eraser', enable : 'canCreate',
|
||||||
},{
|
},{
|
||||||
// To enable/disable all triggers for the table
|
// To enable/disable all triggers for the table
|
||||||
|
|||||||
@@ -196,10 +196,10 @@ define('pgadmin.node.trigger', [
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
options: [
|
options: [
|
||||||
{label: 'Enable', value: 'O'},
|
{label: gettext('Enable'), value: 'O'},
|
||||||
{label: 'Enable Replica', value: 'R'},
|
{label: gettext('Enable Replica'), value: 'R'},
|
||||||
{label: 'Enable Always', value: 'A'},
|
{label: gettext('Enable Always'), value: 'A'},
|
||||||
{label: 'Disable', value: 'D'},
|
{label: gettext('Disable'), value: 'D'},
|
||||||
],
|
],
|
||||||
control: 'select2', select2: { allowClear: false, width: '100%' },
|
control: 'select2', select2: { allowClear: false, width: '100%' },
|
||||||
},{
|
},{
|
||||||
|
|||||||
@@ -946,9 +946,8 @@ class TypeView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." %
|
"Could not find the required parameter (%s).") %
|
||||||
required_args[arg]
|
required_args[arg]
|
||||||
)
|
|
||||||
)
|
)
|
||||||
# Additional checks goes here
|
# Additional checks goes here
|
||||||
# If type is range then check if subtype is defined or not
|
# If type is range then check if subtype is defined or not
|
||||||
|
|||||||
@@ -218,9 +218,9 @@ define('pgadmin.node.type', [
|
|||||||
else if (this.get('is_tlength')
|
else if (this.get('is_tlength')
|
||||||
&& !_.isUndefined(this.get('tlength'))) {
|
&& !_.isUndefined(this.get('tlength'))) {
|
||||||
if (this.get('tlength') < this.get('min_val'))
|
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') )
|
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 we have any error set then throw it to user
|
||||||
if(errmsg) {
|
if(errmsg) {
|
||||||
this.errorModel.set('tlength', errmsg);
|
this.errorModel.set('tlength', errmsg);
|
||||||
@@ -231,9 +231,9 @@ define('pgadmin.node.type', [
|
|||||||
else if (this.get('is_precision')
|
else if (this.get('is_precision')
|
||||||
&& !_.isUndefined(this.get('precision'))) {
|
&& !_.isUndefined(this.get('precision'))) {
|
||||||
if (this.get('precision') < this.get('min_val'))
|
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'))
|
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 we have any error set then throw it to user
|
||||||
if(errmsg) {
|
if(errmsg) {
|
||||||
this.errorModel.set('precision', errmsg);
|
this.errorModel.set('precision', errmsg);
|
||||||
|
|||||||
@@ -493,8 +493,7 @@ class ViewNode(PGChildNodeView, VacuumSettings, SchemaDiffObjectCompare):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
SQL, nameOrError = self.getSQL(gid, sid, did, scid, data)
|
SQL, nameOrError = self.getSQL(gid, sid, did, scid, data)
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ define('pgadmin.node.database', [
|
|||||||
|
|
||||||
Alertify.confirm(
|
Alertify.confirm(
|
||||||
gettext('Disconnect the database'),
|
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() {
|
function() {
|
||||||
var data = d;
|
var data = d;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -228,7 +228,11 @@ define('pgadmin.node.database', [
|
|||||||
t.unload(i);
|
t.unload(i);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function() { return true; });
|
function() { return true; }
|
||||||
|
).set('labels', {
|
||||||
|
ok: gettext('Yes'),
|
||||||
|
cancel: gettext('No'),
|
||||||
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -284,8 +284,7 @@ SELECT EXISTS(
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=_(
|
errormsg=_(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
status, res = self.conn.execute_void('BEGIN')
|
status, res = self.conn.execute_void('BEGIN')
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ define('pgadmin.node.pga_jobstep', [
|
|||||||
!_.isUndefined(val) && !_.isNull(val) &&
|
!_.isUndefined(val) && !_.isNull(val) &&
|
||||||
String(val).replace(/^\s+|\s+$/g, '') == ''
|
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);
|
this.errorModel.set('jstonerror', msg);
|
||||||
} else {
|
} else {
|
||||||
this.errorModel.unset('jstonerror');
|
this.errorModel.unset('jstonerror');
|
||||||
|
|||||||
@@ -363,8 +363,7 @@ class ResourceGroupView(NodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." % arg
|
"Could not find the required parameter (%s).") % arg
|
||||||
)
|
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
# Below logic will create new resource group
|
# Below logic will create new resource group
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ function(gettext, _, $, Backbone, Backform, Backgrid, Alertify, pgAdmin, pgNode)
|
|||||||
} else if (_.isUndefined(this.get('value')) ||
|
} else if (_.isUndefined(this.get('value')) ||
|
||||||
_.isNull(this.get('value')) ||
|
_.isNull(this.get('value')) ||
|
||||||
String(this.get('value')).replace(/^\s+|\s+$/g, '') == '') {
|
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.set('value', msg);
|
||||||
this.errorModel.unset('name');
|
this.errorModel.unset('name');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -295,9 +295,8 @@ class TablespaceView(PGChildNodeView):
|
|||||||
status=410,
|
status=410,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
"Could not find the required parameter (%s)." %
|
"Could not find the required parameter (%s).") %
|
||||||
required_args[arg]
|
required_args[arg]
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# To format privileges coming from client
|
# To format privileges coming from client
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ define('pgadmin.node.tablespace', [
|
|||||||
self.__internal.buttons[2].element.disabled = false;
|
self.__internal.buttons[2].element.disabled = false;
|
||||||
} else {
|
} else {
|
||||||
self.__internal.buttons[2].element.disabled = true;
|
self.__internal.buttons[2].element.disabled = true;
|
||||||
this.errorModel.set('tblspc', gettext('Please select tablespace'));
|
this.errorModel.set('tblspc', gettext('Please select tablespace.'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class ServerType(object):
|
|||||||
return self.spriority
|
return self.spriority
|
||||||
|
|
||||||
def __str__(self):
|
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
|
self.stype, self.desc, self.spriority
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -115,9 +115,9 @@ class ServerType(object):
|
|||||||
res = 'psql'
|
res = 'psql'
|
||||||
else:
|
else:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
_("Could not find the utility for the operation '%s'".format(
|
_("Could not find the utility for the operation '%s'").format(
|
||||||
operation
|
operation
|
||||||
))
|
)
|
||||||
)
|
)
|
||||||
bin_path = self.utility_path.get()
|
bin_path = self.utility_path.get()
|
||||||
if "$DIR" in bin_path:
|
if "$DIR" in bin_path:
|
||||||
|
|||||||
@@ -623,7 +623,7 @@ define('pgadmin.browser', [
|
|||||||
|
|
||||||
Alertify.confirm(gettext('Reset Master Password'),
|
Alertify.confirm(gettext('Reset Master Password'),
|
||||||
gettext('This will remove all the saved passwords. This will also remove established connections to '
|
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() {
|
function() {
|
||||||
/* If user clicks Yes */
|
/* If user clicks Yes */
|
||||||
self.reset_master_password();
|
self.reset_master_password();
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ define([
|
|||||||
<div class="custom-control custom-checkbox custom-checkbox-no-label">
|
<div class="custom-control custom-checkbox custom-checkbox-no-label">
|
||||||
<input tabindex="-1" type="checkbox" class="custom-control-input" id="${id}" ${disabled?'disabled':''}/>
|
<input tabindex="-1" type="checkbox" class="custom-control-input" id="${id}" ${disabled?'disabled':''}/>
|
||||||
<label class="custom-control-label" for="${id}">
|
<label class="custom-control-label" for="${id}">
|
||||||
<span class="sr-only">Select<span>
|
<span class="sr-only">` + gettext('Select') + `<span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
|||||||
@@ -761,9 +761,7 @@ define('pgadmin.browser.node', [
|
|||||||
obj = pgBrowser.Nodes[d._type];
|
obj = pgBrowser.Nodes[d._type];
|
||||||
var objName = d.label;
|
var objName = d.label;
|
||||||
|
|
||||||
var msg, title, drop_label;
|
var msg, title;
|
||||||
|
|
||||||
if (obj.dropAsRemove) drop_label = 'Remove'; else drop_label = 'Drop';
|
|
||||||
|
|
||||||
if (input.url == 'delete') {
|
if (input.url == 'delete') {
|
||||||
|
|
||||||
@@ -780,8 +778,13 @@ define('pgadmin.browser.node', [
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg = gettext('Are you sure you want to %s %s "%s"?', drop_label.toLowerCase(), obj.label.toLowerCase(), d.label);
|
if (obj.dropAsRemove) {
|
||||||
title = gettext('%s %s?', drop_label, obj.label);
|
msg = gettext('Are you sure you want to remove %s "%s"?', obj.label.toLowerCase(), d.label);
|
||||||
|
title = gettext('Remove %s?', obj.label);
|
||||||
|
} else {
|
||||||
|
msg = gettext('Are you sure you want to drop %s "%s"?', obj.label.toLowerCase(), d.label);
|
||||||
|
title = gettext('Drop %s?', obj.label);
|
||||||
|
}
|
||||||
|
|
||||||
if (!(_.isFunction(obj.canDrop) ?
|
if (!(_.isFunction(obj.canDrop) ?
|
||||||
obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) {
|
obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) {
|
||||||
@@ -822,7 +825,11 @@ define('pgadmin.browser.node', [
|
|||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
null).show();
|
null
|
||||||
|
).set('labels', {
|
||||||
|
ok: gettext('Yes'),
|
||||||
|
cancel: gettext('No'),
|
||||||
|
}).show();
|
||||||
},
|
},
|
||||||
// Callback for creating script(s) & opening them in Query editor
|
// Callback for creating script(s) & opening them in Query editor
|
||||||
show_script: function(args, item) {
|
show_script: function(args, item) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div style="position: fixed; top: 70px; right: 20px; width: 400px; z-index: 9999">
|
<div style="position: fixed; top: 70px; right: 20px; width: 400px; z-index: 9999">
|
||||||
{% for category, message in messages %}
|
{% for category, message in messages %}
|
||||||
<div class="alert alert-{{ category }} alert-dismissible" role="alert">
|
<div class="alert alert-{{ category }} alert-dismissible" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
|
<button type="button" class="close" data-dismiss="alert" aria-label="{{ _('Close') }}"><span
|
||||||
aria-hidden="true">×</span></button>
|
aria-hidden="true">×</span></button>
|
||||||
{{ message|safe }}
|
{{ message|safe }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -303,8 +303,8 @@ class NodeView(with_metaclass(MethodViewType, View)):
|
|||||||
status=406,
|
status=406,
|
||||||
success=0,
|
success=0,
|
||||||
errormsg=gettext(
|
errormsg=gettext(
|
||||||
'Unimplemented method ({0}) for this url ({1})'.format(
|
'Unimplemented method ({0}) for this url ({1})').format(
|
||||||
meth, flask.request.path)
|
meth, flask.request.path
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1448,7 +1448,7 @@ define('pgadmin.dashboard', [
|
|||||||
pg_version = this.get('postgres_version') || null,
|
pg_version = this.get('postgres_version') || null,
|
||||||
cell_action = this.get('cell_action') || null,
|
cell_action = this.get('cell_action') || null,
|
||||||
is_cancel_session = cell_action === 'cancel',
|
is_cancel_session = cell_action === 'cancel',
|
||||||
txtAction = is_cancel_session ? gettext('cancel') : gettext('terminate');
|
txtMessage;
|
||||||
|
|
||||||
// With PG10, We have background process showing on dashboard
|
// With PG10, We have background process showing on dashboard
|
||||||
// We will not allow user to cancel them as they will fail with error
|
// We will not allow user to cancel them as they will fail with error
|
||||||
@@ -1456,20 +1456,22 @@ define('pgadmin.dashboard', [
|
|||||||
|
|
||||||
// Background processes do not have database field populated
|
// Background processes do not have database field populated
|
||||||
if (pg_version && pg_version >= 100000 && !m.get('datname')) {
|
if (pg_version && pg_version >= 100000 && !m.get('datname')) {
|
||||||
Alertify.info(
|
if (is_cancel_session) {
|
||||||
gettext('You cannot ') +
|
txtMessage = gettext('You cannot cancel background worker processes.');
|
||||||
txtAction +
|
} else {
|
||||||
gettext(' background worker processes.')
|
txtMessage = gettext('You cannot terminate background worker processes.');
|
||||||
);
|
}
|
||||||
|
Alertify.info(txtMessage);
|
||||||
return false;
|
return false;
|
||||||
// If it is the last active connection on maintenance db then error out
|
// If it is the last active connection on maintenance db then error out
|
||||||
} else if (maintenance_database == m.get('datname') &&
|
} else if (maintenance_database == m.get('datname') &&
|
||||||
m.get('state') == 'active' && active_sessions.length == 1) {
|
m.get('state') == 'active' && active_sessions.length == 1) {
|
||||||
Alertify.error(
|
if (is_cancel_session) {
|
||||||
gettext('You are not allowed to ') +
|
txtMessage = gettext('You are not allowed to cancel the main active session.');
|
||||||
txtAction +
|
} else {
|
||||||
gettext(' the main active session.')
|
txtMessage = gettext('You are not allowed to terminate the main active session.');
|
||||||
);
|
}
|
||||||
|
Alertify.error(txtMessage);
|
||||||
return false;
|
return false;
|
||||||
} else if (is_cancel_session && m.get('state') == 'idle') {
|
} else if (is_cancel_session && m.get('state') == 'idle') {
|
||||||
// If this session is already idle then do nothing
|
// If this session is already idle then do nothing
|
||||||
@@ -1485,11 +1487,12 @@ define('pgadmin.dashboard', [
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// Do not allow to cancel someone else session to non-super user
|
// Do not allow to cancel someone else session to non-super user
|
||||||
Alertify.error(
|
if (is_cancel_session) {
|
||||||
gettext('Superuser privileges are required to ') +
|
txtMessage = gettext('Superuser privileges are required to cancel another users query.');
|
||||||
txtAction +
|
} else {
|
||||||
gettext(' another users query.')
|
txtMessage = gettext('Superuser privileges are required to terminate another users query.');
|
||||||
);
|
}
|
||||||
|
Alertify.error(txtMessage);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text fa fa-search" id="labelSearch"></span>
|
<span class="input-group-text fa fa-search" id="labelSearch"></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="search" class="form-control" id="txtGridSearch" placeholder="{{ _('Search') }}" aria-label="Search" aria-describedby="labelSearch">
|
<input type="search" class="form-control" id="txtGridSearch" placeholder="{{ _('Search') }}" aria-label="{{ _('Search') }}" aria-describedby="labelSearch">
|
||||||
</div>
|
</div>
|
||||||
<button id="btn_refresh" type="button" class="btn btn-secondary btn-navtab-inline" title="{{ _('Refresh') }}" aria-label="{{ _('Refresh') }}">
|
<button id="btn_refresh" type="button" class="btn btn-secondary btn-navtab-inline" title="{{ _('Refresh') }}" aria-label="{{ _('Refresh') }}">
|
||||||
<span class="fa fa-refresh" aria-hidden="true"></span>
|
<span class="fa fa-refresh" aria-hidden="true"></span>
|
||||||
|
|||||||
@@ -367,23 +367,23 @@ class Filemanager(object):
|
|||||||
capabilities = ['select_file', 'rename', 'upload', 'create']
|
capabilities = ['select_file', 'rename', 'upload', 'create']
|
||||||
files_only = True
|
files_only = True
|
||||||
folders_only = False
|
folders_only = False
|
||||||
title = "Select File"
|
title = gettext("Select File")
|
||||||
elif fm_type == 'select_folder':
|
elif fm_type == 'select_folder':
|
||||||
capabilities = ['select_folder', 'rename', 'create']
|
capabilities = ['select_folder', 'rename', 'create']
|
||||||
files_only = False
|
files_only = False
|
||||||
folders_only = True
|
folders_only = True
|
||||||
title = "Select Folder"
|
title = gettext("Select Folder")
|
||||||
elif fm_type == 'create_file':
|
elif fm_type == 'create_file':
|
||||||
capabilities = ['select_file', 'rename', 'create']
|
capabilities = ['select_file', 'rename', 'create']
|
||||||
files_only = True
|
files_only = True
|
||||||
folders_only = False
|
folders_only = False
|
||||||
title = "Create File"
|
title = gettext("Create File")
|
||||||
elif fm_type == 'storage_dialog':
|
elif fm_type == 'storage_dialog':
|
||||||
capabilities = ['select_folder', 'select_file', 'download',
|
capabilities = ['select_folder', 'select_file', 'download',
|
||||||
'rename', 'delete', 'upload', 'create']
|
'rename', 'delete', 'upload', 'create']
|
||||||
files_only = True
|
files_only = True
|
||||||
folders_only = False
|
folders_only = False
|
||||||
title = "Storage Manager"
|
title = gettext("Storage Manager")
|
||||||
|
|
||||||
# get last visited directory, if not present then traverse in reverse
|
# get last visited directory, if not present then traverse in reverse
|
||||||
# order to find closest parent directory
|
# order to find closest parent directory
|
||||||
@@ -561,7 +561,7 @@ class Filemanager(object):
|
|||||||
Filemanager.check_access_permission(dir, path)
|
Filemanager.check_access_permission(dir, path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Filemanager.resume_windows_warning()
|
Filemanager.resume_windows_warning()
|
||||||
err_msg = u"Error: {0}".format(e)
|
err_msg = gettext(u"Error: {0}").format(e)
|
||||||
files = {
|
files = {
|
||||||
'Code': 0,
|
'Code': 0,
|
||||||
'Error': err_msg
|
'Error': err_msg
|
||||||
@@ -601,7 +601,7 @@ class Filemanager(object):
|
|||||||
Filemanager.resume_windows_warning()
|
Filemanager.resume_windows_warning()
|
||||||
return {
|
return {
|
||||||
'Code': 0,
|
'Code': 0,
|
||||||
'Error': gettext(u"'{0}' file does not exist.".format(path))
|
'Error': gettext(u"'{0}' file does not exist.").format(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
user_dir = path
|
user_dir = path
|
||||||
@@ -664,9 +664,9 @@ class Filemanager(object):
|
|||||||
Filemanager.resume_windows_warning()
|
Filemanager.resume_windows_warning()
|
||||||
if (hasattr(e, 'strerror') and
|
if (hasattr(e, 'strerror') and
|
||||||
e.strerror == gettext('Permission denied')):
|
e.strerror == gettext('Permission denied')):
|
||||||
err_msg = u"Error: {0}".format(e.strerror)
|
err_msg = gettext(u"Error: {0}").format(e.strerror)
|
||||||
else:
|
else:
|
||||||
err_msg = u"Error: {0}".format(e)
|
err_msg = gettext(u"Error: {0}").format(e)
|
||||||
files = {
|
files = {
|
||||||
'Code': 0,
|
'Code': 0,
|
||||||
'Error': err_msg
|
'Error': err_msg
|
||||||
@@ -699,7 +699,7 @@ class Filemanager(object):
|
|||||||
# Do not allow user to access outside his storage dir in server mode.
|
# Do not allow user to access outside his storage dir in server mode.
|
||||||
if not orig_path.startswith(dir):
|
if not orig_path.startswith(dir):
|
||||||
raise Exception(
|
raise Exception(
|
||||||
gettext(u"Access denied ({0})".format(path)))
|
gettext(u"Access denied ({0})").format(path))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -759,7 +759,7 @@ class Filemanager(object):
|
|||||||
'Filename': split_path(path)[-1],
|
'Filename': split_path(path)[-1],
|
||||||
'FileType': '',
|
'FileType': '',
|
||||||
'Path': path,
|
'Path': path,
|
||||||
'Error': gettext(u"Error: {0}".format(e)),
|
'Error': gettext(u"Error: {0}").format(e),
|
||||||
'Code': 0,
|
'Code': 0,
|
||||||
'Info': '',
|
'Info': '',
|
||||||
'Properties': {
|
'Properties': {
|
||||||
@@ -791,8 +791,7 @@ class Filemanager(object):
|
|||||||
|
|
||||||
if not path_exists(orig_path):
|
if not path_exists(orig_path):
|
||||||
thefile['Error'] = gettext(
|
thefile['Error'] = gettext(
|
||||||
u"'{0}' file does not exist.".format(path)
|
u"'{0}' file does not exist.").format(path)
|
||||||
)
|
|
||||||
thefile['Code'] = -1
|
thefile['Code'] = -1
|
||||||
return thefile
|
return thefile
|
||||||
|
|
||||||
@@ -844,7 +843,7 @@ class Filemanager(object):
|
|||||||
Filemanager.check_access_permission(dir, new)
|
Filemanager.check_access_permission(dir, new)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
res = {
|
res = {
|
||||||
'Error': gettext(u"Error: {0}".format(e)),
|
'Error': gettext(u"Error: {0}").format(e),
|
||||||
'Code': 0
|
'Code': 0
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
@@ -925,7 +924,7 @@ class Filemanager(object):
|
|||||||
os.remove(orig_path)
|
os.remove(orig_path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
code = 0
|
code = 0
|
||||||
err_msg = u"Error: {0}".format(e.strerror)
|
err_msg = gettext(u"Error: {0}").format(e.strerror)
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
'Path': path,
|
'Path': path,
|
||||||
@@ -969,14 +968,14 @@ class Filemanager(object):
|
|||||||
f.write(data)
|
f.write(data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
code = 0
|
code = 0
|
||||||
err_msg = u"Error: {0}".format(
|
err_msg = gettext(u"Error: {0}").format(
|
||||||
e.strerror if hasattr(e, 'strerror') else u'Unknown')
|
e.strerror if hasattr(e, 'strerror') else gettext(u'Unknown'))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
Filemanager.check_access_permission(dir, path)
|
Filemanager.check_access_permission(dir, path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
res = {
|
res = {
|
||||||
'Error': gettext(u"Error: {0}".format(e)),
|
'Error': gettext(u"Error: {0}").format(e),
|
||||||
'Code': 0
|
'Code': 0
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
@@ -1013,9 +1012,9 @@ class Filemanager(object):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
code = 0
|
code = 0
|
||||||
if hasattr(e, 'strerror'):
|
if hasattr(e, 'strerror'):
|
||||||
err_msg = u"Error: {0}".format(e.strerror)
|
err_msg = gettext(u"Error: {0}").format(e.strerror)
|
||||||
else:
|
else:
|
||||||
err_msg = u"Error: {0}".format(e)
|
err_msg = gettext(u"Error: {0}").format(e)
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
'Path': path,
|
'Path': path,
|
||||||
@@ -1098,13 +1097,13 @@ class Filemanager(object):
|
|||||||
# we don't want to expose real path of file
|
# we don't want to expose real path of file
|
||||||
# so only show error message.
|
# so only show error message.
|
||||||
if ex.strerror == 'Permission denied':
|
if ex.strerror == 'Permission denied':
|
||||||
err_msg = u"Error: {0}".format(ex.strerror)
|
err_msg = gettext(u"Error: {0}").format(ex.strerror)
|
||||||
else:
|
else:
|
||||||
err_msg = u"Error: {0}".format(str(ex))
|
err_msg = gettext(u"Error: {0}").format(str(ex))
|
||||||
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
status = False
|
status = False
|
||||||
err_msg = u"Error: {0}".format(str(ex))
|
err_msg = gettext(u"Error: {0}").format(str(ex))
|
||||||
|
|
||||||
# Remove root storage path from error message
|
# Remove root storage path from error message
|
||||||
# when running in Server mode
|
# when running in Server mode
|
||||||
@@ -1150,14 +1149,14 @@ class Filemanager(object):
|
|||||||
os.mkdir(newPath)
|
os.mkdir(newPath)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
code = 0
|
code = 0
|
||||||
err_msg = u"Error: {0}".format(e.strerror)
|
err_msg = gettext(u"Error: {0}").format(e.strerror)
|
||||||
else:
|
else:
|
||||||
newPath, newName = self.getNewName(dir, path, name)
|
newPath, newName = self.getNewName(dir, path, name)
|
||||||
try:
|
try:
|
||||||
os.mkdir(newPath)
|
os.mkdir(newPath)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
code = 0
|
code = 0
|
||||||
err_msg = u"Error: {0}".format(e.strerror)
|
err_msg = gettext(u"Error: {0}").format(e.strerror)
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
'Parent': path,
|
'Parent': path,
|
||||||
@@ -1191,7 +1190,7 @@ class Filemanager(object):
|
|||||||
dir, u"{}{}".format(path, path)
|
dir, u"{}{}".format(path, path)
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
resp = Response(gettext(u"Error: {0}".format(e)))
|
resp = Response(gettext(u"Error: {0}").format(e))
|
||||||
resp.headers['Content-Disposition'] = \
|
resp.headers['Content-Disposition'] = \
|
||||||
'attachment; filename=' + name
|
'attachment; filename=' + name
|
||||||
return resp
|
return resp
|
||||||
@@ -1208,7 +1207,7 @@ class Filemanager(object):
|
|||||||
try:
|
try:
|
||||||
Filemanager.check_access_permission(dir, path)
|
Filemanager.check_access_permission(dir, path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
err_msg = u"Error: {0}".format(e)
|
err_msg = gettext(u"Error: {0}").format(e)
|
||||||
res['Code'] = 0
|
res['Code'] = 0
|
||||||
res['Error'] = err_msg
|
res['Error'] = err_msg
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ module.exports = Alertify.dialog('fileSelectionDlg', function() {
|
|||||||
// Set title and button name
|
// Set title and button name
|
||||||
var self = this;
|
var self = this;
|
||||||
if (_.isUndefined(params['dialog_title'])) {
|
if (_.isUndefined(params['dialog_title'])) {
|
||||||
params['dialog_title'] = 'Select file';
|
params['dialog_title'] = gettext('Select file');
|
||||||
}
|
}
|
||||||
self.dialog_type = params['dialog_type'];
|
self.dialog_type = params['dialog_type'];
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import Backbone from 'backbone';
|
import Backbone from 'backbone';
|
||||||
|
import gettext from 'sources/gettext';
|
||||||
|
|
||||||
// Backbone model for other statistics
|
// Backbone model for other statistics
|
||||||
let StatisticsModel = Backbone.Model.extend({
|
let StatisticsModel = Backbone.Model.extend({
|
||||||
@@ -34,7 +35,7 @@ let StatisticsModel = Backbone.Model.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (Object.keys(jit_stats).length > 0){
|
if (Object.keys(jit_stats).length > 0){
|
||||||
tooltip.append('<tr><td class="label explain-tooltip">JIT:</td></tr>');
|
tooltip.append('<tr><td class="label explain-tooltip">' + gettext('JIT:') + '</td></tr>');
|
||||||
_.each(jit_stats, function(value, key) {
|
_.each(jit_stats, function(value, key) {
|
||||||
key = _.escape(key);
|
key = _.escape(key);
|
||||||
value = _.escape(value);
|
value = _.escape(value);
|
||||||
@@ -48,7 +49,7 @@ let StatisticsModel = Backbone.Model.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(triggers_stats).length > 0){
|
if (Object.keys(triggers_stats).length > 0){
|
||||||
tooltip.append('<tr><td class="label explain-tooltip">Triggers:</td></tr>');
|
tooltip.append('<tr><td class="label explain-tooltip">' + gettext('Triggers:') + '</td></tr>');
|
||||||
_.each(triggers_stats, function(triggers, key_id) {
|
_.each(triggers_stats, function(triggers, key_id) {
|
||||||
if (triggers instanceof Object) {
|
if (triggers instanceof Object) {
|
||||||
_.each(triggers, function(value, key) {
|
_.each(triggers, function(value, key) {
|
||||||
@@ -87,7 +88,7 @@ let StatisticsModel = Backbone.Model.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(summary).length > 0){
|
if (Object.keys(summary).length > 0){
|
||||||
tooltip.append('<tr><td class="label explain-tooltip">Summary:</td></tr>');
|
tooltip.append('<tr><td class="label explain-tooltip">' + gettext('Summary:') + '</td></tr>');
|
||||||
_.each(summary, function(value, key) {
|
_.each(summary, function(value, key) {
|
||||||
key = _.escape(key);
|
key = _.escape(key);
|
||||||
value = _.escape(value);
|
value = _.escape(value);
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import gettext from '../gettext';
|
import gettext from '../gettext';
|
||||||
import {sprintf} from 'sources/utils';
|
|
||||||
import {DialogFactory} from './dialog_factory';
|
import {DialogFactory} from './dialog_factory';
|
||||||
import Backform from '../backform.pgadmin';
|
import Backform from '../backform.pgadmin';
|
||||||
import {getTreeNodeHierarchyFromIdentifier} from '../tree/pgadmin_tree_node';
|
import {getTreeNodeHierarchyFromIdentifier} from '../tree/pgadmin_tree_node';
|
||||||
@@ -133,7 +132,7 @@ export class Dialog {
|
|||||||
} else {
|
} else {
|
||||||
this.alertify.alert(
|
this.alertify.alert(
|
||||||
gettext(this.errorAlertTitle),
|
gettext(this.errorAlertTitle),
|
||||||
sprintf(gettext('Failed to load preference %s of module %s'), preference_name, module)
|
gettext('Failed to load preference %s of module %s', preference_name, module)
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -586,7 +586,7 @@ define([
|
|||||||
'<span class="<%=controlLabelClassName%>"><%=label%></span>',
|
'<span class="<%=controlLabelClassName%>"><%=label%></span>',
|
||||||
'<label class="sr-value sr-only" for="<%=cId%>"></label>',
|
'<label class="sr-value sr-only" for="<%=cId%>"></label>',
|
||||||
'<div class="<%=controlsClassName%> <%=extraClasses.join(\' \')%>">',
|
'<div class="<%=controlsClassName%> <%=extraClasses.join(\' \')%>">',
|
||||||
' <input tabindex="-1" type="checkbox" aria-hidden="true" aria-label="Toggle button" data-style="quick" data-toggle="toggle"',
|
' <input tabindex="-1" type="checkbox" aria-hidden="true" aria-label="' + gettext('Toggle button') + '" data-style="quick" data-toggle="toggle"',
|
||||||
' data-size="<%=options.size%>" data-height="<%=options.height%>" ',
|
' data-size="<%=options.size%>" data-height="<%=options.height%>" ',
|
||||||
' data-on="<%=options.onText%>" data-off="<%=options.offText%>" ',
|
' data-on="<%=options.onText%>" data-off="<%=options.offText%>" ',
|
||||||
' data-onstyle="<%=options.onColor%>" data-offstyle="<%=options.offColor%>" data-width="<%=options.width%>" ',
|
' data-onstyle="<%=options.onColor%>" data-offstyle="<%=options.offColor%>" data-width="<%=options.width%>" ',
|
||||||
@@ -2723,7 +2723,7 @@ define([
|
|||||||
'<div class="input-group">',
|
'<div class="input-group">',
|
||||||
'<input type="<%=type%>" id="<%=cId%>" class="form-control <%=extraClasses.join(\' \')%>" name="<%=name%>" min="<%=min%>" max="<%=max%>"maxlength="<%=maxlength%>" value="<%-value%>" placeholder="<%-placeholder%>" <%=disabled ? "disabled" : ""%> <%=readonly ? "readonly aria-readonly=true" : ""%> <%=required ? "required" : ""%> />',
|
'<input type="<%=type%>" id="<%=cId%>" class="form-control <%=extraClasses.join(\' \')%>" name="<%=name%>" min="<%=min%>" max="<%=max%>"maxlength="<%=maxlength%>" value="<%-value%>" placeholder="<%-placeholder%>" <%=disabled ? "disabled" : ""%> <%=readonly ? "readonly aria-readonly=true" : ""%> <%=required ? "required" : ""%> />',
|
||||||
'<div class="input-group-append">',
|
'<div class="input-group-append">',
|
||||||
'<button class="btn btn-secondary fa fa-ellipsis-h select_item" <%=disabled ? "disabled" : ""%> <%=readonly ? "disabled" : ""%> aria-hidden="true" aria-label="Select file" title="Select file"></button>',
|
'<button class="btn btn-secondary fa fa-ellipsis-h select_item" <%=disabled ? "disabled" : ""%> <%=readonly ? "disabled" : ""%> aria-hidden="true" aria-label="' + gettext('Select file') + '" title="' + gettext('Select file') + '"></button>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'<% if (helpMessage && helpMessage.length) { %>',
|
'<% if (helpMessage && helpMessage.length) { %>',
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export function initialize(pgBrowser, gettext) {
|
|||||||
mode: ['properties'],
|
mode: ['properties'],
|
||||||
}, {
|
}, {
|
||||||
id: 'format_option',
|
id: 'format_option',
|
||||||
label: gettext('Format Optionos'),
|
label: gettext('Format Options'),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
mode: ['properties'],
|
mode: ['properties'],
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
import {calculateQueryRunTime} from './calculate_query_run_time';
|
import {calculateQueryRunTime} from './calculate_query_run_time';
|
||||||
import gettext from '../gettext';
|
import gettext from '../gettext';
|
||||||
import {sprintf} from 'sources/utils';
|
|
||||||
|
|
||||||
function hasResultsToDisplay(res) {
|
function hasResultsToDisplay(res) {
|
||||||
return res.colinfo != null;
|
return res.colinfo != null;
|
||||||
@@ -34,8 +33,7 @@ export function callRenderAfterPoll(sqlEditor, alertify, res) {
|
|||||||
sqlEditor.total_time = calculateQueryRunTime(
|
sqlEditor.total_time = calculateQueryRunTime(
|
||||||
sqlEditor.query_start_time,
|
sqlEditor.query_start_time,
|
||||||
sqlEditor.query_end_time);
|
sqlEditor.query_end_time);
|
||||||
const msg = sprintf(
|
const msg = gettext('Query returned successfully in %s.', sqlEditor.total_time);
|
||||||
gettext('Query returned successfully in %s.'), sqlEditor.total_time);
|
|
||||||
if (res.result)
|
if (res.result)
|
||||||
res.result += '\n\n' + msg;
|
res.result += '\n\n' + msg;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ class ExecuteQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initializeExecutionOnSqlEditor(sqlStatement) {
|
initializeExecutionOnSqlEditor(sqlStatement) {
|
||||||
this.loadingScreen.show('Running query...');
|
this.loadingScreen.show(gettext('Running query...'));
|
||||||
|
|
||||||
$('#btn-flash').prop('disabled', true);
|
$('#btn-flash').prop('disabled', true);
|
||||||
$('#btn-download').prop('disabled', true);
|
$('#btn-download').prop('disabled', true);
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ function parseData(items, columns, columnIndex, GeometryLib) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mixedSRID) {
|
if (mixedSRID) {
|
||||||
infoList.push(gettext('Geometries with non-SRID') + selectedSRID + ' not rendered.');
|
infoList.push(gettext('Geometries with non-SRID %s not rendered.', selectedSRID));
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -115,18 +115,10 @@ let queryToolNotifications = {
|
|||||||
for (let i in notify_messages) {
|
for (let i in notify_messages) {
|
||||||
let notify_msg = '';
|
let notify_msg = '';
|
||||||
if (notify_messages[i].payload != '') {
|
if (notify_messages[i].payload != '') {
|
||||||
notify_msg = gettext('Asynchronous notification "')
|
notify_msg = gettext('Asynchronous notification "%s" with payload "%s" received from server process with PID %s', notify_messages[i].channel, notify_messages[i].payload, notify_messages[i].pid);
|
||||||
+ notify_messages[i].channel
|
|
||||||
+ gettext('" with payload "')
|
|
||||||
+ notify_messages[i].payload
|
|
||||||
+ gettext('" received from server process with PID ')
|
|
||||||
+ notify_messages[i].pid;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
notify_msg = gettext('Asynchronous notification "')
|
notify_msg = gettext('Asynchronous notification "%s" received from server process with PID %s', notify_messages[i].channel, notify_messages[i].pid);
|
||||||
+ notify_messages[i].channel
|
|
||||||
+ gettext('" received from server process with PID ')
|
|
||||||
+ notify_messages[i].pid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Alertify.info(notify_msg);
|
Alertify.info(notify_msg);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ function updateUIPreferences(sqlEditor) {
|
|||||||
.attr('accesskey', shortcut_key(preferences.btn_conn_status))
|
.attr('accesskey', shortcut_key(preferences.btn_conn_status))
|
||||||
.find('i')
|
.find('i')
|
||||||
.attr('title',
|
.attr('title',
|
||||||
shortcut_accesskey_title('Connection status (click for details)',
|
shortcut_accesskey_title(gettext('Connection status (click for details)'),
|
||||||
preferences.btn_conn_status));
|
preferences.btn_conn_status));
|
||||||
|
|
||||||
/* Accessed using ctrl,atl,shift and key */
|
/* Accessed using ctrl,atl,shift and key */
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import axios from 'axios/index';
|
|||||||
|
|
||||||
export class BackupDialog extends Dialog {
|
export class BackupDialog extends Dialog {
|
||||||
constructor(pgBrowser, $, alertify, BackupModel, backform = Backform) {
|
constructor(pgBrowser, $, alertify, BackupModel, backform = Backform) {
|
||||||
super('Backup Error',
|
super(gettext('Backup Error'),
|
||||||
'<div class=\'backup_dialog\'></div>',
|
'<div class=\'backup_dialog\'></div>',
|
||||||
pgBrowser, $, alertify, BackupModel, backform
|
pgBrowser, $, alertify, BackupModel, backform
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export function showDataGrid(
|
|||||||
|
|
||||||
$.get(url_for('datagrid.filter'),
|
$.get(url_for('datagrid.filter'),
|
||||||
function(data) {
|
function(data) {
|
||||||
alertify.filterDialog(`Data Filter - ${queryToolTitle}`, data, validateUrl, preferences, okCallback)
|
alertify.filterDialog(gettext('Data Filter - %s', queryToolTitle), data, validateUrl, preferences, okCallback)
|
||||||
.resizeTo(pgBrowser.stdW.sm,pgBrowser.stdH.sm);
|
.resizeTo(pgBrowser.stdW.sm,pgBrowser.stdH.sm);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -891,8 +891,8 @@ def start_debugger_listener(trans_id):
|
|||||||
data={
|
data={
|
||||||
'status': False,
|
'status': False,
|
||||||
'result': gettext(
|
'result': gettext(
|
||||||
'Not connected to server or connection with the server has'
|
'Not connected to server or connection with the server '
|
||||||
'been closed.'
|
'has been closed.'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1909,33 +1909,33 @@ define([
|
|||||||
|
|
||||||
/* Update the shortcuts of the buttons */
|
/* Update the shortcuts of the buttons */
|
||||||
self.toolbarView.$el.find('#btn-step-into')
|
self.toolbarView.$el.find('#btn-step-into')
|
||||||
.attr('title', keyboardShortcuts.shortcut_accesskey_title('Step into',self.preferences.btn_step_into))
|
.attr('title', keyboardShortcuts.shortcut_accesskey_title(gettext('Step into'),self.preferences.btn_step_into))
|
||||||
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title('Step into',self.preferences.btn_step_into))
|
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title(gettext('Step into'),self.preferences.btn_step_into))
|
||||||
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_step_into));
|
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_step_into));
|
||||||
|
|
||||||
self.toolbarView.$el.find('#btn-step-over')
|
self.toolbarView.$el.find('#btn-step-over')
|
||||||
.attr('title', keyboardShortcuts.shortcut_accesskey_title('Step over',self.preferences.btn_step_over))
|
.attr('title', keyboardShortcuts.shortcut_accesskey_title(gettext('Step over'),self.preferences.btn_step_over))
|
||||||
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title('Step over',self.preferences.btn_step_over))
|
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title(gettext('Step over'),self.preferences.btn_step_over))
|
||||||
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_step_over));
|
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_step_over));
|
||||||
|
|
||||||
self.toolbarView.$el.find('#btn-continue')
|
self.toolbarView.$el.find('#btn-continue')
|
||||||
.attr('title', keyboardShortcuts.shortcut_accesskey_title('Continue/Start',self.preferences.btn_start))
|
.attr('title', keyboardShortcuts.shortcut_accesskey_title(gettext('Continue/Start'),self.preferences.btn_start))
|
||||||
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title('Continue/Start',self.preferences.btn_start))
|
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title(gettext('Continue/Start'),self.preferences.btn_start))
|
||||||
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_start));
|
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_start));
|
||||||
|
|
||||||
self.toolbarView.$el.find('#btn-toggle-breakpoint')
|
self.toolbarView.$el.find('#btn-toggle-breakpoint')
|
||||||
.attr('title', keyboardShortcuts.shortcut_accesskey_title('Toggle breakpoint',self.preferences.btn_toggle_breakpoint))
|
.attr('title', keyboardShortcuts.shortcut_accesskey_title(gettext('Toggle breakpoint'),self.preferences.btn_toggle_breakpoint))
|
||||||
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title('Toggle breakpoint',self.preferences.btn_toggle_breakpoint))
|
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title(gettext('Toggle breakpoint'),self.preferences.btn_toggle_breakpoint))
|
||||||
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_toggle_breakpoint));
|
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_toggle_breakpoint));
|
||||||
|
|
||||||
self.toolbarView.$el.find('#btn-clear-breakpoint')
|
self.toolbarView.$el.find('#btn-clear-breakpoint')
|
||||||
.attr('title', keyboardShortcuts.shortcut_accesskey_title('Clear all breakpoints',self.preferences.btn_clear_breakpoints))
|
.attr('title', keyboardShortcuts.shortcut_accesskey_title(gettext('Clear all breakpoints'),self.preferences.btn_clear_breakpoints))
|
||||||
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title('Clear all breakpoints',self.preferences.btn_clear_breakpoints))
|
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title(gettext('Clear all breakpoints'),self.preferences.btn_clear_breakpoints))
|
||||||
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_clear_breakpoints));
|
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_clear_breakpoints));
|
||||||
|
|
||||||
self.toolbarView.$el.find('#btn-stop')
|
self.toolbarView.$el.find('#btn-stop')
|
||||||
.attr('title', keyboardShortcuts.shortcut_accesskey_title('Stop',self.preferences.btn_stop))
|
.attr('title', keyboardShortcuts.shortcut_accesskey_title(gettext('Stop'),self.preferences.btn_stop))
|
||||||
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title('Stop',self.preferences.btn_stop))
|
.attr('aria-label', keyboardShortcuts.shortcut_accesskey_title(gettext('Stop'),self.preferences.btn_stop))
|
||||||
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_stop));
|
.attr('accesskey', keyboardShortcuts.shortcut_key(self.preferences.btn_stop));
|
||||||
},
|
},
|
||||||
// Register the panel with new debugger docker instance.
|
// Register the panel with new debugger docker instance.
|
||||||
|
|||||||
@@ -713,7 +713,7 @@ define([
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text fa fa-search" id="labelSearch"></span>
|
<span class="input-group-text fa fa-search" id="labelSearch"></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="search" class="form-control" id="txtGridSearch" placeholder="` + gettext('Search') + `" aria-label="Search" aria-describedby="labelSearch">
|
<input type="search" class="form-control" id="txtGridSearch" placeholder="` + gettext('Search') + '" aria-label="' + gettext('Search') + `" aria-describedby="labelSearch">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ define([
|
|||||||
multiple: true,
|
multiple: true,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
first_empty: false,
|
first_empty: false,
|
||||||
placeholder: gettext('Colums for exporting...'),
|
placeholder: gettext('Columns for exporting...'),
|
||||||
preserveSelectionOrder: true,
|
preserveSelectionOrder: true,
|
||||||
},
|
},
|
||||||
visible: 'exporting',
|
visible: 'exporting',
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import gettext from '../../../../static/js/gettext';
|
import gettext from '../../../../static/js/gettext';
|
||||||
import {sprintf} from 'sources/utils';
|
|
||||||
import Backform from '../../../../static/js/backform.pgadmin';
|
import Backform from '../../../../static/js/backform.pgadmin';
|
||||||
import {Dialog} from '../../../../static/js/alertify/dialog';
|
import {Dialog} from '../../../../static/js/alertify/dialog';
|
||||||
import url_for from 'sources/url_for';
|
import url_for from 'sources/url_for';
|
||||||
@@ -16,7 +15,7 @@ import axios from 'axios/index';
|
|||||||
|
|
||||||
export class RestoreDialog extends Dialog {
|
export class RestoreDialog extends Dialog {
|
||||||
constructor(pgBrowser, $, alertify, RestoreModel, backform = Backform) {
|
constructor(pgBrowser, $, alertify, RestoreModel, backform = Backform) {
|
||||||
super('Restore Error',
|
super(gettext('Restore Error'),
|
||||||
'<div class=\'restore_dialog\'></div>',
|
'<div class=\'restore_dialog\'></div>',
|
||||||
pgBrowser, $, alertify, RestoreModel, backform);
|
pgBrowser, $, alertify, RestoreModel, backform);
|
||||||
}
|
}
|
||||||
@@ -66,7 +65,7 @@ export class RestoreDialog extends Dialog {
|
|||||||
if (!node)
|
if (!node)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let title = sprintf(gettext('Restore (%s: %s)'), node.label, data.label);
|
let title = gettext('Restore (%s: %s)', node.label, data.label);
|
||||||
that.createOrGetDialog(title, 'restore');
|
that.createOrGetDialog(title, 'restore');
|
||||||
that.alertify.pg_restore(title, aciTreeItem1, data, node)
|
that.alertify.pg_restore(title, aciTreeItem1, data, node)
|
||||||
.resizeTo(width, height);
|
.resizeTo(width, height);
|
||||||
|
|||||||
@@ -1296,10 +1296,10 @@ def save_file():
|
|||||||
else:
|
else:
|
||||||
output_file.write(file_content)
|
output_file.write(file_content)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
err_msg = "Error: {0}".format(e.strerror)
|
err_msg = gettext("Error: {0}").format(e.strerror)
|
||||||
return internal_server_error(errormsg=err_msg)
|
return internal_server_error(errormsg=err_msg)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
err_msg = "Error: {0}".format(e.strerror)
|
err_msg = gettext("Error: {0}").format(e.strerror)
|
||||||
return internal_server_error(errormsg=err_msg)
|
return internal_server_error(errormsg=err_msg)
|
||||||
|
|
||||||
return make_json_response(
|
return make_json_response(
|
||||||
@@ -1371,7 +1371,7 @@ def start_query_download_tool(trans_id):
|
|||||||
|
|
||||||
return r
|
return r
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
err_msg = "Error: {0}".format(e.strerror)
|
err_msg = gettext("Error: {0}").format(e.strerror)
|
||||||
return internal_server_error(errormsg=err_msg)
|
return internal_server_error(errormsg=err_msg)
|
||||||
else:
|
else:
|
||||||
return internal_server_error(
|
return internal_server_error(
|
||||||
|
|||||||
@@ -3331,8 +3331,8 @@ define('tools.querytool', [
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
).set('labels', {
|
).set('labels', {
|
||||||
ok: 'Yes',
|
ok: gettext('Yes'),
|
||||||
cancel: 'No',
|
cancel: gettext('No'),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
self._open_select_file_manager();
|
self._open_select_file_manager();
|
||||||
@@ -4275,7 +4275,7 @@ define('tools.querytool', [
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
let msg = gettext('The current transaction is not commited to the database.'
|
let msg = gettext('The current transaction is not commited to the database. '
|
||||||
+ 'Do you want to commit or rollback the transaction?');
|
+ 'Do you want to commit or rollback the transaction?');
|
||||||
|
|
||||||
alertify.confirmCommit(gettext('Commit transaction?'), msg, is_commit_disabled);
|
alertify.confirmCommit(gettext('Commit transaction?'), msg, is_commit_disabled);
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ def create_user(data):
|
|||||||
if f in data and data[f] != '':
|
if f in data and data[f] != '':
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
return False, _("Missing field: '{0}'".format(f))
|
return False, _("Missing field: '{0}'").format(f)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
new_data = validate_user(data)
|
new_data = validate_user(data)
|
||||||
|
|||||||
@@ -869,9 +869,9 @@ define([
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text fa fa-search" id="labelSearch"></span>
|
<span class="input-group-text fa fa-search" id="labelSearch"></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="search" class="form-control" id="txtGridSearch" placeholder="` + gettext('Search') + `" aria-label="Search" aria-describedby="labelSearch" />
|
<input type="search" class="form-control" id="txtGridSearch" placeholder="` + gettext('Search') + '" aria-label="' + gettext('Search') + `" aria-describedby="labelSearch" />
|
||||||
</div>
|
</div>
|
||||||
<button id="btn_refresh" type="button" class="btn btn-secondary btn-navtab-inline add" title="Add">
|
<button id="btn_refresh" type="button" class="btn btn-secondary btn-navtab-inline add" title="` + gettext('Add') + `">
|
||||||
<span class="fa fa-plus "></span>
|
<span class="fa fa-plus "></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1745,7 +1745,7 @@ Failed to reset the connection to the server due to following error:
|
|||||||
# Do not append if error starts with `ERROR:` as most pg related
|
# Do not append if error starts with `ERROR:` as most pg related
|
||||||
# error starts with `ERROR:`
|
# error starts with `ERROR:`
|
||||||
if not errmsg.startswith(u'ERROR:'):
|
if not errmsg.startswith(u'ERROR:'):
|
||||||
errmsg = u'ERROR: ' + errmsg + u'\n\n'
|
errmsg = gettext(u'ERROR: ') + errmsg + u'\n\n'
|
||||||
|
|
||||||
if exception_obj.diag.severity is not None \
|
if exception_obj.diag.severity is not None \
|
||||||
and exception_obj.diag.message_primary is not None:
|
and exception_obj.diag.message_primary is not None:
|
||||||
|
|||||||
@@ -159,17 +159,17 @@ class ServerManager(object):
|
|||||||
def MajorVersion(self):
|
def MajorVersion(self):
|
||||||
if self.sversion is not None:
|
if self.sversion is not None:
|
||||||
return int(self.sversion / 10000)
|
return int(self.sversion / 10000)
|
||||||
raise Exception("Information is not available.")
|
raise Exception(gettext("Information is not available."))
|
||||||
|
|
||||||
def MinorVersion(self):
|
def MinorVersion(self):
|
||||||
if self.sversion:
|
if self.sversion:
|
||||||
return int(int(self.sversion / 100) % 100)
|
return int(int(self.sversion / 100) % 100)
|
||||||
raise Exception("Information is not available.")
|
raise Exception(gettext("Information is not available."))
|
||||||
|
|
||||||
def PatchVersion(self):
|
def PatchVersion(self):
|
||||||
if self.sversion:
|
if self.sversion:
|
||||||
return int(int(self.sversion / 100) / 100)
|
return int(int(self.sversion / 100) / 100)
|
||||||
raise Exception("Information is not available.")
|
raise Exception(gettext("Information is not available."))
|
||||||
|
|
||||||
def connection(
|
def connection(
|
||||||
self, database=None, conn_id=None, auto_reconnect=True, did=None,
|
self, database=None, conn_id=None, auto_reconnect=True, did=None,
|
||||||
@@ -492,8 +492,8 @@ WHERE db.oid = {0}""".format(did))
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
current_app.logger.exception(e)
|
current_app.logger.exception(e)
|
||||||
return False, "Failed to decrypt the SSH tunnel " \
|
return False, gettext("Failed to decrypt the SSH tunnel "
|
||||||
"password.\nError: {0}".format(str(e))
|
"password.\nError: {0}").format(str(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# If authentication method is 1 then it uses identity file
|
# If authentication method is 1 then it uses identity file
|
||||||
@@ -518,8 +518,8 @@ WHERE db.oid = {0}""".format(did))
|
|||||||
self.tunnel_created = True
|
self.tunnel_created = True
|
||||||
except BaseSSHTunnelForwarderError as e:
|
except BaseSSHTunnelForwarderError as e:
|
||||||
current_app.logger.exception(e)
|
current_app.logger.exception(e)
|
||||||
return False, "Failed to create the SSH tunnel." \
|
return False, gettext("Failed to create the SSH tunnel.\n"
|
||||||
"\nError: {0}".format(str(e))
|
"Error: {0}").format(str(e))
|
||||||
|
|
||||||
# Update the port to communicate locally
|
# Update the port to communicate locally
|
||||||
self.local_bind_port = self.tunnel_object.local_bind_port
|
self.local_bind_port = self.tunnel_object.local_bind_port
|
||||||
|
|||||||
Reference in New Issue
Block a user