Translations

Quick Start Guide

SecureDrop is a system that lets people share sensitive information with investigative journalists anonymously and securely. Learn more about SecureDrop.

The SecureDrop Client is a component of the SecureDrop Workstation, a new tool to enable journalists to communicate with anonymous sources and manage submitted documents via their SecureDrop, while providing mitigations against malware and other security risks. The Workstation and its components, including the Client, are currently in a limited beta phase.

Both SecureDrop and the SecureDrop Client are written in English and translated into multiple other languages. Translations are managed using Weblate, a web platform that enables collaborative translation projects.

Getting help

If you’re interested in helping with translation and have questions about anything in this document, here’s how to ask for help:

How is SecureDrop translated?

SecureDrop is translated using the Weblate platform.

Sources, journalists and admins use localized versions of SecureDrop. A malicious actor could attempt to modify their behavior by creating misleading translations. In order to mitigate that risk, all translations must be reviewed and accepted by designated reviewers before they become part of SecureDrop.

When does SecureDrop’s translation happen?

All of SecureDrop’s components can be translated continuously, as new code and source strings are merged into the project. Translations are then finalized during the release process.

This process is coordinated in collaboration with Localization Lab. You can watch for the announcements published in multiple locations.

Workflow Diagram

_images/translations-workflow.png

A workflow diagram showing the continuous translations process.

Translation Responsibilities

  1. Developers must use make extract-strings to keep the catalog template up to date with changes they’ve made to UI strings in the Python source code. Developers are encouraged to commit make extract-strings changes along with the source-code changes that caused them, for a cleaner Git history to review and (if necessary) blame and revert.

    • CI will enforce this requirement via make check-strings on branches pushed to this repository. Like the other linters, this check must pass for a pull request to be approved for merge into main.

    • Developers can run make check-strings locally.

  2. Maintainers should keep in mind that pull requests they review will include changes to the catalog template for any strings changed in the source code. They should consider the impact and timing of these changes on translators—just as they consider the impact and timing of code changes on other developers—as part of their review of a pull request prior to approving it for merge into main and thereby into Weblate.

  3. Translators can always see the latest strings available to translate in weblate. They can translate new and changed strings continuously, as development progresses, and they can give feedback on strings well in advance of the release period.

  4. Release and localization managers do not need to do anything special outside of preflight testing! As summarized above, developers are responsible for keeping strings up to date; Weblate is responsible for keeping the per-language editable .po catalogs and loadable .mo machine objects up to date.

Tutorial for Developers

Let’s say you’ve made the following string change in the Client’s Python source code:

$ git diff
diff --git a/securedrop_client/app.py b/securedrop_client/app.py
index 6b95eda..13ee15d 100644
--- a/securedrop_client/app.py
+++ b/securedrop_client/app.py
@@ -175,7 +175,7 @@ def prevent_second_instance(app: QApplication, unique_name: str) -> None:
         if e.errno == ALREADY_BOUND_ERRNO:
             err_dialog = QMessageBox()
             err_dialog.setText(
-                _("{application_name} is already running").format(
+                _("{application_name} is already running!").format(
                     application_name=app.applicationName()
                 )
             )

When you commit and push this change, you’ll receive the following error in CI:

writing PO template file to securedrop_client/locale/messages.pot
Translation catalog is out of date. Please run "make extract-strings" and commit the changes.
make: *** [check-strings] Error 1

As prompted, run make extract-strings and commit and push the changes:

$ make extract-strings
[...]
writing PO template file to securedrop_client/locale/messages.pot
$ git diff
diff --git a/securedrop_client/app.py b/securedrop_client/app.py
index 6b95eda..13ee15d 100644
--- a/securedrop_client/app.py
+++ b/securedrop_client/app.py
@@ -175,7 +175,7 @@ def prevent_second_instance(app: QApplication, unique_name: str) -> None:
             if e.errno == ALREADY_BOUND_ERRNO:
                 err_dialog = QMessageBox()
                 err_dialog.setText(
-                _("{application_name} is already running").format(
+                _("{application_name} is already running!").format(
                         application_name=app.applicationName()
                     )
                 )
diff --git a/securedrop_client/locale/messages.pot b/securedrop_client/locale/messages.pot
index 51c95cc..524cdde 100644
--- a/securedrop_client/locale/messages.pot
+++ b/securedrop_client/locale/messages.pot
@@ -16,7 +16,7 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Generated-By: Babel 2.9.1\n"

-msgid "{application_name} is already running"
+msgid "{application_name} is already running!"
 msgstr ""

 msgid "The SecureDrop server cannot be reached. Trying to reconnect..."
$ git commit --all --message "changes a string"
[i18n 3637b3d] changes a string
 2 files changed, 2 insertions(+), 2 deletions(-)

When you open a pull request for your branch, a maintainer will review your string changes for their translation impact.

Weblate

Get started using Weblate

You can choose to register on Weblate with your email address, or by linking a GitHub account.

You can contribute to any language, and Weblate has some conveniences to make it easier to work with your preferred languages. Learn how to choose your preferred languages on Weblate.

Our Weblate instance only contains one project, SecureDrop, which has four translation components:

  1. SecureDrop: The main SecureDrop web application.

  2. desktop: The translations for the desktop icons of the admin and journalist workstations used by news organizations.

  3. SecureDrop Glossary: Weblate’s internal glossary for SecureDrop terms.

  4. SecureDrop Client: The SecureDrop Client interface of the SecureDrop Workstation.

_images/project.png

Components of the SecureDrop project in Weblate. Click on the image to see it full-size.

Once a string is translated, it must be approved by a reviewer before being accepted into SecureDrop.

Approved strings can only be modified by reviewers. However, translators can still suggest modifications and make comments if they notice something wrong. SecureDrop translations are a collaborative endeavour!

Learn how to translate SecureDrop using Weblate.

How to register an account on Weblate using an email address

  1. Visit the Weblate registration page.

  2. Fill the form Register using email and click Register.

  3. Check your email for a message from weblate@securedrop.org with the subject [Weblate] Your registration on Weblate.

  4. That message contains a confirmation link. Click that link to complete your registration.

_images/registration.png

Weblate registration page. Click on the image to see it full-size.

How to register an account on Weblate using a GitHub account

  1. Visit the Weblate registration page.

  2. Click on the GitHub icon, under Third party registration.

  3. Log into GitHub if necessary.

  4. Click the green Authorize freedomofpress button.

The authorization request looks like this:

_images/github-authorization.png

GitHub authorization request. Click on the image to see it full-size.

How to manage your preferred languages on Weblate

  1. Visit the Weblate dashboard.

  2. Click the Manage your languages button.

  3. Select the languages your want to translate.

  4. Click the Save button.

_images/manage-languages.png

Language preferences in Weblate. Click on the image to see it full-size.

How to translate a language on Weblate

  1. Visit the Weblate dashboard.

  2. Click on the component in order to display the list of languages in which it is translated.

  3. Click the Translate button.

  4. Start translating.

_images/translations.png

List of available languages in Weblate. Click on the image to see it full-size.

How to translate a phrase on Weblate

  1. Select a language.

  2. Read the translatable string in the text area labelled Source.

  3. Review the suggested translations if there are any in the Glossary sidebar.

  4. Review the contextual information about the source string in the Source information sidebar, like its location in our source code.

  5. If a screenshot of the SecureDrop user interface is available, read the source string in context.

  6. Input your translation in the Translation test area near the source string.

  7. Click Save. The next untranslated string will appear automatically.

_images/translate.png

Translating a phrase in Weblate. Click on the image to see it full-size.

How to use the language glossaries on Weblate

Weblate contains an internal glossary for each language, to which we can add suggested translations. If a source string contains terms from this glossary, the glossary entries will be displayed in a box on the right side of the translation page.

_images/glossary-sidebar.png

Glossary sidebar in Weblate. Click on the image to see it full-size.

If you find that a source string contains terms from the SecureDrop glossary or the EFF Surveillance Self-Defense glossary, but the glossary sidebar says No related strings found in the glossary., we’d really appreciate it if you could add those terms to the glossary of the language you’re working with.

Glossary

Weblate contains an internal glossary for each language, to which we can add suggested translations. Learn more about using language glossaries on Weblate.

_images/glossary-list.png

A language glossary in Weblate. Click on the image to see it full-size.

If a term is missing from the glossary for the language you’re translating into, you can refer to the following technical glossaries for additional context. Then you can contribute to improving your own language glossary on Weblate by suggesting a translation yourself!

Additionally, here is a list of terms that are specific to the usage of Weblate for SecureDrop.

Reviewer

Reviewers are people who are trusted to review and accept new translations into SecureDrop. Learn how to become a reviewer.

Source string

On Weblate, the phrases being translated are called source strings. (No relation with the terms source and journalist in SecureDrop.)

Source strings are English phrases and are automatically extracted from SecureDrop’s code. Because of that, they can only be modified by developers outside Weblate. Learn how to suggest changes to a source string.

How-To Guides

How to suggest changes to a source string

If you notice errors in our source strings, or catch us using English idioms that are hard to translate, please add comments letting us know. We appreciate your feedback very much and our release schedule includes a few days at the beginning of every translation cycle for incorporating it.

How to use SecureDrop’s demo server

The demo server always showcases the latest release candidate of SecureDrop.

Unlike a real SecureDrop instance, you can access the demo server using any web browser.

You can use it to review new source strings in the context in which either a source, or a journalist would read them. Those two experiences are called the Source Interface and the Journalist Interface.

In order to review the demo server as a source:

  1. Visit SecureDrop’s demo server.

  2. Click on the “Source Interface” link.

In order to review the demo server as a journalist:

  1. Visit SecureDrop’s demo server.

  2. Take note of the username, passphrase and current TOTP token at the bottom of the page; you will need them to log in.

  3. Click on the “Journalist Interface” link.

  4. Input the username, passphrase and current TOTP token (“Two-factor Code”) to log in.

How to become a reviewer

Contact Localization Lab to ask to join a language team as a reviewer.

How to add a new language to SecureDrop

We love seeing SecureDrop translated into new languages. Contact Localization Lab to ask to join a language team (or start a new one) and have the new language added to Weblate.

However, SecureDrop only supports a subset of all the languages being worked on in Weblate. New languages are supported according to the Policy on Supported Languages.

How to change an existing translation

If you think a translation can be improved, please don’t run roughshod over another translator’s work. Make a suggestion or comment first, to allow for discussion before saving your changes.

Exceptions to this policy would be:

  • Obvious errors in spelling, grammar, or punctuation

  • A string in our interface that is supposed to match another project. For example, we include instructions for adjusting Tor Browser settings, so if our wording is out of date, it has to be corrected to reduce confusion for people using SecureDrop.

In those cases, please feel free to correct the existing translation.

How to translate a phrase with placeholders

Source strings may contain placeholder text in curly braces, for example {count}. These represent variable content (like a username, as in the example below), and must be left unmodified, but they can be moved around in a string. For instance:

Edit user {user}

might be displayed to the user as:

Edit user Jean-Claude

The French translated string should look like:

Modifier l'utilisateur {user}

And it would be incorrect to translate the placeholder like so:

Modifier l'utilisateur {utilisateur}

How to translate a phrase with HTML code

Some source strings represent HTML that will be presented in the SecureDrop web interface.

HTML elements (embraced by in <, >, example: <strong>) can contain multiple so-called attributes.

The text of the two attributes called alt and title should be translated. The text of the other attributes should not be translated.

Attribute alt

Image elements (<img>) in HTML place a picture on the page. Because people with visual impairments rely on a special note on the image element – the alt attribute – to describe the image, it is necessary to translate those. Here’s an example that contains an image with both an alt attribute and a placeholder:

<img src="{icon}" alt="shield icon">

As explained above, the placeholder {icon} in the src attribute of the <img> element should not be translated. The alt attribute text ("shield icon") should be. The correctly translated HTML in Portuguese would be:

<img src="{icon}" alt="ícone do escudo">

Attribute title

Links (<a>) and abbreviations (<abbr>) sometimes rely on an additional title attribute. The content of that attribute is usually shown when placing a cursor over the link or abbreviation.

<a id="recommend-tor" title="How to install Tor Browser" href="{url}">Learn how to install it</a>

It is necessary to translate the contents of any title attribute. The correctly translated HTML in Spanish would be:

<a id="recommend-tor" title="Cómo instalar Tor Browser" href="{url}">Aprenda cómo instalarlo</a>

As explained above, the text content recommend-tor of the id attribute in the <a> element should not be translated. Neither should the {url} placeholder of href attribute. Only the text content of the title attribute ("How to install Tor Browser") should be translated.

Other attributes

No attribute other than alt and title should be translated.

In particular, please make sure the attributes class, id, height, href, rel, src and width are never translated.