remove confirmation %s not expanded to number of rows selected

remove confirmation %s not expanded to number of rows selected

dp@ii.netdp@ii.net Posts: 38Questions: 10Answers: 0

Using a custom remove prompt string similar to that detailed here

http://editor.datatables.net/docs/current/Editor.defaults.i18n.remove.html

The %s is not expanded into the number of selected rows, but is the literal %s in the user prompt.

eg. my block

i18n: {
edit: { title: "Edit Flange Record" },
create: { title: "Create New Flange Record" },
remove: { title: "Delete Flange Record",
confirm: {
_: "Do you really want to delete %s flange records?",
1: "Do you really want to delete this flange record?"
}
}

has the prompt

Do you really want to delete %s flange records?

when I select 2 rows and hit delete.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Answer ✓

    Hi,

    Thanks for pointing this out - it is an error in the documentation. It should use %d (i.e. an integer based on the options in printf).

    The description in the current reference documentation (rather than the old JSDoc generated docs) does note the use of %d, but also had the same error in the examples: i18n.remove.confirm.

    I've updated this locally and will deploy the new documentation to the site soon.

    Regards,
    Allan

  • dp@ii.netdp@ii.net Posts: 38Questions: 10Answers: 0

    The best sort of bugs ! only need to change the documentation - nice. Thanks.

This discussion has been closed.