-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add language selection dropdown #994
Add language selection dropdown #994
Conversation
* Initial replacements testing OK so far * Add language selection dropdown * Don't store lang preference * Align dropdown to the right. Remove unneeded code from fw.css * Make dropdown scrollable * Clean/move/improve css styling, add icon, lang sel. outline * Remove unneeded css * Show full lang names, automate adding langs * AUTO: Add new language: (eu) #4 * Revert "AUTO: Add new language: (eu) #4" This reverts commit 301c948. * Correction * AUTO: Add new language: (Basque) #5 * Update add-lang.yml * AUTO: Add new language: (English (American)) #6 * Correction * Revert language additions * Correction * Correction * Update * Update * Add check * Update error message * Revert lang code hyphens * Add changes by @gilgongo * Combine with gilgongo's stuff * Correct title check * Correct pt-BR language codes * Revert lang code changes --------- Co-authored-by: Gilgongo <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
As commented in #993, the check fails because of lang code mismatches that will be fixed after this PR is merged. To test the language dropdown version of the website, links to working artifacts will be posted in comments below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I see the benefits. The redirect would be a new feature and it seems to be possible to click the picker to get back to another language if it fails.
What would a classic html select/option box with some styling be as alternative? It would be much better integrated in mobile OS and be standard compliant: |
I'd like to be part of the final review on this one. |
Regarding avoidance of reliance on javascript:
That should be pretty transparent to the user - the benefit of the auto-detect (and then the widget having local storage) would be there for those who are happy to have javascript and local storage enabled but the functionality wouldn't be lost for other users. |
@ann0see, @pljones: I have a new version that doesn't do language detection nor uses javascript, and the css styling is moved to its own |
Yes. |
We'll need to verify the accessibility of this at some point too. Not sure how best to do that though (I see there's some Aria tags though). |
As I said above, I'd assume that a select box is more accessible. But IDK if clicking easily works without JS. We could use a form. |
Thanks, I'll give it a go. |
@ignotus666 also please check with #994 (comment) multiple issues are showing up in the w3c validator. |
Oops, a stray line got left in there (but not in this PR). Fixed version is here.
What file am I supposed to upload there, |
Ok. No you should upload the compiled index.html from the artifact and check for new errors then. |
Right. So the main complaint (that differs from the next-release errors) seems to be that "canonical" in |
My understanding is that |
I traced the problem back to nav.html. I think it's sorted now. Link to artifact. Tell me if this one seems ok and then I'll add the changes to this PR. |
That looks good. I don't know whether the links in the nav to things like |
Here's what I found:
|
Latest version: artifact. |
_includes/headtags.html
Outdated
{% endfor %} | ||
<link rel="alternate" hreflang="x-default" href="{{ site.url }}/{{ site.default_lang }}{{ page.url }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that this is not correct: it will produce /en/ but there is no /en/ subpage.
<link rel="alternate" hreflang="x-default" href="{{ site.url }}/{{ site.default_lang }}{{ page.url }}"> | |
<link rel="alternate" hreflang="x-default" href="{{ site.url }}/{{ page.url }}"> |
is probably correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope the whole canonical/alternate thing is correct then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see Google says "The new x-default
hreflang attribute value signals to our algorithms that this page doesn't target any specific language or locale and is the default page when no other page is better suited."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which we could argue is ok for en.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that this is not correct: it will produce /en/ but there is no /en/ subpage.
Yes, you're right.
Co-authored-by: ann0see <[email protected]>
Ok. Thanks! It was a long ride but now hopefully it's all good. We'll probably need to check the site before publication for e.g broken links and so. |
You can say that again... ;) . Right, now before unlocking Weblate or merging anything else here there are a couple of things that need doing (see description of this PR). Hopefully I'll have some time tonight to put it together. |
@ignotus666 I'm looking the the I also notice a |
In theory next-release. But I'd rather wait until the translations have settled even though it shouldn't have conflicts |
Short description of changes
Adds a language selection dropdown to the website.
The website also detects what language the user's browser is in and initially displays itself in that language.Scripts automating the addition of new languages have been updated to support adding the full language name + language code.
It also includes the changes from #988 and #990 so as to avoid conflicts between PRs and include all the changes here.
TODO after merging this:
add-lang
andpo4a-add-language
scripts into release.See Add language selection dropdown #993.
Context: Fixes an issue? Related issues
Fixes #977, #986 and #992
Status of this Pull Request
Should be ready pending a review.
What is missing until this pull request can be merged?
Would be good if some more people can test it.
IMPORTANT: Weblate stuff should be merged first.
Does this need translation?
No.