-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request]: Korean Fullname Patch #13495
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
Some of that code isn't even really used anymore, and also I doubt we'd want to make it specific to Korea, as I'm sure it's standard for other countries as well. Much better to make this a setting IMHO. |
For example, in Korea, ["Min-jae, Kim", "Heung-min, Son"] is written as ["Kim Min-jae", "Son Heung-min"]. This type of problem doesn't cause problems because it can be read. Thank you. |
I totally got that part :) Figuring out sorting by full name is a little trickier, and will require a little more thought. We generally don't want to check settings within a query scope. It's just kinda bad form. I'll try to figure out a way to handle that better, but for now, I'd stick to sorting by first or last name. (Sorting by full name is sort of a weird concept anyway. Someone asked for it so we did it, but regular searching/sorting should handle 99% of scenarios.) |
Is your feature request related to a problem? Please describe.
Please change the name to match the Korean format.
Describe the solution you'd like
In Korea, full names are used in the form of "{last_name} {first_name}".
Describe alternatives you've considered
/app/Models/User.php
//:248
public function getFullNameAttribute()
{
if(Setting::getSettings()->locale == 'ko')
return $this->last_name.' '.$this->first_name;
return $this->first_name.' '.$this->last_name;
}
//:262
public function getCompleteNameAttribute()
{
if(Setting::getSettings()->locale == 'ko')
return $this->last_name.' '.$this->first_name.' ('.$this->username.')';
return $this->last_name.', '.$this->first_name.' ('.$this->username.')';
}
/app/Models/Asset.php
//:1574
public function scopeOrderAssigned($query, $order)
{
if(Setting::getSettings()->locale == 'ko')
return $query->leftJoin('users as users_sort', 'assets.assigned_to', '=', 'users_sort.id')->select('assets.')->orderBy('users_sort.last_name', $order)->orderBy('users_sort.first_name', $order);
return $query->leftJoin('users as users_sort', 'assets.assigned_to', '=', 'users_sort.id')->select('assets.')->orderBy('users_sort.first_name', $order)->orderBy('users_sort.last_name', $order);
}
/app/Presenters/UserPresenter.php
//:380
public function fullName()
{
if(Setting::getSettings()->locale == 'ko')
return html_entity_decode($this->last_name.' '.$this->first_name, ENT_QUOTES | ENT_XML1, 'UTF-8');
return html_entity_decode($this->first_name.' '.$this->last_name, ENT_QUOTES | ENT_XML1, 'UTF-8');
}
Additional context
No response
The text was updated successfully, but these errors were encountered: