2017 © Pedro Peláez
 

library translator

Another library to achieve translation in your beautiful application!

image

mvaliolahi/translator

Another library to achieve translation in your beautiful application!

  • Tuesday, November 21, 2017
  • by mvaliolahi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Translator

Translate messages for any project., (*1)

Install

`composer require mvaliolahi/translator`
Usage

Make a directory as resources path, inside the ResourcePath directory make several directory for different languages., (*2)

example:
  1. Resources/lang/en .
  2. Inside en make a message.php file.
  3. The message.php is like below code:, (*3)

    <?php
    
    return [
        'test' => 'Test',
    ];
  4. Finally instantiate Validator like below:, (*4)

    $translator = new Translator([
        'locale' => en', 
        'resourcePath' => __DIR__ . '/../src/Resources/lang'
    ]);
  5. Use of method to find translation in specified language., (*5)

    $result = $translator->of('messages.test');
        Output: Test
    
    $result = $translator->of('test');
        Output: Test

    Tips: The messages.php is default translation file, you could define another files as you wish!, (*6)

The Versions

21/11 2017

dev-master

9999999-dev https://mvaliolahi.ir

Another library to achieve translation in your beautiful application!

  Sources   Download

The Development Requires

by Meysam Valiolahi
by Meysam Valiolahi

language translation translator multilanguage