Datatables 3: Internationalization
Datatables 3: Internationalization
Perhaps with dynamic imports it's less of an issue, but do you think you'll be reviewing language packs?
Perhaps with dynamic imports it's less of an issue, but do you think you'll be reviewing language packs?
Answers
Updating the plugins is one of my outstanding tasks for DataTables 3, however the language files should work as is. Is there something specific that you are looking for me to review?
Allan
If I know the local (e.g. from the request, or a user property) I want it to be easy load the language back based on that. I think right now I have to load the language pack for each specific language.
Perhaps this is changed with the await javascript. My controller has
When what I want is to simply pass the locale and have the library use it and not do this.
Which I'm sure can be optimized, but still feels like there must be a better solution.
I am not the super expert in Javascript but as far as I know, when you do
import ... from ....then the module is only loaded at the moment when it is really used.Thus your
if () else if ....construct is rather pointless.Kind of. It depends what you mean by loaded. In this case, that looks like it is code that will be bundled, so all of the language data would need to be sent to the client-side, where it can then resolve the
ifcondition for which one is to be used. So in this case, theifcondition is needed.There is dynamic import and all of the current browsers do support that, so that might be one option, although I've found client-side imports (when using import maps) to be quite frustrating (perhaps things have improved since then...).
Perhaps a nice solution would be to have a small server which can resolve the request of a locale and then serve the language file that is needed. You simply load (or import) a single script and it would add the call to get the required language file. I quite like that idea and will look into that in future.
Allan