2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 20:46:47 +00:00

enable live-serving of i18n_static tag in debug (#1560)

* enable live-serving of i18n_static tag in debug

* style repair
This commit is contained in:
Matthias Mair 2021-05-07 15:18:06 +02:00 committed by GitHub
parent 5ed17022f2
commit bdd61fdb2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,8 +200,18 @@ class I18nStaticNode(StaticNode):
return ret
@register.tag('i18n_static')
def do_i18n_static(parser, token):
# use the dynamic url - tag if in Debugging-Mode
if settings.DEBUG:
@register.simple_tag()
def i18n_static(url_name):
""" simple tag to enable {% url %} functionality instead of {% static %} """
return reverse(url_name)
else:
@register.tag('i18n_static')
def do_i18n_static(parser, token):
"""
Overrides normal static, adds language - lookup for prerenderd files #1485