Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/panlatent/translator

Poedit extractor for Craft CMS
https://github.com/panlatent/translator

craftcms gettext i18n poedit translation yii2

Last synced: about 1 month ago
JSON representation

Poedit extractor for Craft CMS

Awesome Lists containing this project

README

        

Translator
===========

Translator is command tools that can extract message strings from PHP source code and Twig templates.
It is designed to work with tools like Poedit and supports CraftCMS.

Requirements
------------
+ PHP 8.2 or later

Installation
------------

```bash
composer global require panlatent/translator:cli
```

Usages
------

Add custom extractor on Poedit.

```bash
./translator extract %F --output=%o
```

Add config to `config/app.php`:
```php
'components' => [
'i18n' => [
'translations' => [
'site' => [
'class' => GettextMessageSource::class,
'sourceLanguage' => 'en-US',
'basePath' => '@translations',
],
'*' => [
'class' => GettextMessageSource::class,
'sourceLanguage' => 'en-US',
'basePath' => '@translations',
],
]
],
],
```

License
-------
The Translator is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).