wp-transaltions / t15s-registry
Allows loading translation files from T15S
dev-master / 2.0.x-dev
2020-05-28 20:48 UTC
Requires
- php: >=7.1
Requires (Dev)
This package is auto-updated.
Last update: 2025-03-29 00:57:50 UTC
README
Allows loading translation files from TranslationsPress.
Installation
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.
Usage
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/' );