i18n.field.tags

Since: Editor 2.4

Defaults for the strings used by tags fields.
Please note - this property requires the Editor extension for DataTables.

Description

This object provides a container for the strings used by the tags field type. Each string can be set directly on the field's object (see the i18n option of tags), but can also be set here to have a default value. This is particularly useful when providing a full translation for Editor and you are happy with the generic terms for the field type.

It is worth highlighting that Editor's language strings can be loaded from the JSON language object that DataTables loads during its startup (language). That allows a single file to provide a full translation for DataTables and Editor.

The following properties can be set on this object.

  • addButton - When another tag can be added to the value a button is shown providing the end user with that ability. This parameter defines the string that is shown in that button. The default value is + Add.
  • inputPlaceholder - The search input element shown in the tags dropdown can have a placeholder value set with this parameter. The default value is an empty string.
  • noResults - This string is shown when a search term is applied (i.e. the user has typed into the input), but no results have been found that match that term. The default value is No results found.
  • placeholder - This string is shown when no search term has yet been applied, and no options have been loaded. This is typically when using Ajax search for the autocomplete and there is no search applied. The default value is Type to search.
  • removeIcon (since 2.5) - The text shown in the remove button for each applied tag. The default value is ×.

Type

This option can be given in the following type(s):

Example

Use French language strings for tags:

let editor = new DataTable.Editor({
	i18n: {
		field: {
			autocomplete: {
				addButton: '+ Ajouter',
				inputPlaceholder: '',
				noResults: 'Aucun résultat trouvé',
				placeholder: 'Tapez pour rechercher'
			}
		}
	},
	// ...
});