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

error: Invalid token in placeholder: '$ #127

Closed
xlz26296 opened this issue Sep 27, 2020 · 3 comments
Closed

error: Invalid token in placeholder: '$ #127

xlz26296 opened this issue Sep 27, 2020 · 3 comments

Comments

@xlz26296
Copy link

vue & vue-i18n version

ex:

  • vue: 3.0.0-0
  • vue-i18n: 9.0.0-beta.3

Reproduction Link

https://jsfiddle.net/x0o2cL67/

Steps to reproduce

How to output 'xxx: { $100, $xxx }' string directly, some scenarios need to output special characters.

What is Expected?

Output string with no error.

What is actually happening?

image

@kazupon
Copy link
Member

kazupon commented Sep 28, 2020

Thank you for your feedback!!
sorry, lately my reply.

Related #118
@, {, } and $ characters is special characters since vue-i18n-next in message syntax.

You can avoid it to use literal interpolation.

"请问如何输出字符串,如何关闭默认的格式化:{'{'} {'$'}100, {'$'}xxx {'}’}"

https://jsfiddle.net/9zdL8vak/

@kazupon kazupon closed this as completed Sep 28, 2020
@kazupon
Copy link
Member

kazupon commented Sep 29, 2020

or

"请问如何输出字符串,如何关闭默认的格式化:{'{ $100, $xxx }’}"

@xlz26296
Copy link
Author

thanks, It would be nice to be able to close the parse placeholder directly, so that you can upgrade directly from vue-i18n to vue-i18n-next without any changes.

Could you consider supporting placeholder switches?

createI18n({
  parsePlaceholder: false
})

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