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
Closed
Labels
core feature request Feature request internationalization Related to the localization feature up-for-grabs Not assigned yet user experience The one using UF

Comments

@avsdev-cw
Copy link
Contributor

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
Copy link
Member

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

@lcharette lcharette added core feature request Feature request internationalization Related to the localization feature user experience The one using UF up-for-grabs Not assigned yet labels Apr 16, 2019
@avsdev-cw
Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Contributor Author

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
Copy link
Member

Merged in hotfix for 4.2.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core feature request Feature request internationalization Related to the localization feature up-for-grabs Not assigned yet user experience The one using UF
Projects
None yet
Development

No branches or pull requests

2 participants