Project Integrations
Using our little helper library called T15S Registry, you can then tell WordPress that translations for your project should be loaded from TranslationsPress.
Note: T15S Registry requires PHP 7.1 or higher.
T15S Registry
Copy the library’s code to your project. Also, on a multisite install it’s recommended to use it in a must-use plugin.
Recommanded
As more and more plugin developers use T15S library to deliver translations updates to their products, there is a conflict risk with another plugin/theme including a different version of the library class than you are packaging with your plugin/theme.
You should rename this class and init function name and parameters to something unique to your plugin/theme, so that it avoids conflicts.
YOUR_AWESOME_PROJECT_SLUG_Language_PacksYOUR_AWESOME_PROJECT_SLUG_init_t15syour-plugin-slugyour-theme-slugyour-team-slug
Change any references of:
Parameters
$type: either plugin or theme.$slug: must match the theme/plugin directory slug.$api_url: the URL to the TranslationsPress project translation API.
Note: It’s important that the slug matches the folder name of the plugin or theme.
Examples
Ideally you call add_project() in a function hooked to init, e.g. like this: