2017 © Pedro PelĂĄez
 

library simple-translator

Very simple translator for static php web page

image

ajda2/simple-translator

Very simple translator for static php web page

  • Thursday, January 26, 2017
  • by ajda2
  • Repository
  • 1 Watchers
  • 0 Stars
  • 109 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

simpleTranslator

Very simple static Translator for PHP, (*1)

Example of usage

use ajda2\Localization\ArrayTranslator;

require_once __DIR__ . '/../src/ITranslator.php';
require_once __DIR__ . '/../src/ArrayTranslator.php';

$strictMode = FALSE;
$enTable = require_once './translations/en.php'; // Get EN translations
$csTable = require_once './translations/cs.php'; // Get fallback for translations, not required

$translator = new ArrayTranslator($enTable, $csTable, $strictMode);

echo $translator->translate('form.validate.invalid_email') . PHP_EOL; // valid translation
echo $translator->translate('czech_only'); // return 'czech_only' because strictMode is disabled

$translator->setStrictMode(TRUE);

echo $translator->translate('czech_only'); // throw MissingTranslationException because of strict mode

The Versions

26/01 2017

dev-master

9999999-dev https://github.com/ajda2/simpleTranslator

Very simple translator for static php web page

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

  • php >=5.6.0

 

26/01 2017

v0.0.1

0.0.1.0 https://github.com/ajda2/simpleTranslator

Very simple translator for static php web page

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

  • php >=5.6.0