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

Use moz.l10n for serialization #3587

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

eemeli
Copy link
Member

@eemeli eemeli commented Feb 28, 2025

For context see #3538

Filing initially as a draft; will update once mozilla/moz-l10n#58 is merged and a new moz.l10n release is available.

This PR replaces the file serialisers with their moz.l10n equivalents. Serialization is now done by first parsing the corresponding source file, and then modifying it according to the state of the database. This means that any comments in target files are lost, including obsolete messages in gettext files. The oddities required by our various file formats are encapsulated within set_translations() in pontoon.sync.core.translations_to_repo.

Dropping all serialization concerns from pontoon.sync.formats allows for the remaining code to be significantly simplified, removing e.g. the need to parse the source file when parsing a target file. The ParsedResource class and its subclasses are dropped, and VCSTranslation is no longer subclassed for each format.

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.

1 participant