Ginkelsoft DataTables supports multiple languages out of the box. Currently, the following languages are available:
English (en)
Dutch (nl)
German (de)
French (fr)
Spanish (es)
To configure the language of the DataTable, you need to set the application locale in your Laravel configuration.
config/app.php
Locate the locale
setting in your config/app.php
file and set it to the desired language:
'locale' => 'nl', // Change to 'en', 'de', 'fr', or 'es' as needed
If you want to customize the translations, you can publish the language files:
php artisan vendor:publish --provider="Ginkelsoft\DataTables\DataTableServiceProvider" --tag=lang
This will create language files in the resources/lang/vendor/datatables/
directory where you can modify translations.
You can use the provided translations in your Blade templates with Laravel's __()
helper:
{{ __('datatable::datatables.filters') }}
If the selected language is not available, Laravel will automatically fall back to English (en
). You can configure this fallback language in config/app.php
:
'fallback_locale' => 'en',
If you'd like to contribute translations for additional languages, you can submit a pull request to the repository with your language files added to resources/lang/vendor/datatables/
.