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: translation_fixes_webshop #237

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion webshop/public/js/customer_reviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ $(() => {
}
});
},
primary_action_label: __('Submit')
primary_action_label: __("Submit")
});
d.show();
});
Expand Down
8 changes: 4 additions & 4 deletions webshop/public/js/product_ui/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ webshop.ProductGrid = class {
<s>${ item.formatted_mrp ? item.formatted_mrp.replace(/ +/g, "") : "" }</s>
</small>
<small class="ml-1 product-info-green">
${ item.discount } OFF
${ item.discount } ${ __("OFF") }
</small>
`;
}
Expand Down Expand Up @@ -166,7 +166,7 @@ webshop.ProductGrid = class {
return `
<a href="/${ item.route || '#' }">
<div class="btn btn-sm btn-explore-variants w-100 mt-4">
${ __('Explore') }
${ __("Explore") }
</div>
</a>
`;
Expand All @@ -181,7 +181,7 @@ webshop.ProductGrid = class {
<use href="#icon-assets"></use>
</svg>
</span>
${ settings.enable_checkout ? __('Add to Cart') : __('Add to Quote') }
${ settings.enable_checkout ? __("Add to Cart") : __("Add to Quote") }
</div>

<a href="/cart">
Expand All @@ -190,7 +190,7 @@ webshop.ProductGrid = class {
w-100 mt-4 go-to-cart-grid
${ item.in_cart ? '' : 'hidden' }"
data-item-code="${ item.item_code }">
${ settings.enable_checkout ? __('Go to Cart') : __('Go to Quote') }
${ settings.enable_checkout ? __("Go to Cart") : __("Go to Quote") }
</div>
</a>
`;
Expand Down
8 changes: 4 additions & 4 deletions webshop/public/js/product_ui/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ webshop.ProductList = class {
<s>${ item.formatted_mrp ? item.formatted_mrp.replace(/ +/g, "") : "" }</s>
</small>
<small class="ml-1 product-info-green">
${ item.discount } OFF
${ item.discount } ${ __("OFF") }
</small>
`;
}
Expand Down Expand Up @@ -167,7 +167,7 @@ webshop.ProductList = class {
return `
<a href="/${ item.route || '#' }">
<div class="btn btn-sm btn-explore-variants btn mb-0 mt-0">
${ __('Explore') }
${ __("Explore") }
</div>
</a>
`;
Expand All @@ -184,7 +184,7 @@ webshop.ProductList = class {
<use href="#icon-assets"></use>
</svg>
</span>
${ settings.enable_checkout ? __('Add to Cart') : __('Add to Quote') }
${ settings.enable_checkout ? __("Add to Cart") : __("Add to Quote") }
</div>

<div class="cart-indicator list-indicator ${item.in_cart ? '' : 'hidden'}">
Expand All @@ -198,7 +198,7 @@ webshop.ProductList = class {
${ item.in_cart ? '' : 'hidden' }"
data-item-code="${ item.item_code }"
style="padding: 0.25rem 1rem; min-width: 135px;">
${ settings.enable_checkout ? __('Go to Cart') : __('Go to Quote') }
${ settings.enable_checkout ? __("Go to Cart") : __("Go to Quote") }
</div>
</a>
`;
Expand Down
2 changes: 1 addition & 1 deletion webshop/public/js/product_ui/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ webshop.ProductSearch = class {
let recents = this.getRecentSearches();

if (!recents.length) {
this.recents_container.html(`<span class=""text-muted">No searches yet.</span>`);
this.recents_container.html(`<span class=""text-muted">${ __("No searches yet.") }</span>`);
return;
}

Expand Down
6 changes: 3 additions & 3 deletions webshop/public/js/product_ui/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ webshop.ProductView = class {
<div class="input-group col-8 p-0">
<div class="dropdown w-100" id="dropdownMenuSearch">
<input type="search" name="query" id="search-box" class="form-control font-md"
placeholder="Search for Products"
placeholder="${__("Search for Products")}"
aria-label="Product" aria-describedby="button-addon2">
<div class="search-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"
Expand Down Expand Up @@ -488,15 +488,15 @@ webshop.ProductView = class {
render_no_products_section(error=false) {
let error_section = `
<div class="mt-4 w-100 alert alert-error font-md">
Something went wrong. Please refresh or contact us.
${ __("Something went wrong. Please refresh or contact us.") }
</div>
`;
let no_results_section = `
<div class="cart-empty frappe-card mt-4">
<div class="cart-empty-state">
<img src="/assets/webshop/images/cart-empty-state.png" alt="Empty Cart">
</div>
<div class="cart-empty-message mt-4">${ __('No products found') }</p>
<div class="cart-empty-message mt-4">${ __("No products found") }</p>
</div>
`;

Expand Down
2 changes: 1 addition & 1 deletion webshop/templates/generators/item/item.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<!-- Recommended Items -->
{% if show_recommended_items %}
<div class="mt-4 col-3 recommended-item-section">
<span class="recommendation-header">Recommended</span>
<span class="recommendation-header">{{ _("Recommended") }}</span>
<div class="product-container mt-2 recommendation-container">
{% for item in recommended_items %}
{{ recommended_item_row(item) }}
Expand Down
8 changes: 4 additions & 4 deletions webshop/templates/generators/item/item_reviews.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ <h6 class="text-muted mt-6">
let d = new frappe.ui.Dialog({
title: __("Write a Review"),
fields: [
{fieldname: "title", fieldtype: "Data", label: "Headline", reqd: 1},
{fieldname: "rating", fieldtype: "Rating", label: "Overall Rating", reqd: 1},
{fieldname: "title", fieldtype: "Data", label: __("Headline"), reqd: 1},
{fieldname: "rating", fieldtype: "Rating", label: __("Overall Rating"), reqd: 1},
{fieldtype: "Section Break"},
{fieldname: "comment", fieldtype: "Small Text", label: "Your Review"}
{fieldname: "comment", fieldtype: "Small Text", label: __("Your Review")}
],
primary_action: function() {
var data = d.get_values();
Expand All @@ -80,7 +80,7 @@ <h6 class="text-muted mt-6">
}
});
},
primary_action_label: __('Submit')
primary_action_label: __("Submit")
});
d.show();
});
Expand Down
2 changes: 1 addition & 1 deletion webshop/webshop/doctype/website_item/website_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def get_product_details_section(self, context):

def get_tabs(self):
tab_values = {}
tab_values["tab_1_title"] = "Product Details"
tab_values["tab_1_title"] = _("Product Details")
tab_values["tab_1_content"] = frappe.render_template(
"templates/generators/item/item_specifications.html",
{
Expand Down