refactor: added missing translation functions (#18143)

* fix: Translating Error and Messages

* Update erpnext/controllers/item_variant.py

Co-Authored-By: Shivam Mishra <scmmishra@users.noreply.github.com>

* Update erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py

Co-Authored-By: Shivam Mishra <scmmishra@users.noreply.github.com>
This commit is contained in:
Anurag Mishra
2019-07-03 15:15:08 +05:30
committed by Shivam Mishra
parent 8929c62113
commit 841d852f41
20 changed files with 41 additions and 36 deletions

View File

@@ -148,7 +148,7 @@ def enroll_in_program(program_name, student=None):
# Check if self enrollment in allowed
program = frappe.get_doc('Program', program_name)
if not program.allow_self_enroll:
return frappe.throw("You are not allowed to enroll for this course")
return frappe.throw(_("You are not allowed to enroll for this course"))
student = get_current_student()
if not student:
@@ -162,7 +162,7 @@ def enroll_in_program(program_name, student=None):
# Check if self enrollment in allowed
program = frappe.get_doc('Program', program_name)
if not program.allow_self_enroll:
return frappe.throw("You are not allowed to enroll for this course")
return frappe.throw(_("You are not allowed to enroll for this course"))
# Enroll in program
program_enrollment = student.enroll_in_program(program_name)
@@ -185,7 +185,7 @@ def add_activity(course, content_type, content, program):
student = get_current_student()
if not student:
return frappe.throw("Student with email {0} does not exist".format(frappe.session.user), frappe.DoesNotExistError)
return frappe.throw(_("Student with email {0} does not exist".format(frappe.session.user)), frappe.DoesNotExistError)
enrollment = get_or_create_course_enrollment(course, program)
if content_type == 'Quiz':
@@ -220,7 +220,7 @@ def get_quiz(quiz_name, course):
quiz = frappe.get_doc("Quiz", quiz_name)
questions = quiz.get_questions()
except:
frappe.throw("Quiz {0} does not exist".format(quiz_name))
frappe.throw(_("Quiz {0} does not exist".format(quiz_name)))
return None
questions = [{
@@ -347,7 +347,7 @@ def get_or_create_course_enrollment(course, program):
if not course_enrollment:
program_enrollment = get_enrollment('program', program, student.name)
if not program_enrollment:
frappe.throw("You are not enrolled in program {0}".format(program))
frappe.throw(_("You are not enrolled in program {0}".format(program)))
return
return student.enroll_in_course(course_name=course, program_enrollment=get_enrollment('program', program, student.name))
else: