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

feat: add language selector in UI #449

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

jlsOsorio
Copy link
Contributor

Refactor the language selector in order to display a pre-styled popup/modal with the available languages and add to the initial login page and the sidebar. The refactor has to do only with the appearance that could fit well in both scenarios, as long as it is a reusable component.

Refactor the language selector in order to display a pre-styled popup/modal with the available languages and add to the initial login page and the sidebar. The refactor has to do only with the appearance that could fit well in both scenarios, as long as it is a reusable component.
@jlsOsorio jlsOsorio added the enhancement For suggesting improvements to existing features label Nov 19, 2024
@jlsOsorio jlsOsorio requested a review from pstamatop November 19, 2024 12:38
@jlsOsorio jlsOsorio self-assigned this Nov 19, 2024
@jlsOsorio jlsOsorio linked an issue Nov 19, 2024 that may be closed by this pull request
@pstamatop
Copy link
Contributor

Sorry for the delay in reviewing this! The current implementation looks great but I have a couple of suggestions:

  • Label for the Language Setting:
    Instead of "Language," would it make sense to show the actual selected language (e.g., "English")? This could give users immediate clarity and save them a step if they just want to confirm their language.

  • Dropdown Instead of Modal:
    A dropdown might be worth considering to make the process feel quicker and more lightweight. On mobile screens, where space is limited, it could also feel less disruptive compared to opening a separate modal.

Let me know what you think! 🙌

@jlsOsorio
Copy link
Contributor Author

Sounds great! We actually changed the dropdown style because it didn't feel great in the sidebar the way it was before. Perhaps we could think of positioning the dropdown options container next to the sidebar, aligned with the select language element, whenever toggled.

@pstamatop
Copy link
Contributor

You're right about the sidebar, it might be weird to have a dropdown there.
Another thought would be to add the lang selection on the Settings page (not passkey-locked as it is for other options but free to edit). We're planning to toggle light/dark theme there so it might be a good place to configure the language as well despite of having to add an extra step for the user.
As for the login page, I think having a dropdown with flags or alpha-2 codes (e.g. EN) would fit.
What do you think?

@jlsOsorio
Copy link
Contributor Author

Great! We'll work on it that way, then. I believe in the Settings section it won't be a problem. Also, in Settings, do you intend to display the full labels in the dropdown, instead of only the flags/alpha-2 codes?

@pstamatop
Copy link
Contributor

Sorry for any back-and-forth on my part but I think that your initial approach of using full labels + flags would be the most user-friendly way to go, especially in the Settings section.
I only suggested alpha-2 codes as a potential space-saving measure for the login page, but honestly, we should only consider that route if the dropdown ends up feeling visually bloated. Otherwise, sticking with full labels + flags for consistency across the app would probably create the best experience.

Set language selector back to dropdown layout. The options are now available in the Login page, with only the alpha-2 code (flag) and in Settings with the full label. The Login page is not displaying the full label because it would turn the layout messy, overlapping the main description.
The selected language will be stored in the local storage. If the user didn't select any language, it will check if the browser language can be used, i.e., if there is a translator file for that language. If not, it will use the default one (English).
@pstamatop
Copy link
Contributor

Thanks so much for your patience with all the feedback! After discussing further, we’ve been reconsidering the use of flags for the language options, especially for English. Since English isn’t tied exclusively to a single country, using a 🇺🇸 flag might feel a bit limiting or even misleading for some users.

To handle this, we’re thinking it might be better to either:

  1. Avoid flags entirely
  2. Add two options for English using their respective ISO codes (en-US, en-GB) internally and distinctive labels like:
    • 🇺🇸 English (US)
    • 🇬🇧 English (UK)

If we go with the second option, we’ll need to account for nuances between the two, such as minor text differences, date formats or other regional conventions. It’s not a major blocker but something to keep in mind as we move forward.

We’re happy to help with these adjustments if needed, but feel free to proceed in whichever way works best for the flow you have in mind. Let us know your thoughts!

@jlsOsorio
Copy link
Contributor Author

I got your point. Actually, I think both approaches will have pretty much the same impact on the flow. The hardest mission here would be discerning similar languages in the translation .json files. Even without the flags, shouldn't we still have a reference for each language? If not, how to know what should we adopt? For instance, for the English one, should we go with the US or UK?
(If this is Europe wide, we might go with the UK)

@pstamatop
Copy link
Contributor

To keep things simple for now, we could go with a single english option using the current texts (no flag and no distinction between US or UK). This avoids any immediate complexity and we can of course revisit in the future if we decide to separate them into regional variations and add flags or more elaborate country-codes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For suggesting improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create language selector flow
2 participants