##// END OF EJS Templates
pyramid: move language extraction into a seperate method.
marcink -
r1904:1a7936c3 default
parent child Browse files
Show More
@@ -271,6 +271,16 b' def calculate_version_hash():'
271 271 rhodecode.__version__)[:8]
272 272
273 273
274 def get_current_lang(request):
275 # NOTE(marcink): remove after pyramid move
276 try:
277 return translation.get_lang()[0]
278 except:
279 pass
280
281 return getattr(request, '_LOCALE_', None)
282
283
274 284 def attach_context_attributes(context, request, user_id):
275 285 """
276 286 Attach variables into template context called `c`, please note that
@@ -284,7 +294,7 b' def attach_context_attributes(context, r'
284 294 context.rhodecode_version_hash = calculate_version_hash()
285 295
286 296 # Default language set for the incoming request
287 context.language = translation.get_lang()[0]
297 context.language = get_current_lang(request)
288 298
289 299 # Visual options
290 300 context.visual = AttributeDict({})
General Comments 0
You need to be logged in to leave comments. Login now