Internationalization issues.
Internationalization issues.
Tester2017
Posts: 145Questions: 23Answers: 17
Using the PHP library, for example for data validation will return messages in only the English languages. OK, no problem I resolved this by using CodeIgniter for validation and the language-helper. But on the client-side, I have no other options (as I know) than making separate js copies for each language.
I would be very pleased if there was:
- an option to sent label names of fields in JSON to the client;
- an option to include the right language "cdn.datatables.net/plug-ins/1.10.15/i18n/" for DataTables;
- and the same thing as point 2. for DataTables Editor.
Than I can use DataTables full multi-lingual efficient.
This discussion has been closed.
Replies
I forgot to say that I don't like to DRY.
The Editor PHP validation options have the ability to customise the error return text using their
message
option.On the client-side what I would suggest is that you Ajax load (or otherwise include) your language information for your Editor labels and then do something like:
then the
i18n
function (or whatever you use) would lookup the correct translation for the locale being used.Likewise the language file can be loaded by having the language code at the client-side so you could do
language: { url: '//cdn.datatables.net/plug-ins/1.10.15/i18n/'+locale }
.Regards,
Allan
In this post you'll find a solution for Data Tables and Editor:
https://datatables.net/forums/discussion/comment/116772/#Comment_116772
@allan,
Great! I will work on this and I promise you as soon I am ready with my site, I will write a summary on internationalization which all the aspects of this issue, so it might be shared with everybody.