Skip to content
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

Sort languages according to user preferences #24

Open
thefuxia opened this issue Feb 23, 2013 · 10 comments
Open

Sort languages according to user preferences #24

thefuxia opened this issue Feb 23, 2013 · 10 comments

Comments

@thefuxia
Copy link
Member

When there are many languages installed, the menu should be sorted like this:

  1. Last used before current selection
  2. Second last used
  3. And so on.
  4. Parse the Accept-Language header and order all matching available languages according to the preference expressed by its numerical value. q=1 should be first, q=0.9 the next and so on. q=0 should be the last in the complete list.
  5. Sort everything else alphabetically.
@thefuxia
Copy link
Member Author

I'm not at home currently, and my laptop sucks for developing. I have a nice class for Accept-Header parsing at home that you could use for 4. Will send a pull request when I'm back.

@franz-josef-kaiser
Copy link
Member

Nice idea. Will try to get over some of the issues this weekend. Thanks :)

@franz-josef-kaiser
Copy link
Member

Just wanted to ask about the status of this enhancement.

@thefuxia
Copy link
Member Author

status: forgotten :)

@franz-josef-kaiser
Copy link
Member

Where the hell is the +1 button when you need it ;)

@stephenharris
Copy link
Member

What, you mean this? 👍

@stephenharris
Copy link
Member

Anyway, I think only remember 1-2 previous choices. If you're flicking between languages (in no particular order) its not helpful to have them all listed by 'last used'. So current at the top - then last used (1-2 languages)- then the rest sorted alphabetically.

Each section should be separated by a line to make the sorting more apparent. Perhaps even label the second section 'last used'?

@franz-josef-kaiser
Copy link
Member

We could build upon this idea: Maybe add a check and only move this in if someone got 5+ or 10+ language files installed? Or maybe we could add a capability check, so it only behaves like this for the admin/super-admin user as those will likely be the developer?

@franz-josef-kaiser
Copy link
Member

@toscho Status: Forgotten again :)

Anyway, do you still have the class laying around somewhere? I'd already be happy about a Gist to see what we are talking about.

@thefuxia
Copy link
Member Author

See Mlp_Accept_Header_Parser and Mlp_Language_Negotiation. This could be adjusted. Maybe I should make thios more abstract in MultilingualPress too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants