code: def language(lang_code):
      '''Force a given language'''
      ctx = None
      if not request:
          ctx = current_app.test_request_context()
          ctx.push()
      backup = g.get('lang_code')
      g.lang_code = lang_code
      refresh()
      yield
      g.lang_code = backup
      if ctx:
          ctx.pop()
      refresh(f language(lang_code):
      '''Force a given language'''
      ctx = None
      if not request:
          ctx = current_app.test_request_context()
          ctx.push()
      backup = g.get('lang_code')
      g.lang_code = lang_code
      refresh()
      yield
      g.lang_code = backup
      if ctx:
          ctx.pop()
      refresh()
docs: Force a given language