i18n
Language configuration options for Editor.
Please note - this property requires the Editor extension for DataTables.
Description
All strings that Editor uses in its user interface are defined in this object, allowing you to modified them individually or completely replace them all as required. This ensures that Editor is fully internationalisable as strings for any language can be used.
For information about each individual parameter that can be configured, please see its documentation document (links in the Related section below).
Please note that many of the strings that Editor displays to the end user are used as part of the Buttons buttons that Editor provides. The options in i18n.create, i18n.edit and i18n.remove are all used only when the Buttons extension (or TableTools for legacy installations) is also used. If you are not using Buttons, these options will have no effect on Editor. In such a case, the strings that the user sees can be set using the API, such as title() and buttons().
The default language options for Editor are shown below for reference.
{
"close": "Close",
"create": {
"button": "New",
"title": "Create new entry",
"submit": "Create"
},
"edit": {
"button": "Edit",
"title": "Edit entry",
"submit": "Update"
},
"remove": {
"button": "Delete",
"title": "Delete",
"submit": "Delete",
"confirm": {
"_": "Are you sure you wish to delete %d rows?",
"1": "Are you sure you wish to delete 1 row?"
}
},
"error": {
"system": "A system error has occurred (More information)"
},
"multi": {
"title": "Multiple values",
"info": "The selected items contain different values for this input. To edit and set all items for this input to the same value, click or tap here, otherwise they will retain their individual values.",
"restore": "Undo changes",
"noMulti": "This input can be edited individually, but not part of a group."
},
"datetime": {
"previous": 'Previous',
"next": 'Next',
"months": [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ],
"weekdays": [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],
"amPm": [ 'am', 'pm' ],
"unknown": '-'
}
}
Type
This option can be given in the following type(s):
Example
Use French language strings for the Editor interface:
var editor = new DataTable.Editor({
ajax: 'php/staff.php',
table: '#myTable',
i18n: {
close: 'Fermer',
create: {
button: 'Nouveau',
title: 'Créer nouvelle entrée',
submit: 'Créer'
},
edit: {
button: 'Modifier',
title: 'Modifier entrée',
submit: 'Actualiser'
},
remove: {
button: 'Supprimer',
title: 'Supprimer',
submit: 'Supprimer',
confirm: {
_: 'Etes-vous sûr de vouloir supprimer %d lignes?',
1: 'Etes-vous sûr de vouloir supprimer 1 ligne?'
}
},
error: {
system: 'Une erreur s’est produite, contacter l’administrateur système'
},
multi: {
title: 'Plusieurs valeurs',
info: 'Les éléments sélectionnés contiennent des valeurs différentes pour cette entrée. Pour modifier et mettre tous les éléments pour cette entrée pour la même valeur, cliquez ou appuyez ici, sinon ils vont conserver leurs valeurs individuelles.',
restore: 'Annuler les modifications',
noMulti:
"Cette entrée peut être modifiée individuellement, mais ne fait pas partie d'un groupe."
},
datetime: {
previous: 'Précédent',
next: 'Premier',
months: [
'Janvier',
'Février',
'Mars',
'Avril',
'peut',
'Juin',
'Juillet',
'Août',
'Septembre',
'Octobre',
'Novembre',
'Décembre'
],
weekdays: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam']
}
}
});Related
The following options are directly related and may also be useful in your application development.