diff --git a/frappe/core/doctype/deleted_document/deleted_document.py b/frappe/core/doctype/deleted_document/deleted_document.py index 3be4566910..75e293dd61 100644 --- a/frappe/core/doctype/deleted_document/deleted_document.py +++ b/frappe/core/doctype/deleted_document/deleted_document.py @@ -25,4 +25,4 @@ def restore(name): deleted.restored = 1 deleted.save() - frappe.msgprint('Document Restored') \ No newline at end of file + frappe.msgprint(_('Document Restored')) \ No newline at end of file diff --git a/frappe/core/doctype/feedback_trigger/feedback_trigger.py b/frappe/core/doctype/feedback_trigger/feedback_trigger.py index 9a3abc32e7..6b9ca3e46a 100644 --- a/frappe/core/doctype/feedback_trigger/feedback_trigger.py +++ b/frappe/core/doctype/feedback_trigger/feedback_trigger.py @@ -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"): diff --git a/frappe/core/doctype/file/file.py b/frappe/core/doctype/file/file.py index fa1c79eb3c..f56ef12c32 100755 --- a/frappe/core/doctype/file/file.py +++ b/frappe/core/doctype/file/file.py @@ -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)) diff --git a/frappe/installer.py b/frappe/installer.py index f4a4b1a711..8b061428e3 100755 --- a/frappe/installer.py +++ b/frappe/installer.py @@ -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)) diff --git a/frappe/modules/utils.py b/frappe/modules/utils.py index 97c8c31b7f..e5f1bac707 100644 --- a/frappe/modules/utils.py +++ b/frappe/modules/utils.py @@ -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''' diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index af811faa4b..ac0edf2e49 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -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; } diff --git a/frappe/public/js/frappe/misc/utils.js b/frappe/public/js/frappe/misc/utils.js index 1ac16538fc..aee81ce30f 100644 --- a/frappe/public/js/frappe/misc/utils.js +++ b/frappe/public/js/frappe/misc/utils.js @@ -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) { diff --git a/frappe/public/js/frappe/views/image/image_view.js b/frappe/public/js/frappe/views/image/image_view.js index 9113ff146f..5656c3e78e 100644 --- a/frappe/public/js/frappe/views/image/image_view.js +++ b/frappe/public/js/frappe/views/image/image_view.js @@ -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) { diff --git a/frappe/public/js/legacy/clientscriptAPI.js b/frappe/public/js/legacy/clientscriptAPI.js index 7a4af8222e..326f4e075f 100644 --- a/frappe/public/js/legacy/clientscriptAPI.js +++ b/frappe/public/js/legacy/clientscriptAPI.js @@ -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"; } } diff --git a/frappe/templates/includes/comments/comments.html b/frappe/templates/includes/comments/comments.html index 3dcecf5139..0914736a7b 100644 --- a/frappe/templates/includes/comments/comments.html +++ b/frappe/templates/includes/comments/comments.html @@ -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; } diff --git a/frappe/www/update-password.html b/frappe/www/update-password.html index fa2fd0c8e4..1a12ad5409 100644 --- a/frappe/www/update-password.html +++ b/frappe/www/update-password.html @@ -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; }