-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Locale dynamic import #584
Comments
I guess you could use something like webpack lazy loading or implement it by yourself if you don't want to include all locale files in your bundle. |
For most libraries that I've worked with, you could either import specific language, or just include a locale file on page and it would automatically register with the library, and then you could just specify the locale code, and it would take it from the locale registry. As for the locale files in air-datepicker dist directory, there is no way to import/add these in browser environment, you can't add a script tag (even with type="module") with it. It could work only on build step with some sort of builder (which is not always present). |
So, the question is: we have multiple site versions, and in each of these the entire interface is in some specific language. We'd like to provide translations according to the site language. The problem here is that there is no simple way to import only specific translations for specific site language versions.
The only way I see it could be achieved is by using client-side imports, but that would require somehow adding all files to build process, so that all translations be copied to build directory, even if it is not imported directly. And also that puts some requirements for browser support and there is no way to support legacy browsers.
The only way I see it is by loading all supported languages in some for all website versions, which I see as suboptimal.
The text was updated successfully, but these errors were encountered: