Translations inside plugins components not found?
snipiba opened this issue · 3 comments
snipiba commented
I had a multiple components with twig shorthand {{ 'variable to translate'|_ }}
and it is not found on backend and then is backend user not allowed to translate all variables inside plugins components.
daftspunk commented
Hi @snipiba
We may need some more information on this. I used this exact code inside my component and the Translate plugin found it:
snipiba commented
code snippets from:
// layout
<section id="content">
<div class="content-wrap">
{% page %}
</div>
</section>
// page
{% component 'billing' %}
// component
<table class="table cart mb-5">
<thead>
<tr>
<th class="cart-product-remove"> </th>
<th class="cart-product-thumbnail"> </th>
<th class="cart-product-name">{{ 'Product'|_ }}</th>
<th class="cart-product-price">{{ 'Unit Price'|_ }}</th>
<th class="cart-product-quantity">{{ 'Quantity'|_ }}</th>
<th class="cart-product-subtotal">{{ 'Total'|_ }}</th>
</tr>
</thead>
<tbody id="cart-table">
{% partial __SELF__ ~ '::cartItems' basketSummary=basketSummary %}
</tbody>
</table>
/// and included partial ::cartItems is not found and translated...
<tr class="cart_item">
<td colspan="6">
<div class="row justify-content-between py-2 col-mb-30">
<div class="col-lg-auto ps-lg-0">
<form method="post"
data-request="{{ __SELF__ }}::onApplyCoupon"
data-request-update="'{{ __SELF__ }}::cartItems' : '#cart-table','{{ __SELF__ }}::subtotals' : '#subtotals'" class="row">
<div class="col-md-8">
<input type="text" name="code" value="" class="sm-form-control text-center text-md-start" placeholder="{{ 'Enter Coupon Code'|_ }}.." />
</div>
<div class="col-md-4 mt-3 mt-md-0">
<button type="submit"
class="button button-3d button-black m-0">{{ 'Apply coupon / code'|_ }}</button>
</div>
</form>
</div>
<div class="col-lg-auto pe-lg-0">
<a href="{{ 'cart/billing'|page }}" class="button button-3d mt-2 mt-sm-0 me-0">{{ 'continue' | _ }}</a>
</div>
</div>
</td>
</tr>