https://github.com/wearerequired/traduttore-registry
Allows loading translation files from a custom GlotPress site running Traduttore
https://github.com/wearerequired/traduttore-registry
glotpress package wordpress
Last synced: 2 months ago
JSON representation
Allows loading translation files from a custom GlotPress site running Traduttore
- Host: GitHub
- URL: https://github.com/wearerequired/traduttore-registry
- Owner: wearerequired
- License: gpl-2.0
- Created: 2018-02-06T22:01:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T03:00:57.000Z (over 2 years ago)
- Last Synced: 2025-04-09T17:15:31.125Z (2 months ago)
- Topics: glotpress, package, wordpress
- Language: PHP
- Homepage:
- Size: 91.8 KB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Traduttore Registry


[](https://codecov.io/gh/wearerequired/traduttore-registry)
[](https://packagist.org/packages/wearerequired/traduttore-registry)
[](https://packagist.org/packages/wearerequired/traduttore-registry)Allows loading translation files from a custom GlotPress site running [Traduttore](https://github.com/wearerequired/traduttore).
## Installation
If you're using [Composer](https://getcomposer.org/) to manage dependencies, you can use the following command to add the plugin to your site:
```bash
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:
```php
\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/'
);
```
[](https://required.com/en/lets-get-in-touch/)