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

Provide list of supported locales when lazy loading #205

Open
3 tasks done
lukashass opened this issue Nov 19, 2022 · 0 comments · May be fixed by #251
Open
3 tasks done

Provide list of supported locales when lazy loading #205

lukashass opened this issue Nov 19, 2022 · 0 comments · May be fixed by #251
Labels
Package: unplugin-vue-i18n Status: Proposal Request for comments Type: Feature Includes new features

Comments

@lukashass
Copy link

Clear and concise description of the problem

When eagerly loading the locales a list of supported locales is provided by useI18n().availableLocales.

There is no such list when lazy loading the locales since availableLocales only includes loaded locales.

Suggested solution

In https://github.com/lukashass/woodpecker/blob/1bfb9a322f9f8b94ec223afc7eb9085d54f3a16b/web/vite.config.ts#L34-L53 I used a vite virtual module that provides a list of supported locales derived from the filenames in the vueI18n include path.

I think this might be a good feature to be included in the vite plugin (or unplugin?)

Alternative

A manual list of supported locales is of course possible, but not really desirable IMHO.

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Read the README
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@lukashass lukashass added the Status: Proposal Request for comments label Nov 19, 2022
@kazupon kazupon added Type: Feature Includes new features Package: unplugin-vue-i18n Status: Proposal Request for comments and removed Status: Proposal Request for comments labels Mar 4, 2023 — with Volta.net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: unplugin-vue-i18n Status: Proposal Request for comments Type: Feature Includes new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants