vue-i18n icon indicating copy to clipboard operation
vue-i18n copied to clipboard

Support fetching locales from api

Open SassNinja opened this issue 3 years ago • 1 comments
trafficstars

Clear and concise description of the problem

If I understand the docs correctly, it's only possible to lazy load other locales via dynamic import: https://vue-i18n.intlify.dev/guide/advanced/lazy.html

This doesn't work for me because I don't have any json files but rely on getting the translations from an api. Furthermore I've got a lot of translations any don't wanna import everything for a given language but only load specific namespaces.

Suggested solution

Support namespaces to avoid loading all translations (similar to i18next) and support fetching via http request (similar to https://github.com/i18next/i18next-http-backend)

Alternative

Only alternative I can image (without using another framework) is downloading all data from the api in the (webpack) build process and emit it as json files though this would feel quite hacky and doesn't solve the namespace issue.

Additional context

No response

Validations

SassNinja avatar Mar 09 '22 15:03 SassNinja

Something similar to this?

adrai avatar May 12 '22 09:05 adrai