PHP code example of ralfhortt / translator-service

1. Go to this page and download the library: Download ralfhortt/translator-service library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ralfhortt / translator-service example snippets



use RalfHortt\Plugin\PluginFactory;
use RalfHortt\TranslatorService\Translator;

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


use RalfHortt\TranslatorService\Translator;

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