translation errors in several msgprint (#3438)

* translation errors in several msgprint

* small fixes

* fixes
This commit is contained in:
almeidapaulopt 2017-06-06 11:14:59 +01:00 committed by Makarand Bauskar
parent 5b5f570ebc
commit 020851d4f7
11 changed files with 17 additions and 16 deletions

View file

@ -25,4 +25,4 @@ def restore(name):
deleted.restored = 1
deleted.save()
frappe.msgprint('Document Restored')
frappe.msgprint(_('Document Restored'))

View file

@ -129,7 +129,7 @@ def get_feedback_request_details(reference_doctype, reference_name, trigger="Man
"message": feedback_request_message,
}
else:
frappe.msgprint("Feedback conditions do not match")
frappe.msgprint(_("Feedback conditions do not match"))
return None
def get_feedback_request_url(reference_doctype, reference_name, recipients, trigger="Manual"):

View file

@ -198,7 +198,7 @@ class File(NestedSet):
thumbnail.save(path)
self.db_set("thumbnail_url", thumbnail_url)
except IOError:
frappe.msgprint("Unable to write file format for {0}".format(path))
frappe.msgprint(_("Unable to write file format for {0}").format(path))
return
return thumbnail_url
@ -343,7 +343,7 @@ def get_local_image(file_url):
try:
image = Image.open(file_path)
except IOError:
frappe.msgprint("Unable to read file format for {0}".format(file_url))
frappe.msgprint(_("Unable to read file format for {0}").format(file_url))
raise
content = None
@ -372,7 +372,7 @@ def get_web_image(file_url):
if "404" in e.args[0]:
frappe.msgprint(_("File '{0}' not found").format(file_url))
else:
frappe.msgprint("Unable to read file format for {0}".format(file_url))
frappe.msgprint(_("Unable to read file format for {0}").format(file_url))
raise
image = Image.open(StringIO.StringIO(r.content))

View file

@ -11,6 +11,7 @@ import frappe
import frappe.database
import getpass
import importlib
from frappe import _
from frappe.model.db_schema import DbManager
from frappe.model.sync import sync_for
from frappe.utils.fixtures import sync_fixtures
@ -121,7 +122,7 @@ def install_app(name, verbose=False, set_as_patched=True):
raise Exception("App not in apps.txt")
if name in installed_apps:
frappe.msgprint("App {0} already installed".format(name))
frappe.msgprint(_("App {0} already installed").format(name))
return
print("Installing {0}...".format(name))

View file

@ -72,7 +72,7 @@ def export_customizations(module, doctype, sync_on_migrate=0, with_permissions=0
with open(path, 'w') as f:
f.write(frappe.as_json(custom))
frappe.msgprint('Customizations exported to {0}'.format(path))
frappe.msgprint(_('Customizations exported to {0}').format(path))
def sync_customizations(app=None):
'''Sync custom fields and property setters from custom folder in each app module'''

View file

@ -693,7 +693,7 @@ frappe.views.ListView = frappe.ui.BaseList.extend({
});
if (invalid_docs.length >= 1) {
frappe.msgprint('You selected Draft or Cancelled documents')
frappe.msgprint(__('You selected Draft or Cancelled documents'))
return;
}

View file

@ -514,7 +514,7 @@ frappe.utils = {
},
warn_page_name_change: function(frm) {
frappe.msgprint("Note: Changing the Page Name will break previous URL to this page.");
frappe.msgprint(__("Note: Changing the Page Name will break previous URL to this page."));
},
notify: function(subject, body, route, onclick) {

View file

@ -166,10 +166,10 @@ frappe.views.GalleryView = Class.extend({
]
},
freeze: true,
freeze_message: "Fetching Images.."
freeze_message: __("Fetching Images..")
}).then(function(r) {
if (!r.message) {
frappe.msgprint("No Images found")
frappe.msgprint(__("No Images found"))
} else {
// filter image files from other
var images = r.message.filter(function(image) {

View file

@ -277,7 +277,7 @@ _f.Frm.prototype.set_value = function(field, value, if_missing) {
}
}
} else {
frappe.msgprint("Field " + f + " not found.");
frappe.msgprint(__("Field {0} not found.",[f]));
throw "frm.set_value";
}
}

View file

@ -93,12 +93,12 @@
}
if(!args.comment_by_fullname || !args.comment_by || !args.comment) {
frappe.msgprint("All fields are necessary to submit the comment.")
frappe.msgprint(__("All fields are necessary to submit the comment."));
return false;
}
if (args.comment_by!=='Administrator' && !valid_email(args.comment_by)) {
frappe.msgprint("Please enter a valid email address.");
frappe.msgprint(__("Please enter a valid email address."));
return false;
}

View file

@ -52,11 +52,11 @@ frappe.ready(function() {
}
if(!args.old_password && !args.key) {
frappe.msgprint("Old Password Required.");
frappe.msgprint(__("Old Password Required."));
return;
}
if(!args.new_password) {
frappe.msgprint("New Password Required.")
frappe.msgprint(__("New Password Required."))
return;
}