Allows loading translation files from TranslationsPress.
If you're using Composer to manage dependencies, you can use the following command to add the plugin to your site:
composer require wp-transaltions/t15s-registry
After that, you can use \WP_Translations\T15S_Registry\add_project( $type, $slug, $api_url )
in your theme or plugin.
Parameters:
$type
: eitherplugin
ortheme
.$slug
: must match the theme/plugin directory slug.$api_url
: TanslationsPress translation API URL.
Note: On a multisite install it's recommended to use it in a must-use plugin.
Here's an example of how you can use that function:
\WP_Translations\T15S_Registry\add_project(
'plugin',
'example-plugin',
'https://translationspress.com/translate/api/translations/acme/acme-plugin/'
);
\WP_Translations\T15S_Registry\add_project(
'theme',
'example-theme',
'https://translationspress.com/translate/api/translations/acme/acme-theme/'
);