ralfhortt/translator-service

A translator service for WordPress

1.0.2 2020-01-13 14:32 UTC

This package is auto-updated.

Last update: 2024-11-07 00:07:42 UTC


README

Installation

composer require ralfhortt/translator-service

Usage

Service loader

<?php
use RalfHortt\Plugin\PluginFactory;
use RalfHortt\TranslatorService\Translator;

PluginFactory::create()
    ->addService(Translator::class, 'my-textdomain', dirname(plugin_basename(__FILE__)).'/languages/')
    ->boot();

Standalone

<?php
use RalfHortt\TranslatorService\Translator;

(new Translator('wordpress-plugin-boilerplate', dirname(plugin_basename(__FILE__)).'/languages/'))->register();

Changelog

v1.0.2 - 2020-01-13

  • Bugfix: Wrong variable name

v1.0.1 - 2019-12-3

  • Cleanup

v1.0.0 - 2019-12-3

  • Initial release