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

[Question] Is it possible to temporarily show the keys instead of the translations? #796

Closed
ThaDaVos opened this issue Mar 5, 2020 · 5 comments

Comments

@ThaDaVos
Copy link

ThaDaVos commented Mar 5, 2020

No bug, just a question/feature request.

Is it possible to show the translation keys instead of the translations itself? Even if a translation exists?
This would be great for when you need to find where a translation is coming from if you're not a programmer or if you aren't well known with the code base and have to translate a specific string.

@Excalibaard
Copy link

Excalibaard commented Mar 6, 2020

Not really an answer to your question, but if you use VSCode, you could take a look at I18n-Ally. That should have everything you need for managing translations without having to disable/override the actual translation of the keys in the codebase.

@exoego
Copy link
Collaborator

exoego commented Mar 6, 2020

Is it possible to show the translation keys instead of the translations itself? Even if a translation exists?

Short answer is NO. it is not possible OOTB.

I think it is required to modify the code to instantiate VueI18n temporarliy, like below:

const i18n = new VueI18n({
    locale: 'no-such-locale',
    fallbackLocale: 'no-such-locale'
})

VueI18n in this settings will try to use no-such-locale locale, but it will fail (since not exist), then show message key as fallbck.

@ThaDaVos
Copy link
Author

ThaDaVos commented Mar 6, 2020

Not really an answer to your question, but if you use VSCode, you could take a look at I18n-Ally. That should have everything you need for managing translations without having to disable/override the actual translation of the keys in the codebase.

I'm already using i18n-Ally - love it this far - but what I'm talking about is in the browser

Is it possible to show the translation keys instead of the translations itself? Even if a translation exists?

Short answer is NO. it is not possible OOTB.

I think it is required to modify the code to instantiate VueI18n temporarliy, like below:

const i18n = new VueI18n({
    locale: 'no-such-locale',
    fallbackLocale: 'no-such-locale'
})

VueI18n in this settings will try to use no-such-locale locale, but it will fail (since not exist), then show message key as fallbck.

Thanks for the heads up -> could the locale and fallbackLocale be changed after instatiation or only during?

@exoego
Copy link
Collaborator

exoego commented Mar 6, 2020

could the locale and fallbackLocale be changed after instatiation or only during?

Good question !
I think it can be changed, as long as an instance of VueI18n is exposed.

@exoego
Copy link
Collaborator

exoego commented Apr 18, 2020

@ThaDaVos

It seems that my answers helps you to temporarily show the keys.
So let me close the issue as answered.
Feel free to reopen if you need more help, or you think this feature should be added to vue-i18n.

@exoego exoego closed this as completed Apr 18, 2020
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

3 participants