-
Notifications
You must be signed in to change notification settings - Fork 79
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
Language selection dropdown #992
Comments
I think the red surrounding box and text when a language other than EN is selected isn't really needed, but I can't figure out how to get rid of it. I reckon this should be enough to draw users to click and look for their language (added a downward arrow): Or we could also do it like this (shows active language): |
Perhaps worth adding a pre-selection of the expected language would be a nice addition. |
Could you explain? |
I meant that it would pre-select my language rather the just indicating my local may exist in the list |
So you mean auto-detect the user's OS/browser language? |
I have a version with this implemented. I also managed to get rid of the red box/message. Here's the branch if anyone wants to try it out. |
Correct that is what I meant. As if it can be detected which language the user is most likely using, it would be nice to show the site in that language rather then show the English site and have the browser performing the translation, as most browser are offering to translate the site when it is not displayed in the users language and as a result a typical user may not make use of the translation performed by us. |
|
I can't wait to try this.....just a bit limited doing that at the moment due to holiday. Would it be better to show the language name instead of the shortcode? I.e. English instead of en. Good work on this....hope I can give this a test soon. |
Done.
I did that so the currently selected language stands out more. But it can be aligned.
This is still a PoC, so we can discuss what's best to show there.
The thing about these is that it adds a fair bit of complexity, particularly taking into account that adding languages is automated (and I'd like to keep it that way). |
Maybe add an outline box with curved corners around the selected language, if the widget supports that? Anyway, I think the bold text is enough. (I'd omit the underline, too.) |
Okay, guess the automatic add of a language can still work when using a language + "display name". Anyway can also be done later or not at all. |
Hmm, style changes to the dropdown also affect the navigation menu and I'm having a hard time trying to separate them. I've never messed with css stuff and it's a bit overwhelming... Will come back to it at another time.
I suppose when a language is added and we get the lang code from the issue title with a regex, we could also do the same for the full language name (requesting that it be included in the title) and store it somewhere to be retrieved for the dropdown. |
@pljones what about this?: |
Thinking more about displaying the full language name - I don't think it'll work, for aesthetic reasons. For some languages, particularly those with more than one variant, we'd end up with a massive button to display all the text, e.g. "Português (Portugal)". Once you try to abbreviate that, you might as well just stay with what we already have. Oh, and another thing - it's possible to sort the languages alphabetically. Should we keep English at the top always (and sort the rest), or insert it at its corresponding place? I think I prefer the latter, but whatever. |
First time I have seen this "icon" being used. Looks good to me and is universal for all languages. |
It's quite commonly used. Wikipedia uses it for example. |
Final (or close enough) version:
Further suggestions are welcome. |
@ignotus666 do you have a screenshot as well for the mobile version? |
I think the flag thing is a bit tricky here. My understanding is that the app uses a Qt module or whatever you call it that has lists of languages and flags that you can draw from. Here we'd have to create that whole thing ourselves, I suppose using arrays to store all languages and flags... theoretically possible I guess but a fair amount of work. Or maybe not, there might be an easier way but I'm almost out of my depth with what I have... I'll look into displaying the full language name though for now (in each language if that makes sense), which I think is more doable. |
The scripts to add languages automatically and display the full name in the dropdown have been updated and tested to work. I'll open a PR shortly so the changes can be reviewed in case I missed something. Edit: @gilgongo I've just realised that a PR with this is going to conflict with a number of PRs that are waiting to be merged, in particular #988. I've completely re-done Not sure what the best course of action is. |
@ignotus666 Ah yes I did wonder about that. Seeing as my changes are pretty simple, it would be better to incorporate them in with your PR as they're all related. I can put my PRs into draft, then let you do yours and we can have a look at integrating them at that point? My changes to |
I had a go at creating a dropdown menu for choosing languages instead of the rather ugly horizontal list we currently have. After a number of failed attempts I thought I'd see if Chatgpt could be of any help - and after some back and forth I actually got it working. What do you think?
![lang_select_1](https://private-user-images.githubusercontent.com/4263412/339453842-dfc78cc0-88b9-460c-913c-33c22d62dc5d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0MTQ2NjAsIm5iZiI6MTcyMDQxNDM2MCwicGF0aCI6Ii80MjYzNDEyLzMzOTQ1Mzg0Mi1kZmM3OGNjMC04OGI5LTQ2MGMtOTEzYy0zM2MyMmQ2MmRjNWQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRl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ZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.ZWz4Kv0hbFlkX4rSGL__o9Jl39BgsGEQ3zSmzsy1hWM)
The text was updated successfully, but these errors were encountered: