Can be moved language outside Javascript?

Can be moved language outside Javascript?

toplisektoplisek Posts: 26Questions: 5Answers: 0

I have an issue if there are 5 languages. How to set languages option as it is inside JavaScript by default like URL and format json.
Is this possible?

Answers

  • toplisektoplisek Posts: 26Questions: 5Answers: 0

    Some validations like Parsley use js outside Javascript. So, each table can be detected by language not inside jQuery. As it should be init only once it will block any language detection as this is doubled.

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    You can load a language file using the language.url option for DataTables.

    Allan

  • toplisektoplisek Posts: 26Questions: 5Answers: 0
    edited December 2015

    I understand this and I have put jQuery and all this stuff inside one init function.
    Issue is that language should not be inside jQuery as it is separate function (many tables have different settings but one detected language at time). Language detection is based on script not jQuery init. If I put double init it will be an error as usual and posted.

    Example:

    Jqgrid: <script src="js/grid-en.js"></script>
    Parsley validation: <script src="js/en-lang.js
    
  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    I'm not sure I understand I'm afraid. You want to load a single language file that is used for all tables on the page? If so, then simply load that language file and have it extend the defaults.

    Allan

This discussion has been closed.