sZeroRecords not used for localization (DataTables 1.7.0beta5)

sZeroRecords not used for localization (DataTables 1.7.0beta5)

dahepedahepe Posts: 7Questions: 0Answers: 0
edited July 2010 in Bug reports
Hi,

the property sZeroRecords of the oLanguage doesn't seem to be used for localization. I initialized the table as shown in this (http://datatables.net/examples/advanced_init/language_file.html) example, but when the table is empty, still the default message "No data available in table" appears.

Best regards,
Daniel

Replies

  • allanallan Posts: 61,734Questions: 1Answers: 10,110 Site admin
    edited July 2010
    Very good catch! I've just managed to reproduce this myself. not sure what is causing it yet, but I'll try to figure it out and get a fix into the next release.

    Are you using the 1.7 beta btw?

    If you are - then the "work around" is to set "sEmptyTable" in your language file. Need to look closer and see if there is a way around requiring this...

    Regards,
    Allan
  • dahepedahepe Posts: 7Questions: 0Answers: 0
    Hi,

    your "work around" worked :)

    Yes, I'm using 1.7.0 beta5 right now...

    Regards
  • allanallan Posts: 61,734Questions: 1Answers: 10,110 Site admin
    I've got a fix for this now and will have it in the next release. Basically the fix is to use the given sZeroRecords if it is given and sEmptyTable is not. This will allow all the translations available to work with the new versions. Thanks for the heads up on this one.

    Regards,
    Allan
  • frank.oosterhuisfrank.oosterhuis Posts: 5Questions: 0Answers: 0
    I think this is still broken in 1.7.1
    [code]
    "oLanguage" : {
    sInfoEmpty : "No data",
    sZeroRecords : "Nothing found"
    }
    [/code]

    Empty table AND empty result after filter both result in "No data"
    Also changing sZeroRecords to sEmptyTable does not not change anything for me.

    Any thoughts?
  • allanallan Posts: 61,734Questions: 1Answers: 10,110 Site admin
    sInfoEmpty is the information element at the bottom of the table - not the information inside the table.

    Those variables are:
    sEmptyTable - http://datatables.net/usage/i18n#oLanguage.sEmptyTable
    sZeroRecords - http://datatables.net/usage/i18n#oLanguage.sZeroRecords

    You would need to define both of those if you want them to be different.

    Allan
  • frank.oosterhuisfrank.oosterhuis Posts: 5Questions: 0Answers: 0
    Oh! that seems to work just fine then..
    Thank you for your help :)
This discussion has been closed.