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

Correct untranslated messages #5881

Merged
merged 3 commits into from Apr 1, 2021
Merged

Correct untranslated messages #5881

merged 3 commits into from Apr 1, 2021

Commits on Mar 31, 2021

  1. Fix some translation problems

    Correct some misplaced parentheses in gettext/format calls.
    
    Mark some strings that were being presented untranslated.
    
    Fix locale/session handling on CSRF error. We were translating the
    CSRF error message, then clearing the session and showing the rest of
    the page in the default locale, almost certainly English. We need to
    reevaluate how we want to handle the locale when clearing the session,
    but for now, this just fixes the inconsistency.
    rmol committed Mar 31, 2021
    Copy the full SHA
    073ef56 View commit details
    Browse the repository at this point in the history
  2. Add localization checks to basic source/journalist interface tests

    We haven't really been testing translations. In the page layout tests,
    the content of strings is often only checked after making sure the
    page is *not* translated. This has led to us not catching text which
    didn't get marked for translation, thus being shown in English to
    users who are using a different locale.
    
    This commit includes the following changes to make it easier to test
    that source strings are properly translated:
    
    - a context manager which will xfail a test for a locale if any of the
    message IDs passed to it are not present in the locale's message
    catalog
    
    - a pytest flaky filter which prevents retries of expected failures
    
    - turning off flaky's reporting of successful tests
    
    - functions to obtain test locales and counts to use in testing their
    pluralization rules, which can be used with pytest.parametrize to
    easily run a test in multiple locales, including fuzzing plural
    strings to check that translations are complete, while only trying as
    many variations as the rules need.
    
    Adding locale parameterization to tests increases the overall time
    they take, of course: test_journalist.py went from around 2.5 minutes
    to 3.5 minutes.
    rmol committed Mar 31, 2021
    Copy the full SHA
    5bf8fb1 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2021

  1. Copy the full SHA
    4340070 View commit details
    Browse the repository at this point in the history