Language Support

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)

Setting the Language

To configure the language of the DataTable, you need to set the application locale in your Laravel configuration.

Step 1: Update 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

Step 2: Publish Language Files (Optional)

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.

Step 3: Use the Translations in Your Blade Templates

You can use the provided translations in your Blade templates with Laravel's __() helper:

{{ __('datatable::datatables.filters') }}

Default Language Fallback

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',

Contributing Translations

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/.