Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update translations for 1.3.0 #5243

Merged
merged 19 commits into from
May 11, 2020
Merged

Update translations for 1.3.0 #5243

merged 19 commits into from
May 11, 2020

Conversation

rmol
Copy link
Contributor

@rmol rmol commented May 11, 2020

Status

Ready for review

Description of Changes

Updates translations for 1.3.0.

Testing

For each supported language, check that each of the 15 source strings changed for 1.3.0 has a plausible-looking translation.

Check out this branch (i18n-merge-1.3.0), then run securedrop/bin/dev-shell ./i18n_tool.py --verbose translate-messages --compile to create the .mo files.

Then save this script as check_130_translations.py:

check_130_translations.py
#!/usr/bin/env python3

import gettext
import os
import sys


SUPPORTED_LANGUAGES = [
    "ar",
    "ca",
    "cs",
    "de_DE",
    "el",
    "en_US",
    "es_ES",
    "fr_FR",
    "hi",
    "is",
    "it_IT",
    "nb_NO",
    "nl",
    "pt_BR",
    "ro",
    "ru",
    "sk",
    "sv",
    "tr",
    "zh_Hant",
]


TESTS = [
    "Preferences saved.",
    "Write a message.",
    "Message text too long.",
    "Large blocks of text must be uploaded as a file, not copied and pasted.",
    (
        "You are already logged in. Please verify your codename above as it "
        "may differ from the one displayed on the previous page."
    ),
    (
        "This codename is what you will use in future visits to receive "
        "messages from our team in response to what you submit on the next "
        "screen."
    ),
    "One more thing...",
    (
        'Click the <img src={icon} alt="broom icon" width="16" height='
        '"16">&nbsp;<strong>New Identity</strong> button in your Tor '
        "browser's toolbar. This will clear your Tor browser activity data on "
        "this device."
    ),
    "Remember, your codename is:",
    "Show",
    "Hide",
    "— No Messages —",
    "Important",
    (
        "You were logged out due to inactivity. Click the <img src={icon} "
        'alt="broom icon" width="16" height="16">&nbsp;<strong>New '
        "Identity</strong> button in your Tor browser's toolbar before moving "
        "on. This will clear your Tor browser activity data on this device."
    ),
    "Why download the team's public key?",
]


if __name__ == "__main__":
    translation_dir = sys.argv[1]

    for lang in SUPPORTED_LANGUAGES:
        print("Checking {}...".format(lang))
        os.environ["LANGUAGE"] = lang
        gettext.bindtextdomain("messages", translation_dir)
        missing = False
        for i, t in enumerate(TESTS, 1):
            translation = gettext.gettext(t)
            print("  {}: {}".format(i, translation))
            if lang != "en_US" and translation == t:
                missing = True
                print(
                    'POSSIBLY MISSING TRANSLATION FOR "{}"'.format(t),
                    file=sys.stderr
                )

        if not missing:
            print("Looks good.")

When run with the translations directory as its only argument (e.g. python3 check_130_translations.py securedrop/translations, from the root of your working copy), you should see the 15 strings translated for each supported language, with no unexpected markup (that doesn't match the source string) or other suspicious content in the translated strings. There will be two warnings of possibly missing translations, as "important" is the same word in Catalan and Romanian.

Checklist

If you made changes to the server application code:

  • Linting (make lint) and tests (make test) pass in the development container

If you made non-trivial code changes:

  • I have written a test plan and validated it for this PR

rmol added 19 commits May 11, 2020 13:35
contributors:
  Thalia Rahme
  erinm

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  Joan Montané
  John Smith

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  1000101
  michaela-bot

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  John Hensley
  Robin Schubert

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  Adrian
  Dimitris Maroulidis

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  Zuhualime Akoochimoya
  erinm

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  AO Localization Lab

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  Oktavia
  Sveinn í Felli

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  Øyvind Bye Skille

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  Meteor0id
  kwadronaut

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  Jonas Waga
  erinm

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
contributors:
  Kaya Zeren
  Volkan
  tekrei

updated from:
  repo: https://github.com/freedomofpress/securedrop-i18n
  revision: 28f8f89
@zenmonkeykstop zenmonkeykstop self-assigned this May 11, 2020
Copy link
Contributor

@zenmonkeykstop zenmonkeykstop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Followed test plan with no issues (except 3 false positives on important as French also triggers it).
  • Completed visual review of diff. No code injections spotted.

@rmol rmol changed the title I18n merge 1.3.0 Update translations for 1.3.0 May 11, 2020
@zenmonkeykstop zenmonkeykstop merged commit 0704e10 into develop May 11, 2020
@zenmonkeykstop zenmonkeykstop mentioned this pull request May 11, 2020
2 tasks
@emkll emkll mentioned this pull request Oct 7, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants