-
Notifications
You must be signed in to change notification settings - Fork 71
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
[Pdf] set translation credit memo locale #250
[Pdf] set translation credit memo locale #250
Conversation
@@ -32,7 +32,7 @@ | |||
<img src="https://demo.sylius.com/assets/shop/img/logo.png" style="width:300px;"> | |||
</td> | |||
<td> | |||
{{ 'sylius_refund.ui.issued_at'|trans }}: {{ creditMemo.issuedAt|date('Y-m-d H:i:s') }}<br> | |||
{{ 'sylius_refund.ui.issued_at'|trans([], 'messages', creditMemo.localeCode) }}: {{ creditMemo.issuedAt|date('Y-m-d H:i:s') }}<br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about extraction this creditMemo.localeCode
to a variable, instead of copying it 17 times :D?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think if it makes any difference :D this way we know every translation gets credit memo locale code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
Anyway, we can consider changing the Translator's locale before rendering this template and then bringing back the previously used locale after it is rendered. This way we can forget about this kind of issues.
e3e19b7
to
668ed50
Compare
Thank you, @SirDomin! 🥇 |
@@ -32,7 +32,7 @@ | |||
<img src="https://demo.sylius.com/assets/shop/img/logo.png" style="width:300px;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: #229
Admin panel locale: fr_FR, pdf is printed in english (credit memo locale)