Search by

boctulus / simplerest-i18n

boctulus

Gettext-style translation catalogs and language detection for SimpleRest

Package info

github.com/boctulus/simplerest-i18n

pkg:composer/boctulus/simplerest-i18n

Statistics

Installs: 2

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-10-23 13:40 UTC

This package is auto-updated.

Last update: 2026-11-22 15:07:06 UTC


README

boctulus/simplerest-i18n contains the gettext-style translation support used by SimpleRest applications: .po parsing, translation-domain handling, and language detection. Locale catalogs remain application data under the host application's app/Locale/ directory.

The package keeps the existing class names:

  • Boctulus\Simplerest\Core\Libs\i18n\Translate
  • Boctulus\Simplerest\Core\Libs\i18n\POParser
  • Boctulus\Simplerest\Core\Libs\LangDetector

It also autoloads the existing global setLang() and trans() helpers.

use Boctulus\Simplerest\Core\Libs\i18n\Translate;

Translate::bind('messages');
echo trans('Welcome');

Translate uses SimpleRest core services for filesystem access, logging, and application configuration. AlternativeGetTextTranslator also requires the host application to provide the PHPTAL_TranslationService interface before that class is loaded.