Skip to content

Commit

Permalink
Merge pull request #1497 from freedomofpress/1438-supported-languages
Browse files Browse the repository at this point in the history
build: package only translations explicitly marked as supported
  • Loading branch information
sssoleileraaa authored Jul 5, 2022
2 parents bf9a196 + 57e9b40 commit 69c3d7a
Show file tree
Hide file tree
Showing 9 changed files with 593 additions and 581 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ SecureDrop maintainers and testers: As you QA this release, please report back y
## Release tasks

- [ ] Check if there are any security bug fixes waiting to be pulled into the RC
- [ ] Check if there are any translations:
- [ ] pending merge into `main`
- [ ] pending inclusion as a supported language in [`MANIFEST.in`](https://github.com/freedomofpress/securedrop-client/blob/main/MANIFEST.in)
- [ ] Update changelog
- [ ] Create test plan
- [ ] Refresh nightlies
Expand Down
13 changes: 13 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,16 @@ recursive-include securedrop_client *

recursive-exclude alembic *.pyc
recursive-exclude securedrop_client *.pyc


# --- LOCALIZATION ---

# Translations may appear in the tree before we consider them supported, so
# don't include any by default.
prune securedrop_client/locale

# Explicitly include only supported translations, one line for each $LANG, like:
#
# graft securedrop_client/locale/$LANG
#
# Please keep this list alphabetized.
13 changes: 0 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,7 @@ docs: ## Generate browsable documentation and call/caller graphs (requires Doxy

LOCALE_DIR=securedrop_client/locale
POT=${LOCALE_DIR}/messages.pot
SUPPORTED_LOCALES_LIST=l10n.txt
VERSION=$(shell python -c "import securedrop_client; print(securedrop_client.__version__)")
WEBLATE_API=https://weblate.securedrop.org/api/
WEBLATE_COMPONENT=securedrop-client

.PHONY: check-strings
check-strings: ## Check that the translation catalog is up to date with source code
Expand Down Expand Up @@ -237,13 +234,3 @@ $(POT): securedrop_client
$^
@sed -i -e '/^"POT-Creation-Date/d' ${POT}

# List languages 100% translated in Weblate.
.PHONY: supported-languages
supported-languages:
@wlc \
--format json \
--url ${WEBLATE_API} \
list-translations \
| jq -r 'map(select(.component.slug == "${WEBLATE_COMPONENT}" and .translated_percent == 100)) | map("* \(.language.name|tostring) (``\(.translated_percent|tostring)``)") | join("\n")' \
> ${SUPPORTED_LOCALES_LIST}
@git add ${SUPPORTED_LOCALES_LIST}
1 change: 0 additions & 1 deletion requirements/dev-requirements-debian.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ semgrep
toml
types-python-dateutil
types-setuptools
wlc
569 changes: 287 additions & 282 deletions requirements/dev-requirements-debian.txt

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion requirements/dev-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ sip==4.19.8
toml
types-python-dateutil
types-setuptools
wlc
569 changes: 287 additions & 282 deletions requirements/dev-requirements.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion securedrop_client/locale/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
"Generated-By: Babel 2.10.1\n"

msgid "{application_name} is already running"
msgstr ""
Expand Down
3 changes: 2 additions & 1 deletion securedrop_client/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def _check_for_duplicate_jobs(self, job: QueueJob) -> bool:
stored on self.current_job. We check that the job to be added is not among them.
"""
in_progress_jobs = [in_progress_job for priority, in_progress_job in self.queue.queue]
in_progress_jobs.append(self.current_job)
if self.current_job is not None:
in_progress_jobs.append(self.current_job)
if job in in_progress_jobs:
logger.debug("Duplicate job {}, skipping".format(job))
return True
Expand Down

0 comments on commit 69c3d7a

Please sign in to comment.