wearerequired / traduttore-registry
Allows loading translation files from a custom GlotPress site running Traduttore
Installs: 56 322
Dependents: 7
Suggesters: 1
Security: 0
Stars: 13
Watchers: 2
Forks: 2
Open Issues: 6
Requires
- php: >=7.1
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^0.7.0
- phpunit/phpunit: ^7.5.13
- wearerequired/coding-standards: ^1.0
This package is auto-updated.
Last update: 2024-12-06 07:24:10 UTC
README
Allows loading translation files from a custom GlotPress site running Traduttore.
Installation
If you're using Composer to manage dependencies, you can use the following command to add the plugin to your site:
composer require wearerequired/traduttore-registry
After that, you can use \Required\Traduttore_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
: the URL to the Traduttore project translation API.
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:
\Required\Traduttore_Registry\add_project( 'plugin', 'example-plugin', 'https://translate.example.com/api/translations/acme/acme-plugin/' ); \Required\Traduttore_Registry\add_project( 'theme', 'example-theme', 'https://translate.example.com/api/translations/acme/acme-theme/' );