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

[Pdf] set translation credit memo locale #250

Merged
merged 1 commit into from
Jan 29, 2021

Conversation

SirDomin
Copy link
Contributor

issue: #229

Admin panel locale: fr_FR, pdf is printed in english (credit memo locale)
image

@SirDomin SirDomin requested a review from a team as a code owner January 28, 2021 14:16
@@ -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>
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@pamil pamil left a 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.

@SirDomin SirDomin force-pushed the fix-translation-pdf-credit-memo branch from e3e19b7 to 668ed50 Compare January 29, 2021 11:55
@GSadee GSadee merged commit be27007 into Sylius:master Jan 29, 2021
@GSadee
Copy link
Member

GSadee commented Jan 29, 2021

Thank you, @SirDomin! 🥇

@@ -32,7 +32,7 @@
<img src="https://demo.sylius.com/assets/shop/img/logo.png" style="width:300px;">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants