-
Notifications
You must be signed in to change notification settings - Fork 48
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: lang select #19
Conversation
This pull request introduces 1 alert when merging 316299f into 635ae3f - view on LGTM.com new alerts:
|
interesting idea, though usually when setting a language on a webpage I also set the locale.. e.g. |
Closed it by mistake... I'll make a few changes and open a new one. |
I took a list of language codes (in en-us, en-gb format) from here.
|
This pull request introduces 1 alert when merging 09cb6a8 into 635ae3f - view on LGTM.com new alerts:
|
I think many of these are not valid, the country code needs to be 2 characters.. and I think many of the ones on that list are not needed (for example en-DE)... think we should look for a better source |
Can you help me to find a good source? |
sure, I'm looking now... :-) |
This pull request introduces 1 alert when merging 2ad3712 into 635ae3f - view on LGTM.com new alerts:
|
I had never researched what these actually are. They appear to be ISO 639-1 codes. Here's a list in CSV format. alpha2,English |
But this list not contains en-us, en-gb and etc. as @coliff proposed. It looks like a first list I used. |
Here's the BCP 47 spec https://tools.ietf.org/html/bcp47 I think we can safely use a subset. Can we let people who know better enter their own? |
Sorry, I didn't understand your message. |
We can add "custom" option to autoselect and put it second after "en". After choosing "custom" user will get another prompt where he can enter custom value (without validation - ?) |
Yes, especially if we can let people type in something. |
@roblarsen another ISO 639-1 autocomplete with "custom" option. What do you think?
Result (index.html): <!doctype html>
<html class="no-js" lang="en-US"> |
That interface looks okay to me. How do we run and test this locally? I know you mentioned it before, but I've lost track of where |
I just had a quick look - I think the interface is good also. One request though, if possible, it'd be good at the 'Select language' option to be able to type 'de' to show 'German'... as in the search results included the language code as well as the language name. If it's not easily possible then no problem, just thought it might be useful. I do a lot of work on localisation of sites so am more familiar in using the language codes rather than typing in the language name, :-) |
Also / or, if search results had language code in brackets after the language name - that'd be helpful!
|
@coliff looks good?
@roblarsen you can git clone this branch and run |
This pull request introduces 1 alert when merging b52b92c into 0b00f9f - view on LGTM.com new alerts:
|
@vltansky great work! I just tested your latest update and it looks great. I can now type |
Ok, it's done and ready for merge as for me.
|
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 looks good to me. Let's get this merged. We just need to resolve the conflict.
Done :) |
@roblarsen can we merge this? |
done! |
Types of changes
Checklist:
This is a draft feature. I didn't make tests for it yet.
Autocomplete prompt to select HTML lang attribute from this country list
Prompt looks like this:
What do you think?
P.S
Video.