Custom Query (1173 matches)
Results (124 - 126 of 1173)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#558 | fixed | Honour user's browser language preference | ||
Description |
A user accepting "klingon, de-de, de, it" will currently be served english web sites, as we try to serve the 1st choice and fall back to english if not available. (WHY don't we have a klingon translation by the way???) We need to fetch a list of available translations and match that up again the browsers accepted languages coming up with the best choice to use. For this we can use 2 options: werkzeug.accepted_languages.best_match(['de', 'en']) which would be good, but probably is not sufficiently clever: initial test seems to show that preferred: "de-de, "en" available: "de", "en" would negotiate "en". Alternatively there is "babel.negotiate" which seems to be cleverer and return "de" if preferred "de-de, en" and available "de, en". Investigate and fix. |
|||
#562 | fixed | Don't lower()/upper() locales all the time. | ||
Description |
We will store available (=translated) locales in the form "es_CR". The function get_locale_from_request(request) in tools/translate.py will find the best_match() best on what the webbrowser wants and what we can offer. It will return one of the AVAILABLE_LOCALES items (which we know will be of the form "lc_UP", to there is no need to invoke "locale_to_lower_upper" on every return value. Only invoke that when we parse user input (through the GET/POST parameters to normalize their input). This is probably not costing too much, but it's one more function that is needlessly called for every request we make. |
|||
#564 | fixed | Cookie blocking leads to cryptic errors | ||
Description |
Trying to log in, I received a "403 Forbidden" page with no further information, the GMG log included a "ERROR [mediagoblin.meddleware.csrf] CSRF cookie not present" statement. It took a while until I realized it was my cookie blocker that caused this. Can we capture this specific case somehow and test whether cookie setting is disabled? I know that django tries to set test cookies at some points in time. Perhaps this should be tested in the CSRF meddleware in case of CSRF failure? In any case, we should hand back a nicer error message than 403 forbidden when the user has cookies disabled :-). |