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

feat(translate_messages): filter and disable fuzzy translations #6772

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

cfm
Copy link
Member

@cfm cfm commented Mar 15, 2023

Status

Ready for review

Description of Changes

Closes #6483: msgattrib --no-fuzzy removes fuzzy entries from each translation catalog. msgmerge --no-fuzzy-matching prevents fuzzy entries from being added back when the translation catalog is updated from the template.

Testing

  1. Check out this branch.
  2. Run make translate.
  3. For some language $LANG, confirm that in securedrop/translations/$LANG/LC_MESSAGES/messages.po each msgid marked fuzzy has had its msgstr cleared. For example, compare:

You'll see a lot of other diffs, too, from strings that have changed in develop since the v2.5.0 localization cycle. You can ignore these.

Deployment

Development-only change; no deployment considerations.

@cfm cfm added the i18n Anything related to translation or internationalization of SecureDrop label Mar 15, 2023
@cfm cfm added this to the 2.6.0 milestone Mar 15, 2023
@cfm cfm requested a review from a team as a code owner March 15, 2023 19:45
@cfm cfm mentioned this pull request Mar 15, 2023
4 tasks
"msgattrib --no-fuzzy" removes fuzzy entries from each translation
catalog.  "msgmerge --no-fuzzy-matching" prevents fuzzy entries from
being added back when the translation catalog is updated from the
template.
@cfm
Copy link
Member Author

cfm commented Mar 20, 2023

Rebased from develop without changes.

@legoktm legoktm self-assigned this Apr 14, 2023
@legoktm legoktm merged commit 9c7e13c into develop Apr 14, 2023
@legoktm legoktm deleted the no-fuzzy branch April 14, 2023 20:54
cfm added a commit that referenced this pull request May 31, 2023
…NOME Shell extension

In the original (since lost) 1cfd35b, we treated the GNOME Shell
extension as a separate "securedrop/extension" Weblate component with
its own "translate-extension" command, replicating both
"--extract-update" and "--compile" modes.

In f3d3f04, we treated the GNOME Shell extension as an extension (sorry)
of the main "securedrop/securedrop" component, taking advantage of
Babel's mapping feature to interpret the ".js.in" file as JavaScript.

Here we harmonize both approaches.  "translate-desktop --extract-update"
is now a two-step process, first via Babel over the ".js.in" JavaScript
file, then as usual via xgettext over the ".j2.in" desktop templates.
(This is logically reversed, but Babel appears to have no equivalent of
xgettext's appending "--join-existing" mode.)  "translate-desktop
--compile" does the equivalent via Babel and then msgfmt as usual.

NB. We also add "msgmerge --no-fuzzy-matching" after #6772, which
required rebasing from "develop".
cfm added a commit that referenced this pull request May 31, 2023
…NOME Shell extension

In the original (since lost) 1cfd35b, we treated the GNOME Shell
extension as a separate "securedrop/extension" Weblate component with
its own "translate-extension" command, replicating both
"--extract-update" and "--compile" modes.

In f3d3f04, we treated the GNOME Shell extension as an extension (sorry)
of the main "securedrop/securedrop" component, taking advantage of
Babel's mapping feature to interpret the ".js.in" file as JavaScript.

Here we harmonize both approaches.  "translate-desktop --extract-update"
is now a two-step process, first via Babel over the ".js.in" JavaScript
file, then as usual via xgettext over the ".j2.in" desktop templates.
(This is logically reversed, but Babel appears to have no equivalent of
xgettext's appending "--join-existing" mode.)  "translate-desktop
--compile" does the equivalent via Babel and then msgfmt as usual.

NB. We also add "msgmerge --no-fuzzy-matching" after #6772, which
required rebasing from "develop".
cfm added a commit that referenced this pull request May 31, 2023
…NOME Shell extension

In the original (since lost) 1cfd35b, we treated the GNOME Shell
extension as a separate "securedrop/extension" Weblate component with
its own "translate-extension" command, replicating both
"--extract-update" and "--compile" modes.

In f3d3f04, we treated the GNOME Shell extension as an extension (sorry)
of the main "securedrop/securedrop" component, taking advantage of
Babel's mapping feature to interpret the ".js.in" file as JavaScript.

Here we harmonize both approaches.  "translate-desktop --extract-update"
is now a two-step process, first via Babel over the ".js.in" JavaScript
file, then as usual via xgettext over the ".j2.in" desktop templates.
(This is logically reversed, but Babel appears to have no equivalent of
xgettext's appending "--join-existing" mode.)  "translate-desktop
--compile" similarly does two passes with msgfmt, first to create the
standard gettext directory layout and then to update the desktop
templates.

NB. We also add "msgmerge --no-fuzzy-matching" after #6772, which
required rebasing from "develop".
cfm added a commit that referenced this pull request May 31, 2023
…NOME Shell extension

In the original (since lost) 1cfd35b, we tried to treat the GNOME Shell
extension as a separate "securedrop/extension" Weblate component with
its own "translate-extension" command, replicating both
"--extract-update" and "--compile" modes.

In f3d3f04, we tried to treat the GNOME Shell extension as an extension
(sorry) of the main "securedrop/securedrop" component, taking advantage
of Babel's mapping feature to parse the ".js.in" file as JavaScript.

Here we harmonize the two approaches.  "translate-desktop
--extract-update" is now a two-step process, first via Babel over the
".js.in" JavaScript file, then as usual via xgettext over the ".j2.in"
desktop templates.  (This is logically reversed, but Babel appears to
have no equivalent of xgettext's appending "--join-existing" mode.)
"translate-desktop --compile" similarly does two passes with msgfmt,
first to create the standard gettext directory layout and then to update
the desktop templates.

NB. We also add "msgmerge --no-fuzzy-matching" after #6772, which
required rebasing from "develop".
cfm added a commit that referenced this pull request May 31, 2023
…NOME Shell extension

In the original (since lost) 1cfd35b, we tried to treat the GNOME Shell
extension as a separate "securedrop/extension" Weblate component with
its own "translate-extension" command, replicating both
"--extract-update" and "--compile" modes.

In f3d3f04, we tried to treat the GNOME Shell extension as an extension
(sorry) of the main "securedrop/securedrop" component, taking advantage
of Babel's mapping feature to parse the ".js.in" file as JavaScript.

Here we harmonize the two approaches.  "translate-desktop
--extract-update" is now a two-step process, first via Babel over the
".js.in" JavaScript file, then as usual via xgettext over the ".j2.in"
desktop templates.  (This is logically reversed, but Babel appears to
have no equivalent of xgettext's appending "--join-existing" mode.)
"translate-desktop --compile" similarly does two passes with msgfmt,
first to create the standard gettext directory layout and then to update
the desktop templates.

NB. We also add "msgmerge --no-fuzzy-matching" after #6772, which
required rebasing from "develop".
@cfm cfm mentioned this pull request May 31, 2023
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Anything related to translation or internationalization of SecureDrop
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reconsider gettext's fuzzy matching
2 participants