Skip to content
Allows loading translation files from a custom GlotPress site running Traduttore
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
inc
tests/phpunit
.editorconfig
.gitattributes
.gitignore
.travis.yml
CHANGELOG.md
LICENSE.txt
README.md
composer.json
phpcs.xml.dist
phpunit.xml.dist

README.md

Traduttore Registry

Build Status codecov Latest Stable Version Latest Unstable Version

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: either plugin or theme.
  • $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/'
);
You can’t perform that action at this time.