jeroennoten / Laravel-AdminLTE

Easy AdminLTE integration with Laravel
MIT License
3.8k stars 1.08k forks source link

[QUESTION] How to change the datatables laungage to indonesian? #1216

Closed ammarsufyan closed 1 year ago

ammarsufyan commented 1 year ago

Hello,

How to change the datatables laungage to indonesian in this Laravel-AdminLTE?

dfsmania commented 1 year ago

See issue #967 for reference. Another way I commonly use, is to setup language of the config property as:

'language' => __('plugins.datatable')

And then manage translations in Laravel's files, for example:

lang/en/plugins.php

'datatable' => [
    'decimal' => '',
    'emptyTable' => 'No data available',
    'info' => 'Showing _START_ to _END_ of _TOTAL_ entries',
    'infoEmpty' => 'Showing 0 to 0 of 0 entries',
    'infoFiltered' => '(filtered from _MAX_ total entries)',
    'infoPostFix' => '',
    'thousands' => ',',
    'lengthMenu' => 'Show _MENU_ entries',
    'loadingRecords' => 'Loading...',
    'processing' => 'Processing...',
    'search' => 'Search:',
    'zeroRecords' => 'No matching records found',
    'paginate' => [
        'first' => 'First',
        'last' => 'Last',
        'next' => 'Next',
        'previous' => 'Previous',
    ],
    'aria' => [
        'sortAscending' => ': activate to sort column ascending',
        'sortDescending' => ': activate to sort column descending',
    ],
    'buttons' => [
        'pageLength' => 'Show %d rows',
    ],
],

This way, the translation depends on the locale setting of your Laravel's application, and you may add your translation to indonesian adding and customizing the file lang/id/plugins.php with the same structure defined previously.

ammarsufyan commented 1 year ago

Thanks you @dfsmania