Skip to content

The php-nano-translation class gives you the correct translation from the requested JSON file.

License

Notifications You must be signed in to change notification settings

azettl/php-nano-translation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-nano-translation - Translation Engine

Codacy Badge Codacy Badge

The php-nano-translation class gives you the correct translation from the requested JSON file.

Installation

composer require azettl/php-nano-translation

Usage

require __DIR__ . '/vendor/autoload.php';

$oTranslation = new com\azettl\nano\translation();
$oTranslation->setBasePath('vendor/azettl/php-nano-translation/tests/translations/');
$oTranslation->setFileNamePattern('test.%s.json');

echo $oTranslation->translate('MY_KEY_WITH_VARS', 'en', ['variable' => 'test']);

Translation Key Value: "My {variable} Value" Returns: "My test Value"

About

The php-nano-translation class gives you the correct translation from the requested JSON file.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages