Kyslik / column-sortable

Package for handling column sorting in Laravel 5/6/7/8
MIT License
644 stars 105 forks source link

Unable to use Title in other language. #129

Closed thakools closed 5 years ago

thakools commented 5 years ago

For example, I'd like to replace email with 'อีเมล์' (in Thai language) but it shows up blank.

I'm using version 6.0.0

<th scope="col">@sortablelink('email','อีเมล์')</th>

image

Kyslik commented 5 years ago

Can you try (whitespace before @):

<th scope="col"> @sortablelink('email', 'อีเมล์')</th>

Because I can not reproduce; well in a way:

Psy Shell v0.9.9 (PHP 7.3.9 — cli) by Justin Hileman
>>> $expression = "'email','อีเมล์'";
=> "'email','อีเมล์'"
>>> $expression = ($expression[0] === '(') ? substr($expression, 1, -1) : $expression;
=> "'email','อีเมล์'"
>>> eval("echo \Kyslik\ColumnSortable\SortableLink::render(array ({$expression}));");
<a href="http://localhost?sort=email&direction=asc" >อีเมล์</a> <i class="fa fa-sort"></i>⏎
=> null
thakools commented 5 years ago

I tried adding space before @, i didn't work. However, It works when I add space before Thai words

image

Kyslik commented 5 years ago

Can we close this? I am not sure what I can do about this. If you find out a better solution please consider making PR.

lijunjin418 commented 4 years ago

Try like this. 'อีเมล์'===> ' อีเมล์' It will be working!