Skip to content

Commit

Permalink
docs: subsection "Localization" section for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
cfm committed Oct 6, 2023
1 parent 6ffacc4 commit 0bd3249
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,22 @@ upgrade-destroy: ## Destroy an upgrade test environment.
#
##############

# Global configuration:
I18N_CONF=securedrop/i18n.json
I18N_LIST=securedrop/i18n.rst

# securedrop/securedrop configuration:
LOCALE_DIR=securedrop/translations
POT=${LOCALE_DIR}/messages.pot
POT=$(LOCALE_DIR)/messages.pot

# securedrop/desktop configuration:
DESKTOP_BASE=install_files/ansible-base/roles/tails-config/templates
DESKTOP_LOCALE_DIR=$(DESKTOP_BASE)/locale
DESKTOP_I18N_CONF=$(DESKTOP_LOCALE_DIR)/LINGUAS
DESKTOP_POT=$(DESKTOP_LOCALE_DIR)/messages.pot

## Global

.PHONY: check-strings
check-strings: $(POT) $(DESKTOP_POT) ## Check that the translation catalogs are up to date with source code.
@$(MAKE) --no-print-directory extract-strings
Expand All @@ -360,6 +365,8 @@ check-strings: $(POT) $(DESKTOP_POT) ## Check that the translation catalogs are
extract-strings: $(POT) $(DESKTOP_POT) ## Extract translatable strings from source code.
@$(MAKE) --always-make --no-print-directory $^

## securedrop/securedrop

# Derive POT from sources.
$(POT): securedrop
@echo "updating catalog template: $@"
Expand All @@ -380,6 +387,8 @@ $(POT): securedrop
$^
@sed -i -e '/^"POT-Creation-Date/d' $@

## securedrop/desktop

.PHONY: check-desktop-files
check-desktop-files: ${DESKTOP_BASE}/*.j2
@$(MAKE) --always-make --no-print-directory update-desktop-files
Expand Down Expand Up @@ -420,6 +429,8 @@ $(DESKTOP_POT): ${DESKTOP_BASE}/*.in
$(DESKTOP_I18N_CONF):
@jq --raw-output '.supported_locales[].desktop' ${I18N_CONF} > $@

## Supported locales

.PHONY: check-supported-locales
check-supported-locales: $(I18N_LIST) $(DESKTOP_I18N_CONF) ## Check that the desktop and documentation lists of supported locales are up to date.
@$(MAKE) --no-print-directory update-supported-locales
Expand All @@ -444,6 +455,8 @@ ${I18N_LIST}: ${I18N_CONF}
supported-locales: ## List supported locales (languages).
@jq --compact-output '.supported_locales | keys' ${I18N_CONF}

## Utilities

.PHONY: translation-test
translation-test: ## Run page layout tests in all supported languages.
@echo "Running translation tests..."
Expand Down

0 comments on commit 0bd3249

Please sign in to comment.