Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 3 days ago
JSON representation

Allows loading translation files from a custom GlotPress site running Traduttore

Awesome Lists containing this project

README

        

# Traduttore Registry

![PHPUnit](https://github.com/wearerequired/traduttore-registry/workflows/PHPUnit/badge.svg)
![Lint](https://github.com/wearerequired/traduttore-registry/workflows/Lint/badge.svg)
[![codecov](https://codecov.io/gh/wearerequired/traduttore-registry/branch/master/graph/badge.svg)](https://codecov.io/gh/wearerequired/traduttore-registry)
[![Latest Stable Version](https://poser.pugx.org/wearerequired/traduttore-registry/v/stable)](https://packagist.org/packages/wearerequired/traduttore-registry)
[![Latest Unstable Version](https://poser.pugx.org/wearerequired/traduttore-registry/v/unstable)](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/'
);
```


[![a required open source product - let's get in touch](https://media.required.com/images/open-source-banner.png)](https://required.com/en/lets-get-in-touch/)