Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

Feature request: Warning messages to output the i18n path #680

Open
MechJosh0 opened this issue Aug 6, 2019 · 2 comments
Open

Feature request: Warning messages to output the i18n path #680

MechJosh0 opened this issue Aug 6, 2019 · 2 comments
Labels
Status: Need More Info Lacks enough info to make progress

Comments

@MechJosh0
Copy link

Warning messages to output the i18n path

Output the i18n string path in the console.warn message.

The warning message doesn't provide any information to suggest where it's originating from. You have to use the trace to find the component (or components if the string of the i18n comes from it's parents). Then if you have multiple i18ns in the component you then have to look at each one to find out which one is causing the issue.

It'd be a lot easier to debug if the warning message simply said the path of the i18n that is causing the problem.

vue-i18n/src/util.js

console.warn(`[vue-i18n] ${msg} -> "${path}"`)

Happy to make a PR if feature approved.

@exoego
Copy link
Collaborator

exoego commented Aug 6, 2019

Hello @MechJosh0
Thanks for requesting new feature !!

I think there is already warning that shows keypath ${key} when message key ${key} is not found in message locale.

vue-i18n/src/index.js

Lines 270 to 274 in 6ffc601

if (process.env.NODE_ENV !== 'production' && !this._silentTranslationWarn) {
warn(
`Cannot translate the value of keypath '${key}'. ` +
'Use the value of keypath as default.'
)

So, I think the spec of this feature need more detailed.
Do you have an idea/example of new warning message ?
That helps maintainers to understand how new message help developers!!

@MechJosh0
Copy link
Author

MechJosh0 commented Aug 8, 2019 via email

@kazupon kazupon added Status: Need More Info Lacks enough info to make progress and removed need more spec labels Feb 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: Need More Info Lacks enough info to make progress
Projects
None yet
Development

No branches or pull requests

3 participants