aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/mg_globals.py
Commit message (Collapse)AuthorAgeFilesLines
* en_US is always availableSebastian Spaeth2012-12-021-2/+0
| | | | | | | | | | | We were using "en" as fallback only when no preferred language matched. This is obviously bad. Always insert en_US as available locale, so we can match it with the accept_languages. Don't set available_locales as mg_global, per discussion with paroneaya, make it a global var in translate.py Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Honor user's browser language (#558)Sebastian Spaeth2012-12-021-0/+2
| | | | | | | | | | | | | Previously we would attempt to satisfy the user's first language preference, immediately falling back to english if that was not possible. Now, we will get the best match of the user's preferred languages. This requires storing the available locales on app startup, so we have mg_globals.available_locales ready to compare them against the list of preferred user languages. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fix i18n in our browserSebastian Spaeth2012-12-011-5/+2
| | | | | | | | | | | | | | | | | | We only ever served english pages since the switch to werkzeug's requests. Fix this by actually checking the accepted languages that our web browser sends and using that or falling back to english. This is not optimal, imaging our browser sends "klingon, de" as accepted languages and we happen to not have a klingon translation ready (a deficiency that should be corrected immediately anyway!!). We would then fall back to english rather than sending the sensible and pleasant German language which the user would understand. This will require more backend work though. Removing the gettext.find() in mg_globals.py. It looked in the wrong directory anyway (mediagoblin/translations) and as that does not exist, had always returned None without anyone noticing. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* make mg_globals.translations thread-safeJakob Kramer2012-07-181-1/+5
| | | | | I added mg_globals.thread_scope (an instance of threading.local) and made `translations' an attribute of it.
* It's 2012 all up in hereChristopher Allan Webber2012-02-021-1/+1
|
* Merge branch 'i507_beaker_cache'Christopher Allan Webber2011-09-051-0/+3
|\
| * Basic beaker caching functionality added to the application.Christopher Allan Webber2011-08-231-0/+3
| |
* | 508. Updates copyright/license informationWill Kahn-Greene2011-09-011-1/+1
|/
* Adds license headerWill Kahn-Greene2011-07-301-0/+15
|
* removed email variables from globals moduleDeb2011-07-121-6/+0
|
* Documenting the setup_globals function.Christopher Allan Webber2011-06-191-0/+6
|
* Document our new global objects added during the configobj branchChristopher Allan Webber2011-06-191-0/+8
|
* Merge remote branch 'remotes/elrond/idea/globals_check'Christopher Allan Webber2011-06-191-0/+11
| | | | | Conflicts: mediagoblin/tests/test_globals.py
* mediagoblin.globals->mediagoblin.mg_globalsChristopher Allan Webber2011-06-121-0/+33