Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

NovikovRoman/Trans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple translations

<?php
require_once __DIR__ . '/vendor/autoload.php'

$locale = 'ru';
// throw exceptions [optional] default: false
$strict = true;
$trans = new Trans([path-to-dir-dictionaries], $locale, $strict);

print_r($trans->get('Hello, World!'));

/**
 * Exception: not found dictionary
 * $trans->setLocale('de');
 * $trans->get('Hello, World!')
 */

// silent mode
$locale = 'de';
$trans = new Trans([path-to-dir-dictionaries], $locale);
// output: Hello, World!
print_r($trans->get('Hello, World!'));

About

Simple translations

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages