Translations
The default language of the Inertia Table package is English. However, you can easily translate the package into another language.
Inline translations
You can import the setTranslations()
method from the inertiaui/table
package and pass it an object with the translations you want to override.
js
import { setTranslations } from 'inertiaui/table';
setTranslations({
no_rows_selected: 'No rows selected',
selected_rows: ':count of :total rows selected',
// ...
});
Storing translations in a separate file
You can also choose to store the translations in a separate file. For example, you can create a nl.json
file in the resources/js
directory of your project.
json
{
"no_rows_selected": "Geen rijen geselecteerd"
}
Then, you can import the translations into your JavaScript file and pass them to the setTranslations()
method:
js
import { setTranslations } from 'inertiaui/table';
import nl from './nl.json';
setTranslations(nl);
Available translations
Check out the source code of the package to see all the available translations. You can find them in the js/src/translations.js
file: https://github.com/inertiaui/table/blob/main/js/src/translations.js