Revision 341a72d8
[#1534] Type MIME de /i18n
Corrige le type MIME renvoyé lorsqu'on accède aux traductions JS.
Change-Id: Ifb2be95433abef62b3b8eeeb11ef0752a722666c
Refs: #1534
Reviewed-on: https://vigilo-dev.si.c-s.fr/review/2097
Tested-by: Build system <qa@vigilo-dev.si.c-s.fr>
Reviewed-by: Francois POIROTTE <francois.poirotte@c-s.fr>
vigigraph/controllers/root.py | ||
---|---|---|
9 | 9 |
# W0613: Unused argument : les arguments des contrôleurs sont les composants |
10 | 10 |
# de la query-string de l'URL |
11 | 11 |
|
12 |
|
|
12 |
import gettext |
|
13 |
import os.path |
|
13 | 14 |
import logging |
14 |
from tg import expose, require, config |
|
15 |
|
|
16 |
import pylons |
|
17 |
from tg import expose, require, config, response |
|
18 |
from tg.controllers import CUSTOM_CONTENT_TYPE |
|
15 | 19 |
from pylons.i18n import lazy_ugettext as l_, get_lang |
16 | 20 |
from repoze.what.predicates import Any, All, not_anonymous, \ |
17 | 21 |
has_permission, in_group |
... | ... | |
58 | 62 |
|
59 | 63 |
@expose() |
60 | 64 |
def i18n(self): |
61 |
import gettext |
|
62 |
import pylons |
|
63 |
import os.path |
|
64 |
|
|
65 | 65 |
# Repris de pylons.i18n.translation:_get_translator. |
66 | 66 |
conf = pylons.config.current_conf() |
67 | 67 |
try: |
... | ... | |
108 | 108 |
translations += fhandle.read() |
109 | 109 |
fhandle.close() |
110 | 110 |
|
111 |
response.headers['Content-Type'] = 'text/javascript; charset=utf-8' |
|
111 | 112 |
return translations |
Also available in: Unified diff