Set datable language option to multi lang based on the locale variable
Set datable language option to multi lang based on the locale variable
FranckF
Posts: 1Questions: 1Answers: 0
Hi team,
this is a conceptual question:
is it possible to set "language" on the locale variable to provide multi lang?
All I foundin forum is how to set only one language based on a url or hardcoding in js.
This discussion has been closed.
Answers
It certainly is, although the exact way to do it will depend upon your setup. For example, you might want to have a "DataTables dictionary":
Then you'd use
language: dtDic[locale]
in your DataTables initialisation.If you have all the language files for DataTables being Ajax loaded, then you could include the locale in the URL (as a parameter or part of the path, depending on how you have things set up).
Allan