PHP code example of wavevision / namespace-translator

1. Go to this page and download the library: Download wavevision/namespace-translator 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/ */

    

wavevision / namespace-translator example snippets


 declare(strict_types=1); //file Translations/Cs.php

use Wavevision\NamespaceTranslator\Resources\Translation;
use Wavevision\NamespaceTranslator\Loaders\TranslationClass\Message;

class Cs implements Translation
{
    public const HELLO = 'hello';

    public const NAME = 'name';

    public static function define() : array
    {
        return [self::HELLO => Message::create('Hello %s', self::NAME)]; 
    }
}
bash
php {bin/console} namespace-translator:export
bash
php {bin/console} namespace-translator:import