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

FeatureRequest: Hide locale select from UI if only one locale is available #968

Closed
avsdev-cw opened this issue Apr 16, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@avsdev-cw
Copy link
Contributor

commented Apr 16, 2019

It would be handy if the locale select/display could be removed via a setting or if the system could detect when there is only 1 locale available and default to hiding the option to change it etc in that instance.

@lcharette

This comment has been minimized.

Copy link
Member

commented Apr 16, 2019

Kind of a duplicate of #850

Unwanted locale can already be disabled in the config file. See https://learn.userfrosting.com/advanced/i18n#setting-up-the-site-language

I do like the idea of hiding the select if only one locale exist thought. But I'm not sure how complex it would be compare to the benefit of it considering the use of schema and default value...

@avsdev-cw

This comment has been minimized.

Copy link
Contributor Author

commented Apr 16, 2019

It kinda is, we already disable all locales bar en_US.

From our point of view its more of a "if the user doesn't need to use it, they don't need to know it exists" sorta thing.

I have started looking at it myself, but using overrides in another sprinkle. Once I started getting into the depths of it I quite quickly realised that actually there was some work needed in the UF default install. In some place the locale is hidden by a role, but others there is no wrap around it at all so there is a bit of inconsistency there already.

@lcharette

This comment has been minimized.

Copy link
Member

commented Apr 16, 2019

The admin UI controller has a hidden property. Same logic could be used in the normal user setting page controller. Locale field could then be added directly to this hidden array if the number of non null locale is less than 2.

@avsdev-cw

This comment has been minimized.

Copy link
Contributor Author

commented Apr 16, 2019

That's what I was thinking. I'll have to pull a new dev copy down and submit a PR if I get half a chance to look at it again.

@lcharette lcharette changed the title FeatureRequest: Hide locale from UI FeatureRequest: Hide locale select from UI if only one locale is available Apr 16, 2019

avsdev-cw added a commit to avsdev-cw/UserFrosting that referenced this issue Apr 18, 2019

avsdev-cw added a commit to avsdev-cw/UserFrosting that referenced this issue Apr 18, 2019

lcharette added a commit that referenced this issue Apr 18, 2019

lcharette added a commit that referenced this issue Apr 18, 2019

@lcharette

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

Merged in hotfix for 4.2.1 release.

@lcharette lcharette closed this Apr 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.