Get cryptic error Cannot read properties of undefined (reading 'message')
for a simple problem
#375
Labels
Status: Review Needed
Request for review comments
Reporting a bug?
I am updating i18n translations for our project. After running 17 translations for French I started getting an error from the i18n plugin, with none of the stack trace leading back to my code line, just the file name.
The simple problem is that other tools got an invalid translation back. I use I18NAlly to fetch translations (I think from Google), and in this one case:
"from-users-usernames": "from users {usernames}",
became
"from-users-usernames": "des utilisateurs {nom d'utilisateurs}",
It would be very helpful, given that I've seen Google translate parameter names in other cases, if intlify would explicitly detect problems that it can't handle in the parameter name (whether that's the space or the apostrophe or both), and report an explicit error, something like
invalid parameter name in translation string "from-users-usernames" in /var/src/project/src/i18n/fr.json:1282
. Note that I gave both the tag and the line number, but either would likely be sufficient.Expected behavior
If a parameter name isn't acceptable an explicit warning should be given, specifying at the very least that a specific string or line number has a problem with the parameter name. Specifying the limitations of the parameter names in the error might be help, if not too cumbersome,. A link to docs might be sufficient. (And note that it's not the case that I expect the tool to support a two word parameter name, I just need it to explicitly detect the problem since the translators sometimes do that to us.)
Reproduction
See my sample and insert it in your favourite app to test.
Issue Package
vite-plugin-vue-i18n
System Info
Screenshot
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: