Skip to content

Commit

Permalink
remove targets whose functions can be deferred to Weblate add-ons
Browse files Browse the repository at this point in the history
  • Loading branch information
cfm committed Nov 23, 2021
1 parent 21fd871 commit 3087a86
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ version:
##############

LOCALE_DIR=securedrop_client/locale
LOCALES=$(shell find ${LOCALE_DIR} -name "*.po")
POT=${LOCALE_DIR}/messages.pot
SUPPORTED_LOCALES_LIST=l10n.txt
VERSION=$(shell python -c "import securedrop_client; print(securedrop_client.__version__)")
Expand All @@ -208,12 +207,6 @@ check-strings: ## Check that the translation catalog is up to date with source c
.PHONY: extract-strings
extract-strings: ## Extract translatable strings from source code
@make --always-make ${POT}
@for catalog in $$(find ${LOCALE_DIR} -name "*.po"); do make $${catalog}; done

# Compile loadable/packageable MOs.
.PHONY: compile-translation-catalogs
compile-translation-catalogs: ${LOCALE_DIR}/*/LC_MESSAGES/messages.mo
@for locale in $^; do make $${locale}; done

# Derive POT from sources.
$(POT): securedrop_client
Expand All @@ -233,34 +226,6 @@ $(POT): securedrop_client
$^
@sed -i -e '/^"POT-Creation-Date/d' ${POT}

# Merge current POT with a locale's PO.
#
# NB. freedomofpress/securedrop/securedrop/i18n_tool.py updates via
# msgmerge even though pybabel.update() is available. Here we use
# "pybabel update" for consistency with "pybabel extract".
${LOCALE_DIR}/%/LC_MESSAGES/messages.po: ${POT}
ifeq ($(strip $(LOCALES)),)
@echo "no translation catalogs to update"
else
@pybabel update \
--locale $$(echo $@ | grep -Eio "[a-zA-Z_]+/LC_MESSAGES/messages.po" | sed 's/\/LC_MESSAGES\/messages.po//') \
--input-file ${POT} \
--output-file $@ \
--no-wrap \
--previous
@sed -i -e '/^"POT-Creation-Date/d' $@
endif

# Compile a locale's PO to MO for (a) development runtime or (b) packaging.
${LOCALE_DIR}/%/LC_MESSAGES/messages.mo: ${LOCALE_DIR}/%/LC_MESSAGES/messages.po
ifeq ($(strip $(LOCALES)),)
@echo "no translation catalogs to compile"
else
@pybabel compile \
--directory ${LOCALE_DIR} \
--statistics
endif

# List languages 100% translated in Weblate.
.PHONY: supported-languages
supported-languages:
Expand Down

0 comments on commit 3087a86

Please sign in to comment.