Skip to content

Commit

Permalink
Merge branch 'flask-template-helper'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ydrasil committed May 23, 2017
2 parents 6450ec5 + a158c01 commit 13c267b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tcii18n/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

def flask_methods(app, get_translations_file):
@app.context_processor
def trans(sentence):
translator = Translator(get_translations_file())
return translator.translate(sentence)
def utility_processor():
def trans(sentence):
return Translator(get_translations_file).translate(sentence)
return dict(trans=trans)

0 comments on commit 13c267b

Please sign in to comment.