tolgee / core
PHP integration for Tolgee localization framework
Fund package maintenance!
tolgee
Requires
- ext-intl: *
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-04-30 00:39:22 UTC
README
PHP integration library for Tolgee localization toolkit. For more information about Tolgee Toolkit, visit our documentation website toolkit.tolgee.io.
Installation
composer require tolgee
Usage
To use Tolgee with PHP, start with creating TolgeeConfig class instance and Tolgee class instance.
<?php
use Tolgee\Core\Enums\Modes;
use Tolgee\Core\Tolgee;
use Tolgee\Core\TolgeeConfig;
$config = new TolgeeConfig();
$config->apiKey = "your api key"
$config->apiUrl = "your api url"
$config->mode = Modes::DEVELOPMENT;
$tolgee = new Tolgee($config);
Then you can simply use Tolgee to translate strings:
$tolgee->translate("hello_world");
To learn more, check our docs.