Skip to content

Conversation

@kraftbj
Copy link
Contributor

@kraftbj kraftbj commented Apr 14, 2025

Fixes #105

When preparing for a new release via composer prepare-release or a new composer update-translations, check for language packs on WordPress.org and remove any that are at 90%.

Future work would be to see if we can programmatically export the current translate.wordpress.org files for languages so any improvements made by volunteers make it to site owners.

@kraftbj
Copy link
Contributor Author

kraftbj commented Apr 14, 2025

This can be tested by running the command and seeing es_EC removed until #109 is merged.

@pkevan
Copy link
Contributor

pkevan commented Apr 15, 2025

I wonder if we want to have a set baseline of translated languages? i.e. what happens when a language doesn't hit the 90% threshold after a major update and there is no longer a pack?

@kraftbj
Copy link
Contributor Author

kraftbj commented Apr 15, 2025

Once there is a language pack, it'll continue to get generated, even if the translation percentage drops below the threshold ( https://github.com/WordPress/wordpress.org/blob/7bcd368b66c9e098bce1314a9f4af61d7ac067a1/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-language-pack.php#L649 ).

Once a language meets the threshold, we don't need to worry about it from the code/repo POV. On the polyglot side, we can aim to have PTE (project translation editors), which are folks who can approve a plugin's strings, so we can better ensure new and updated strings are translated.

There were some conversations/proposals about not serving a pack if the percentage dropped below a number, but those weren't accepted. (e.g. https://make.wordpress.org/polyglots/2020/03/10/delete-projects-language-pack-when-below-specific-percentage/ )

It would make sense to me to try to target the languages we can with more than 1% of WordPress installs (looking at https://wordpress.org/stats/ but open to other ways to determine higher-impact languages) which current lists:

Those we lack packs for:
Japanese | 5.83%
German | 5.49%
French (France) | 4.63%
Portuguese (Brazil) | 3.87%
English (UK) | 3.31% -- arguably less critical
Italian | 3.18%
Polish | 2.06%
Turkish | 1.08%
Persian | 1.07%
Others | 3.25%

Those we do:
Spanish (Spain) | 5.81% -- plus a couple of variants
Dutch | 2.37% -- both Dutch and Dutch Belgium
Russian | 2.32%
Vietnamese | 1.07%

Something I'd like to do in a follow-up is see if we can programmatically pull down the translations from translate.wordpress.org for those not at the threshold yet so those that we do have in the repo are up to date. Right now, the files we serve have already been uploaded to translate.wordpress.org and, in theory, added/improved, but users aren't seeing those improved translations until we export them back into the repo (which I haven't done thus far)

Copy link
Contributor

@pkevan pkevan left a comment

Choose a reason for hiding this comment

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

Tested with composer update-translations which works as expected.

Hitting some issues with composer prepare-release - will followup separately.

When running `update_translations` we end up in a different directory (https://github.com/WordPress/secure-custom-fields/blob/c037ce16b9a110115af2289053d87430d78eec97/bin/update-translations.php#L16), this resets that to where it is expected.
@pkevan
Copy link
Contributor

pkevan commented Apr 17, 2025

Hitting some issues with composer prepare-release - will followup separately.

Added a commit to resolve one of the issues, needs testing.

@kraftbj
Copy link
Contributor Author

kraftbj commented Apr 17, 2025

@pkevan Thanks for catching that. In my iterations on the script, I ended up not needing the chdir that was throwing things off. Can you give this a gander to confirm it works without needing the special chdir within the chain of commands?

@pkevan
Copy link
Contributor

pkevan commented Apr 22, 2025

@pkevan Thanks for catching that. In my iterations on the script, I ended up not needing the chdir that was throwing things off. Can you give this a gander to confirm it works without needing the special chdir within the chain of commands?

Yes, will do and report back.

@pkevan
Copy link
Contributor

pkevan commented Apr 22, 2025

Looks good now @kraftbj 👍

@kraftbj kraftbj merged commit 10d896b into trunk Apr 22, 2025
5 checks passed
@kraftbj kraftbj deleted the update/languages branch April 22, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language pack removal

3 participants