-
Notifications
You must be signed in to change notification settings - Fork 1
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
Comments
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 |
We could improve this by adding |
We also need to correctly load this plugin's text domain: https://developer.wordpress.org/reference/functions/load_plugin_textdomain/#div-comment-1568. In other plugins this is done in a hooks function in the main admin class: https://github.com/pressbooks/pressbooks-saml-sso/blob/78742aceeefd2d2d672e0c326dc92ee3d2fdcc6b/inc/class-admin.php#L32 or https://github.com/pressbooks/pressbooks-network-catalog/blob/e8ee46c68eb0b2c33a3568292787d0cf62ac2b80/src/PressbooksNetworkCatalog.php#L101-L102 |
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. |
@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. |
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 |
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. |
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 |
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 |
This plugin should be made ready for internationalization and localization, using our standard approach for open source plugins (i.e. Transifex automation).
DoD:
The text was updated successfully, but these errors were encountered: