Change Language of _info and _length

Change Language of _info and _length

ChrizzleWhizzleChrizzleWhizzle Posts: 3Questions: 0Answers: 0
edited April 2011 in General
Hey Guys,

I'm now working with dataTables since a few days and wanted to know if or how I can change the Text of _info/_length field to display the correct spelling depending on the language set at the browser.

e.g.
en "Search"
de "Suche"
fr "Recherche"

Is there any possibility?

All the best
ChrizzleWhizzle

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    edited April 2011
    http://datatables.net/usage/i18n
    http://datatables.net/examples/basic_init/language.html
    http://www.datatables.net/plug-ins/i18n

    If you want to be able to switch between the languages at page load time, you would need something which tells DataTables what language it should be using - how that might be done, I'm not 100% sure - perhaps reading it from the DOM int he HTML HEAD?

    Allan
  • ChrizzleWhizzleChrizzleWhizzle Posts: 3Questions: 0Answers: 0
    edited April 2011
    So I searched a bit in the html file and found that the content-language never change. BUT I have another Plug-In and there I can find a property called "tx_indexedsearch[lang]", which changes it's state if I change the language on the HP. So my only Problem now is, if and how I can get access to this property. Does somebody know a solution (I've been working with Websites since a few days so I don't know so much yet :S)

    All the best
    ChrizzleWhizzle

    Update:

    So I got the JS thing working to read the set language but when I want to fill the dataTables it throws the following message.

    "DataTables warning: Cannot reinitialise DataTable.

    To retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrieve to true. Alternatively, to destory the old table and create a new one, set bDestroy to true (note that a lot of changes to the configuration can be made through the API which is usually much faster)."

    HELP ;D
This discussion has been closed.