-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
Compilation fails when text includes @ #531
Comments
Thank you for your reporting!
Thanks! |
The error message for this needs to be much, much clearer. I spent well over an hour finding out why migrating a vue-i18n setup to Vue 3 always got me back to the following error message:
and it was simply a translation message of the form “Contact info@example.com”. I would also really like to turn this off completely. I really don’t want something as cryptic as |
Stumbled upon the same issue. Did anyone find a way to disable this feature? We support 40+ languages, I can't reasonably migrate all of those translations, then ask translators to just "be careful" with this notation. Any workaround would be greatly appreciated... 🙏 |
I think I finally found a way to circumvent this by using the import { get } from 'lodash';
const i18n = createI18n({
// Prevent '@' character from being used as linked messages
messageResolver: (obj, path) => get(obj, path, '')?.replaceAll(/@/g, "{'@'}") || null,
}) This way every I think this could be added in the docs as a clue because it can makes migration from v8 to v9 almost impossible. |
Hard to tell, you could set a |
the weird thing is that even If I set debugger, console logs, etc... nothing happens as if it doesn't go through the |
Does it work for classic translation files, I mean not-in-component blocks? |
@kazupon why there is no option to just disable linking via @ sign if we are not using this functionality at all? What's worse - I'm using petite-vue-i18n that supposed to be very basic, but it still uses "@" in message resolver. If petite is basic, keep it basic. Sure I can overwrite that in message resolver via replacing @ to literals, but this should not be necessary. |
Can this issue please be reopened? We need a way to disable linking. That's basically it. I can't reasonably tell the customer to go through all their translations and replace Just because there's a workaround, doesn't mean the issue has dissappeared. |
The following error is shown if the external json file with the messages has an
@
in the text.Syntax Error: Final loader (./node_modules/@intlify/vue-i18n-loader/lib/index.js) didn't return a Buffer or String
{ "test": "Send us an e-mail on test@test.no" }
Throws the error.
{ "test": "Send us an e-mail on testtest.no" }
Works fine.
The text was updated successfully, but these errors were encountered: