2017 © Pedro Peláez
 

library i18n

I18n module for zend framework 3

image

vim/i18n

I18n module for zend framework 3

  • Friday, January 19, 2018
  • by vanvas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

i18n

Module for Zend Framework 3., (*1)

Installation

Installation of this module uses composer. For composer documentation, please refer to getcomposer.org., (*2)

composer require vim/i18n

Register Vim\I18n in config/modules.config.php:, (*3)

<?php
return [
    'Vim\I18n',
];

Create cache directory:, (*4)

cd /path_to_your_project
mkdir ./data/cache

Register Entity:, (*5)

<?php
return [
    'doctrine' => [
        'driver' => [
            'application_annotation_driver' => [
                'paths' => [
                    './vendor/vim/i18n/src/Entity',
                ],
            ],
            'orm_default' => [
                'drivers' => [
                    'Vim\I18n\Entity' => 'application_annotation_driver',
                ],
            ],
        ]
    ],
];

CRUD Service

<?php
/** @var \Vim\I18n\Service\I18nService $i18nService */
$i18nService = $container->get(\Vim\I18n\Service\I18nService::class);

More information here: vim/crud, (*6)

Examples

<?php
 $this->translate('some_path');
 $this->translateByPlaceholder('some_path', ['some_placeholder' => 'value']);

or:, (*7)

<?php
/** @var \Zend\I18n\Translator\Translator $translator */
$translator = $container->get('Translator');
$translator->translate('some_path');

The Versions