Internationalization issues.

Internationalization issues.

Tester2017Tester2017 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:

  1. an option to sent label names of fields in JSON to the client;
  2. an option to include the right language "cdn.datatables.net/plug-ins/1.10.15/i18n/" for DataTables;
  3. and the same thing as point 2. for DataTables Editor.

Than I can use DataTables full multi-lingual efficient.

Replies

  • Tester2017Tester2017 Posts: 145Questions: 23Answers: 17

    I forgot to say that I don't like to DRY.

  • allanallan Posts: 63,258Questions: 1Answers: 10,421 Site admin

    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:

    {
      name: 'status',
      label: i18n( 'Status' )
    }
    

    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

  • rf1234rf1234 Posts: 2,951Questions: 87Answers: 416

    In this post you'll find a solution for Data Tables and Editor:
    https://datatables.net/forums/discussion/comment/116772/#Comment_116772

  • Tester2017Tester2017 Posts: 145Questions: 23Answers: 17

    @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.

This discussion has been closed.