-
Notifications
You must be signed in to change notification settings - Fork 59
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
Control for users to switch languages #622
Conversation
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.
Tested and reviewed code changes, looks great!
Co-authored-by: Minh Nguyễn <mxn@1ec5.org>
Co-authored-by: Minh Nguyễn <mxn@1ec5.org>
@@ -326,10 +326,18 @@ map.on("styleimagemissing", function (e) { | |||
Shield.missingIconHandler(map, e); | |||
}); | |||
|
|||
window.addEventListener("languagechange", (event) => { | |||
console.log(`Changed to ${navigator.languages}`); | |||
export function hotReloadMap() { |
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.
This function doesn’t have to be exported anymore.
height: "5em", | ||
width: "20em", | ||
"margin-bottom": "4em", | ||
"margin-top": "0.3em", |
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 only see a couple of the suggestions at a time, because the suggestion menu only appears below the textbox that’s already pretty far down the page. If Tokenfield doesn’t support automatically flipping the menu above the textbox, we should find a different place for the setting as tail work.
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.
Does not appear to have that option unfortunately:
https://github.com/KaneCohen/tokenfield
Object.assign(element.style, { | ||
margin: "0 2.5px", | ||
color: "#444", | ||
}); |
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.
Eventually we should move non-dynamic CSS styling to a stylesheet or at least the <style>
element in index.html. But this is OK for now if we’re going to redesign the feature soon anyways.
Fixes #21
This PR adds a widget that allows a user to select the languages for display:
Initial view:
When the control is opened
If the user clears the language list, it will revert to the browser settings.
We may want to move this over to the buttons, like the samples and the coming legend PR, but I assume that can be tweaked later.
The list of languages is also hard-coded, and the UX is entirely in English. However, I think this is a reasonable starting point from which we can welcome enhancements.