Skip to content

Commit

Permalink
update_translation_files fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kazet committed Dec 26, 2023
1 parent 6220a93 commit 8c034a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions app/src/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

from jinja2_simple_tags import StandaloneTag

from common.config import Config
try:
from common.config import Config

LANGUAGE = Config.UI.Language
except ImportError:
# This may happen e.g. when pybabel is processing the templates and loading the tempalate tags
LANGUAGE = ""


class BuildIDTag(StandaloneTag): # type: ignore
Expand All @@ -16,7 +22,7 @@ def render(self) -> str:

class LanguageTag(StandaloneTag): # type: ignore
tags = {"language"}
language = Config.UI.LANGUAGE.replace("_", "-")
language = LANGUAGE.replace("_", "-")

@cache
def render(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_translation_files
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi

pip install -r app/translations/requirements.txt

REDIS_URL= PYTHONPATH=app:. pybabel extract \
PYTHONPATH=app pybabel extract \
--omit-header \
--strip-comments \
-F babel.cfg \
Expand Down

0 comments on commit 8c034a9

Please sign in to comment.