fedemotta / yii2-widget-datatables

DataTables widget for Yii2
MIT License
35 stars 28 forks source link

Language Configuration #6

Open faravaghi opened 8 years ago

faravaghi commented 8 years ago

Hi, Thank you for this extension. How can I do change language of this widget?

i can put language option in view code but i want change it one time and use this config. for example:

...
        'clientOptions' => [
            'language'=>[
                'lengthMenu' => 'Display _MENU_ records per page',
                'info'=> 'Showing page _PAGE_ of _PAGES_'
            ]
        ],
...

with this solution i have every view file write this and in the update this language i have to update all view files!

what is your solution?

fedemotta commented 8 years ago

Hi @faravaghi , Why don't you just create some yii2 configuration params with those settings? You could create a "language" params with the configuration array with all the text to be translated.

faravaghi commented 8 years ago

For Ajax source will have to do?

        'clientOptions' => [
            'ajax'=>Yii::$app->request->url,
            'serverSide' => true,
        ]

action function in Controller file ?!

faravaghi commented 8 years ago

for example EDataTable work in yii1.1.x