Skip to content

Commit

Permalink
Add flask template helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Ydrasil committed May 18, 2017
1 parent 5937b4f commit 96f7d34
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tcii18n/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from .translator import Translator


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

0 comments on commit 96f7d34

Please sign in to comment.