Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.02 KB

README.md

File metadata and controls

39 lines (27 loc) · 1.02 KB

T15S Registry

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: either plugin or theme.
  • $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/'
);