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

Pipe in $t breaks translation #401

Closed
JBtje opened this issue Mar 17, 2021 · 1 comment
Closed

Pipe in $t breaks translation #401

JBtje opened this issue Mar 17, 2021 · 1 comment

Comments

@JBtje
Copy link
Contributor

JBtje commented Mar 17, 2021

Module versions (please complete the following information):

  • vue: 3.0.7
  • vue-i18n: 9.0.0

Reproduction Link
https://codesandbox.io/s/vue-i18n-9-template-forked-pfxh8
https://github.com/JBtje/LaravelSPABoilerplate (See footer tekst)

To Reproduce
Steps to reproduce the behavior:
ex:

  1. Go to https://codesandbox.io/s/vue-i18n-9-template-forked-pfxh8

Expected behavior
message.hello should show hello | world! However it shows hello . All text after the pipe is removed.
Note that $t is used, not $tc.

Additional context
Escaping the pipline symbol does not solve the problem. As far as I could find in the docs the pipeline should be usable within $t

@JBtje JBtje added the Status: Review Needed Request for review comments label Mar 17, 2021
@kazupon
Copy link
Member

kazupon commented Mar 18, 2021

Thank you for your reporting!

The pipeline character is a special character from v9.
if you want to appear it as a message, you need to use literal interpolation.
https://vue-i18n.intlify.dev/guide/essentials/syntax.html#special-characters

e.g.

hello {'|'} world!

Thanks!

@kazupon kazupon closed this as completed Mar 18, 2021
@kazupon kazupon removed the Status: Review Needed Request for review comments label Mar 18, 2021
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

No branches or pull requests

2 participants