Bladeren bron

Jinja translations for website (#3483)

version-14
Britlog 8 jaren geleden
committed by Rushabh Mehta
bovenliggende
commit
00786178e5
3 gewijzigde bestanden met toevoegingen van 21 en 21 verwijderingen
  1. +2
    -2
      frappe/templates/includes/comments/comments.html
  2. +6
    -6
      frappe/templates/includes/contact.js
  3. +13
    -13
      frappe/templates/includes/login/login.js

+ 2
- 2
frappe/templates/includes/comments/comments.html Bestand weergeven

@@ -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;
}



+ 6
- 6
frappe/templates/includes/contact.js Bestand weergeven

@@ -8,14 +8,14 @@ frappe.ready(function() {
var message = $('[name="message"]').val();

if(!(email && message)) {
frappe.msgprint(__("Please enter both your email and message so that we \
can get back to you. Thanks!"));
frappe.msgprint("{{ _("Please enter both your email and message so that we \
can get back to you. Thanks!") }}");
return false;
}

if(!validate_email(email)) {
frappe.msgprint(__("You seem to have written your name instead of your email. \
Please enter a valid email address so that we can get back."));
frappe.msgprint("{{ _("You seem to have written your name instead of your email. \
Please enter a valid email address so that we can get back.") }}");
$('[name="email"]').focus();
return false;
}
@@ -27,9 +27,9 @@ frappe.ready(function() {
message: message,
callback: function(r) {
if(r.message==="okay") {
frappe.msgprint(__("Thank you for your message"));
frappe.msgprint("{{ _("Thank you for your message") }}");
} else {
frappe.msgprint(__("There were errors"));
frappe.msgprint("{{ _("There were errors") }}");
console.log(r.exc);
}
$(':input').val('');


+ 13
- 13
frappe/templates/includes/login/login.js Bestand weergeven

@@ -18,7 +18,7 @@ login.bind_events = function() {
args.pwd = $("#login_password").val();
args.device = "desktop";
if(!args.usr || !args.pwd) {
frappe.msgprint(__("Both login and password required"));
frappe.msgprint("{{ _("Both login and password required") }}");
return false;
}
login.call(args);
@@ -33,7 +33,7 @@ login.bind_events = function() {
args.redirect_to = get_url_arg("redirect-to") || '';
args.full_name = ($("#signup_fullname").val() || "").trim();
if(!args.email || !valid_email(args.email) || !args.full_name) {
login.set_indicator(__("Valid email and name required"), 'red');
login.set_indicator("{{ _("Valid email and name required") }}", 'red');
return false;
}
login.call(args);
@@ -46,7 +46,7 @@ login.bind_events = function() {
args.cmd = "frappe.core.doctype.user.user.reset_password";
args.user = ($("#forgot_email").val() || "").trim();
if(!args.user) {
login.set_indicator(__("Valid Login id required."), 'red');
login.set_indicator("{{ _("Valid Login id required.") }}", 'red');
return false;
}
login.call(args);
@@ -60,7 +60,7 @@ login.bind_events = function() {
args.pwd = $("#login_password").val();
args.device = "desktop";
if(!args.usr || !args.pwd) {
login.set_indicator(__("Both login and password required"), 'red');
login.set_indicator("{{ _("Both login and password required") }}", 'red');
return false;
}
login.call(args);
@@ -103,7 +103,7 @@ login.signup = function() {

// Login
login.call = function(args, callback) {
login.set_indicator(__('Verifying...'), 'blue');
login.set_indicator("{{ _('Verifying...') }}", 'blue');
return frappe.call({
type: "POST",
args: args,
@@ -149,10 +149,10 @@ login.login_handlers = (function() {
var login_handlers = {
200: function(data) {
if(data.message=="Logged In") {
login.set_indicator(__("Success"), 'green');
login.set_indicator("{{ _("Success") }}", 'green');
window.location.href = get_url_arg("redirect-to") || data.home_page;
} else if(data.message=="No App") {
login.set_indicator(__("Success"), 'green');
login.set_indicator("{{ _("Success") }}", 'green');
if(localStorage) {
var last_visited =
localStorage.getItem("last_visited")
@@ -171,11 +171,11 @@ login.login_handlers = (function() {
}
} else if(window.location.hash === '#forgot') {
if(data.message==='not found') {
login.set_indicator(__("Not a valid user"), 'red');
login.set_indicator("{{ _("Not a valid user") }}", 'red');
} else if (data.message=='not allowed') {
login.set_indicator(__("Not Allowed"), 'red');
login.set_indicator("{{ _("Not Allowed") }}", 'red');
} else {
login.set_indicator(__("Instructions Emailed"), 'green');
login.set_indicator("{{ _("Instructions Emailed") }}", 'green');
}


@@ -183,14 +183,14 @@ login.login_handlers = (function() {
if(cint(data.message[0])==0) {
login.set_indicator(data.message[1], 'red');
} else {
login.set_indicator(__('Success'), 'green');
login.set_indicator("{{ _('Success') }}", 'green');
frappe.msgprint(data.message[1])
}
//login.set_indicator(__(data.message), 'green');
}
},
401: get_error_handler(__("Invalid Login. Try again.")),
417: get_error_handler(__("Oops! Something went wrong"))
401: get_error_handler("{{ _("Invalid Login. Try again.") }}"),
417: get_error_handler("{{ _("Oops! Something went wrong") }}")
};

return login_handlers;


Laden…
Annuleren
Opslaan