##// 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 rhodecode.__version__)[:8]
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 def attach_context_attributes(context, request, user_id):
284 def attach_context_attributes(context, request, user_id):
275 """
285 """
276 Attach variables into template context called `c`, please note that
286 Attach variables into template context called `c`, please note that
@@ -284,7 +294,7 b' def attach_context_attributes(context, r'
284 context.rhodecode_version_hash = calculate_version_hash()
294 context.rhodecode_version_hash = calculate_version_hash()
285
295
286 # Default language set for the incoming request
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 # Visual options
299 # Visual options
290 context.visual = AttributeDict({})
300 context.visual = AttributeDict({})
General Comments 0
You need to be logged in to leave comments. Login now