Skip to content
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

Closed
IJBae opened this issue Aug 21, 2023 · 4 comments
Closed

[Feature Request]: Korean Fullname Patch #13495

IJBae opened this issue Aug 21, 2023 · 4 comments
Assignees

Comments

@IJBae
Copy link

IJBae commented Aug 21, 2023

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

@welcome
Copy link

welcome bot commented Aug 21, 2023

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

@snipe snipe self-assigned this Aug 21, 2023
@snipe
Copy link
Owner

snipe commented Aug 21, 2023

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.

@IJBae
Copy link
Author

IJBae commented Aug 22, 2023

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.
However, when sorting by Fullname, the First_Name criterion ([0=>"Heung-min, Son", 1=>"Min-jae, Kim"]) is not used. Use Last_Name as the criterion ([0=>"Kim Min-jae",1=>"Son Heung-min"]). It's like 2023 cannot be sorted faster than 2022, even though different countries have different date notations.

Thank you.

@snipe
Copy link
Owner

snipe commented Aug 22, 2023

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.

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

@snipe snipe closed this as completed in a48762c Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants