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

Localize plugin and prepare for French translation #33

Closed
7 tasks done
SteelWagstaff opened this issue Feb 12, 2024 · 9 comments
Closed
7 tasks done

Localize plugin and prepare for French translation #33

SteelWagstaff opened this issue Feb 12, 2024 · 9 comments
Assignees

Comments

@SteelWagstaff
Copy link
Member

SteelWagstaff commented Feb 12, 2024

This plugin should be made ready for internationalization and localization, using our standard approach for open source plugins (i.e. Transifex automation).

DoD:

  • Produce a .pot file for this repo
  • Register the plugin in Transifex and make available for translation
  • Ensure that automation works to push .pot changes
  • Confirm that this plugin and its strings are available for translation in Transifex
  • Ensure that automation works to pull .po updates into this project when translations reach the desired threshhold
  • Ensure that .mo files are generated when translations are updated
  • Confirm that French translations made in Transifex can be pulled into the project and successfully displayed in the user interface
@SteelWagstaff SteelWagstaff changed the title Localize plugin and produce French translation for all strings Localize plugin and prepare for French translation Feb 14, 2024
@SteelWagstaff SteelWagstaff self-assigned this Feb 19, 2024
@SteelWagstaff
Copy link
Member Author

SteelWagstaff commented Feb 19, 2024

I created a new file-based project in Transifex called Pressbooks Shared Network and assigned it to the Pressbooks team.

I also configured this plugin to be synced automatically with GitHub using these instructions: https://help.transifex.com/en/articles/6265125-github-installation-and-configuration

In order for the translations to be synced correctly, I had to create a valid transifex configuration .yaml file. See https://github.com/pressbooks/pressbooks-multi-institution/blob/dev/.tx/transifex.yaml.

I also configured Transifex to push content back to the repo whenever a language reached the 100% translation threshhold, via a PR with a specific chore(i10n): title
Screenshot from 2024-02-19 15-15-38
Screenshot from 2024-02-19 15-15-17

@SteelWagstaff
Copy link
Member Author

We could improve this by adding [ci skip] to the commit messages to avoid running our test suite and/or pushing translations directly to the project without a PR. We should also figure out a good way to generate and commit .mo files after .po files have been updated and before each release. These can be generated very simply with the WP CLI via this command: wp i18n make-mo languages

@richard015ar richard015ar assigned arzola and unassigned ho-man-chan Feb 20, 2024
@SteelWagstaff
Copy link
Member Author

Plugin text domain is now being loaded correctly. Only remaining task is to figure out how to generate and add .mo files every time .po files are updated are in the project.

@SteelWagstaff
Copy link
Member Author

@arzola I created this action: https://github.com/pressbooks/pressbooks-multi-institution/blob/dev/.github/workflows/update-mo.yml

It works, though I'm open to suggestions & improvements.

@SteelWagstaff SteelWagstaff removed their assignment Feb 23, 2024
@SteelWagstaff
Copy link
Member Author

We created a centralized action pressbooks/reusable-workflows#7 for use by any plugin which needs .mo files to be generated. Pressbooks multi institution is now set up to use this action: #62

@SteelWagstaff
Copy link
Member Author

To test this, we should generate new translation strings in Transifex. This should trigger an automatic PR in Pressbooks updating the .po files, which ought to automatically trigger the build and commit .mo file action.

@SteelWagstaff SteelWagstaff self-assigned this Feb 28, 2024
@SteelWagstaff
Copy link
Member Author

SteelWagstaff commented Feb 29, 2024

Tested, works as expected with some modifications. We can now use the reusable workflow in all relevant repos. See https://github.com/pressbooks/private/issues/1340

@SteelWagstaff
Copy link
Member Author

Here's documentation for our team about how localization/translation works with Transifex: https://docs.google.com/document/d/1jsSkagdnO1TqaeGSztmxFqN1d6o-vIfgeZ7j7bSEo0Y/edit

Here's an old guide I wrote for translation contributors: https://docs.google.com/document/d/1jsSkagdnO1TqaeGSztmxFqN1d6o-vIfgeZ7j7bSEo0Y/edit

Here's a short video showing how a user can sign up for a Transifex account and begin contributing translations to a project: https://us02web.zoom.us/rec/share/g7_cAaiAMMvOFs0pZlX_x7-okI0sSfs9b6-ClgQTiW78TQTquANB_lumdH9_3FxS.2C3FHnAnDwAWwmIX
Passcode: ^8tWT38C

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

No branches or pull requests

3 participants