Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add translate function to strings in www/book appoinment #32363

Merged
merged 3 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions erpnext/www/book_appointment/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<!-- title: Book an appointment -->
<div id="select-date-time">
<div class="text-center mt-5">
<h3>Book an appointment</h3>
<p class="lead text-muted" id="lead-text">Select the date and your timezone</p>
<h3>{{ _("Book an appointment") }}</h3>
<p class="lead text-muted" id="lead-text">{{ _("Select the date and your timezone") }}</p>
</div>
<div class="row justify-content-center mt-3">
<div class="col-md-6 align-self-center ">
Expand All @@ -31,32 +31,32 @@ <h3>Book an appointment</h3>
</div>
<div class="row justify-content-center mt-3">
<div class="col-md-4 mb-3">
<button class="btn btn-primary form-control" id="next-button">Next</button>
<button class="btn btn-primary form-control" id="next-button">{{ _("Next") }}</button>
</div>
</div>
</div>
</div>
<!--Enter Details-->
<div id="enter-details" class="mb-5">
<div class="text-center mt-5">
<h3>Add details</h3>
<p class="lead text-muted">Selected date is <span class="date-span"></span> at <span class="time-span">
<h3>{{ _("Add details") }}</h3>
<p class="lead text-muted">{{ _("Selected date is") }} <span class="date-span"></span> {{ _("at") }} <span class="time-span">
</span></p>
</div>
<div class="row justify-content-center mt-3">
<div class="col-md-4 align-items-center">
<form id="customer-form" action='#'>
<input class="form-control mt-3" type="text" name="customer_name" id="customer_name" placeholder="Your Name (required)" required>
<input class="form-control mt-3" type="text" name="customer_name" id="customer_name" placeholder="{{ _('Your Name (required)') }}" required>
<input class="form-control mt-3" type="tel" name="customer_number" id="customer_number" placeholder="+910000000000">
<input class="form-control mt-3" type="text" name="customer_skype" id="customer_skype" placeholder="Skype">
<input class="form-control mt-3"type="email" name="customer_email" id="customer_email" placeholder="Email Address (required)" required>
<input class="form-control mt-3"type="email" name="customer_email" id="customer_email" placeholder="{{ _('Email Address (required)') }}" required>

<textarea class="form-control mt-3" name="customer_notes" id="customer_notes" cols="30" rows="10"
placeholder="Notes"></textarea>
placeholder="{{ _('Notes') }}"></textarea>
</form>
<div class="row mt-3 " id="submit-button-area">
<div class="col-md mt-3" style="grid-area: back;"><button class="btn btn-dark form-control" onclick="initialise_select_date()">Go back</button></div>
<div class="col-md mt-3" style="grid-area: submit;"><button class="btn btn-primary form-control " onclick="submit()" id="submit-button">Submit</button></div>
<div class="col-md mt-3" style="grid-area: back;"><button class="btn btn-dark form-control" onclick="initialise_select_date()">{{ _("Go back") }}</button></div>
<div class="col-md mt-3" style="grid-area: submit;"><button class="btn btn-primary form-control " onclick="submit()" id="submit-button">{{ _("Submit") }}</button></div>
</div>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions erpnext/www/book_appointment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function on_date_or_timezone_select() {
window.selected_timezone = timezone.value;
update_time_slots(date_picker.value, timezone.value);
let lead_text = document.getElementById('lead-text');
lead_text.innerHTML = "Select Time"
lead_text.innerHTML = __("Select Time")
}

async function get_time_slots(date, timezone) {
Expand All @@ -89,7 +89,7 @@ async function update_time_slots(selected_date, selected_timezone) {
clear_time_slots();
if (window.slots.length <= 0) {
let message_div = document.createElement('p');
message_div.innerHTML = "There are no slots available on this date";
message_div.innerHTML = __("There are no slots available on this date");
timeslot_container.appendChild(message_div);
return
}
Expand Down Expand Up @@ -128,7 +128,7 @@ function get_slot_layout(time) {
let start_time_string = moment(time).tz(timezone).format("LT");
let end_time = moment(time).tz(timezone).add(window.appointment_settings.appointment_duration, 'minutes');
let end_time_string = end_time.format("LT");
return `<span style="font-size: 1.2em;">${start_time_string}</span><br><span class="text-muted small">to ${end_time_string}</span>`;
return `<span style="font-size: 1.2em;">${start_time_string}</span><br><span class="text-muted small">${__("to") } ${end_time_string}</span>`;
}

function select_time() {
Expand Down Expand Up @@ -227,9 +227,9 @@ async function submit() {
},
callback: (response)=>{
if (response.message.status == "Unverified") {
frappe.show_alert("Please check your email to confirm the appointment")
frappe.show_alert(__("Please check your email to confirm the appointment"))
} else {
frappe.show_alert("Appointment Created Successfully");
frappe.show_alert(__("Appointment Created Successfully"));
}
setTimeout(()=>{
let redirect_url = "/";
Expand All @@ -239,7 +239,7 @@ async function submit() {
window.location.href = redirect_url;},5000)
},
error: (err)=>{
frappe.show_alert("Something went wrong please try again");
frappe.show_alert(__("Something went wrong please try again"));
button.disabled = false;
}
});
Expand Down
4 changes: 2 additions & 2 deletions erpnext/www/book_appointment/verify/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

{% if success==True %}
<div class="alert alert-success">
Your email has been verified and your appointment has been scheduled
{{ _("Your email has been verified and your appointment has been scheduled") }}
</div>
{% else %}
<div class="alert alert-danger">
Verification failed please check the link
{{ _("Verification failed please check the link") }}
</div>
{% endif %}
{% endblock%}