-
-
Notifications
You must be signed in to change notification settings - Fork 861
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
List of available languages #193
List of available languages #193
Comments
Thank you for your feedback. However, I could not understand the reason of your feedback. |
I started using https://github.com/bdswiss/country-language, which has methods to retrieve ISO standard names for languages, as well as country specific mapping. |
When I'm adding the 'messages' to your plugin, I'm creating different Objects like en, de, ja. I'd think it would be useful if there is an built-in function to get all 'Objects' which are basically languages-codes in my case. |
In the meantime until this comes to fruition, I did find a stop gap: computed: {
languages() {
return Object.keys(this.$i18n.messages);
}
} |
@kazupon It could be nice to provide a getLocales() method which returns an array of the available locales: ['en', 'fr', 'pt']. PS: With the same result of the @sethmurphy18 snippet. |
Could someone provide use-case for this feature? I imagine this may be useful to create language selector UI which shows available languages based on messages objects. |
Example:
|
@rimiti |
It's a good job @exoego, you rock 🚀 |
…exoego * feat(index): Fix #193 add availableLocales * Update src/index.js Co-Authored-By: exoego <[email protected]> * feat(index): Fix #193 add type definition to availableLocales * fix(index): add missing type definition to numberFormats * fix(index): Fix #193 add docs to availableLocales * Update vuepress/api/README.md Co-Authored-By: exoego <[email protected]> * fix(index): Fix #193 ensure order of locales
You can do that by "availableLocales" option. |
I'd like to have an feature which allows me to output all available languages with one method. That would allow to make a list of all available translations.
The text was updated successfully, but these errors were encountered: