-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
feat(locale): introduce 'Locale' component #445
Conversation
/** | ||
* Represents a locale identifier. | ||
*/ | ||
enum Locale: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cases for this enum were mostly generated using a script, we could add more in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to include said script and check from time to time that new locales are added automatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I used actually, but had to go over the result manually and update some names as they contained non-ASCII characters.
I think it would be nice to have a nice script for this in the future, but I don't see the value on having this in the repo.
foreach (\ResourceBundle::getLocales('') as $locale) {
$name = \Locale::getDisplayName($locale, 'en');
$name = \Psl\Str\replace_every($name, [
'(' => '',
')' => '',
'[' => '',
']' => '',
',' => '',
'.' => '',
'&' => '',
'-' => '',
' ' => '',
]);
echo 'case ' . $name . ' = "' . $locale . '";' . PHP_EOL;
}
Pull Request Test Coverage Report for Build 8338640735Details
💛 - Coveralls |
Signed-off-by: azjezz <azjezz@protonmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
No description provided.