WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
254 stars 204 forks source link

Add checks to prevent inaccuracies in POT files #454

Open dhruvkb opened 1 year ago

dhruvkb commented 1 year ago

Problem

Changes to the translation strings and the en.json5 to POT file pipeline can have drastic consequences but those PRs have no specific checks for this POT change associated with them. Once merged, they will irreversibly overwrite the POT file, leading to problems for translators.

Description

If a PR affects the POT file, the diff in the POT should be commented on the PR so that unforeseen negative consequences can be avoided. These checks are similar to the bundle size checks that are run on the frontend PR.

Alternatives

Alternatively, any PR that modifies the en.json5 to POT file pipeline should not be allowed to write to the translation branch but rather make a PR so that the POT changes can be analysed and merged only if correct.

Additional context

This issue came up in a comment https://github.com/WordPress/openverse-frontend/pull/2161#issuecomment-1424294874 on PR WordPress/openverse-frontend#2161 which fixes translation issue WordPress/openverse-frontend#2159 as a solution to @krysal's review comment https://github.com/WordPress/openverse-frontend/pull/2161#pullrequestreview-1291216375. Alternative approaches welcome.

krysal commented 1 year ago

I assume by "inaccuracies" here you mean more like big shift in the POT file, am I right?

Thank you for opening this issue. I think it deserves a higher priority than the lowest.

dhruvkb commented 12 months ago

@krysal haha yes, but by "inaccuracies" I meant we should also be able to catch even smaller shifts.