elementary / initial-setup

New user setup app designed for elementary OS
https://elementary.io
GNU General Public License v3.0
36 stars 12 forks source link

Add additional US layout when non-latin layout is selected #100

Closed davidmhewitt closed 2 years ago

davidmhewitt commented 3 years ago

Fixes #99

When a keyboard layout with non-latin characters is selected, it becomes impossible to progress past the following step, since the username field only accepts ASCII characters.

To remedy this, we add a list of non-latin keyboard layouts, taken from the excellent langtable project, and whenever one of these layouts is selected, we also add an English (US) layout.

This allows typing a username and password using latin characters, and causes the wingpanel keyboard indicator to appear so you can switch between English (US) and the layout you chose to allow typing your full name in your native language for example.

I've also removed the Locale1 DBus calls for changing the layout as the greeter compositor handles this with Mutter.

The experience still isn't ideal as settings-daemon is being too clever and "remembering" the active layout in the session. So if you have your non-latin layout selected when you log out or reboot, then it will be selected the next time the greeter launches, meaning you have to manually switch back to the English layout to type your password. I think it would also be possible to delete the English layout in session, and it would be gone in the greeter too, leaving you unable to enter your password. So there's still a bit of work that needs to be done in the greeter and settings daemon probably.

PlatonB commented 2 years ago

Will this fix come in an upcoming release?

jeremypw commented 2 years ago

I am not sure how to test this fully - running in a terminal fails to actually create the new user (no permission) and trying to run with sudo fails.

jeremypw commented 2 years ago

Does a typical non-technical user know that the password (and username) must be in non-ASCII? It would be nice to have the appropriate keyboard layout automatically selected for those field that demand ASCII input. Or at least give a more informative warning than e.g. "requires lowercase letters" when trying to enter the username in non-ASCII.

Also the password field appears to accept non-ASCII characters but there is no way of seeing what characters are actually being entered. I tried this with Hebrew (RTL) keyboard layout selected but the password displayed the hidden characters in LTR so I am not sure what was actually going in.

However, these issues are probably beyond the scope of this PR, which at least is an improvement.