Git Product home page Git Product logo

Comments (1)

jameysharp avatar jameysharp commented on July 17, 2024

Having the languages in the form caused two problems. One was a usability challenge: finding and selecting the right language in a list of thousands is hard to do. The other was that having four separate language fields led to four copies of the HTML listing all the languages, which added up to something like a megabyte of text and was quite slow for Django to generate.

Working around the usability issue is super easy for visitors who have JavaScript turned on. There are a ton of usable jQuery plugins for enhanced select widgets and we could pick any of them that look good and drop it in without much trouble. Visitors without JavaScript fall back to their standard browser implementation of a select widget, so they can still fill out the form, it's just less convenient.

The "huge page" problem is a little harder, but solvable if we're willing to rely on JavaScript. For that we need something that does an AJAX request to ask the server to search the list of language subtags. This falls under the category of jQuery plugins for autocomplete (some of which are also in the list of enhanced select widgets above). But this doesn't work at all for people who have JavaScript disabled (using NoScript or lynx or whatever), which is a case that we should support.

If we can get a reasonable list of common languages, we could do a hybrid thing: serve the common languages in pure HTML, and use JavaScript to send AJAX queries for uncommon languages as the visitor types. That gives us small HTML and a usable if incomplete list for non-JavaScript visitors, plus full support for languages with as few as a thousand speakers worldwide for people who turn on JavaScript.

from website.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.