2020-06-07 17:41:34 +02:00
|
|
|
PYTHON = python
|
2020-06-11 01:06:30 +02:00
|
|
|
VENV = venv
|
|
|
|
|
|
|
|
XGETTEXT_FLAGS = --no-wrap --language='python' --keyword=_ --from-code='UTF-8' --msgid-bugs-address='rick@gnous.eu' --width=79 --package-name='Tuxbot-bot'
|
2020-06-07 18:29:55 +02:00
|
|
|
|
|
|
|
# Init
|
|
|
|
main:
|
|
|
|
$(PYTHON) -m venv --clear $(VENV)
|
|
|
|
$(VENV)/bin/pip install -U pip setuptools
|
|
|
|
install:
|
|
|
|
$(VENV)/bin/pip install .
|
|
|
|
update:
|
|
|
|
$(VENV)/bin/pip install -U .
|
2020-06-07 17:41:34 +02:00
|
|
|
|
|
|
|
# Blackify code
|
|
|
|
reformat:
|
2020-06-11 01:06:30 +02:00
|
|
|
$(PYTHON) -m black `git ls-files "*.py"`
|
|
|
|
|
|
|
|
# Translations
|
|
|
|
xgettext:
|
|
|
|
for cog in tuxbot/cogs/*/; do \
|
|
|
|
xgettext `find $$cog -type f -name '*.py'` --output=$$cog/locales/messages.pot $(XGETTEXT_FLAGS); \
|
|
|
|
done
|
|
|
|
msginit:
|
|
|
|
for cog in tuxbot/cogs/*/; do \
|
|
|
|
msginit --input=$$cog/locales/messages.pot --output=$$cog/locales/fr-FR.po --locale=fr_FR.UTF-8 --no-translator; \
|
|
|
|
msginit --input=$$cog/locales/messages.pot --output=$$cog/locales/en-US.po --locale=en_US.UTF-8 --no-translator; \
|
|
|
|
done
|
|
|
|
msgmerge:
|
|
|
|
for cog in tuxbot/cogs/*/; do \
|
|
|
|
msgmerge --update $$cog/locales/fr-FR.po $$cog/locales/messages.pot; \
|
|
|
|
msgmerge --update $$cog/locales/en-US.po $$cog/locales/messages.pot; \
|
|
|
|
done
|