-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Hide locale field when only 1 locale is available (#968) #969
Hide locale field when only 1 locale is available (#968) #969
Conversation
FYI - no conflicts caused by merging with hotfix branch either (currently on develop branch) |
'hidden' => [], | ||
'disabled' => [] | ||
]; | ||
if (count($config->getDefined('site.locales.available')) <= 1) { |
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.
Could reuse $locales
here. Could be mirrored on line 519 for consistency.
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 be more preferable to use:
$localePathBuilder = $this->ci->localePathBuilder;
// Get locale information
$currentLocales = $localePathBuilder->getLocales();
vs
// Get a list of all locales
$locales = $config->getDefined('site.locales.available');
in all cases?
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.
I'm not 100% sure, but I think localePathBuilder
will only return the locale associated with the one currently in use? It will at least return them in the inheritance order.
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.
In any case, this behavior will be changed in #850, so I guess it doesn't matters for now.
As this doesn't introduce any breaking changes, I think it's safe to merge into hotfix. |
So apparently I forgot to change the branch before merging... I'll see what I can do 🤔 |
Ok, fixed. Merged in hotfix for 4.2.1 release. Thanks ! |
No description provided.