2017 © Pedro Peláez
 

library l10n

The Panda Localization Package.

image

panda/l10n

The Panda Localization Package.

  • Sunday, January 14, 2018
  • by ioannis-papikas
  • Repository
  • 1 Watchers
  • 1 Stars
  • 68 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Panda Localization Package

This is the localization package of the Panda Platform. It provides a simple translation structure and process for your code., (*1)

StyleCI, (*2)

Installation

This package is part of the Panda Framework but it's also available as a single package., (*3)

Through the composer

Add the following line to your composer.json file:, (*4)

"panda/l10n": "^2.0"

Usage

The Translation class works using a given FileProcessor for the translation files. It uses the FileProcessor as a getter to get translations., (*5)

Each Processor can have its own implementation of handling files based on locale and packages., (*6)

Translator

The Translator interface can be used across the entire application. You have to define the application's FileProcessor first and then you can load your translations freely., (*7)

Example:, (*8)


use Panda\Localization\Translation\JsonProcessor; use Panda\Localization\Translator; // Initialize the desired processor $processor = new JsonProcessor('your_base_directory_for_translations'); // Initialize the Translator $translator = new Translator($processor); // Get a desired translation $translation = $translator->translate('translation-key', 'package-name', 'en_US', 'default-translation-value-if-empty');

JsonProcessor

When using the JsonProcessor, the translation files should be in the given structure:, (*9)

BASE_DIRECTORY/{locale}/{package}.json

If no package name is given (or an empty package name), the 'default' package will be used (default.json)., (*10)

The Versions

14/01 2018

2.1.x-dev

2.1.9999999.9999999-dev http://pandaphp.org

The Panda Localization Package.

  Sources   Download

MIT

The Requires

 

The Development Requires

03/10 2017

2.0.x-dev

2.0.9999999.9999999-dev http://pandaphp.org

The Panda Localization Package.

  Sources   Download

MIT

The Requires

 

The Development Requires

23/08 2017

dev-master

9999999-dev http://pandaphp.org

The Panda Localization Package.

  Sources   Download

MIT

The Requires

 

The Development Requires

26/06 2017

v2.0.0

2.0.0.0 http://pandaphp.org

The Panda Localization Package.

  Sources   Download

MIT

The Requires

 

The Development Requires

19/02 2017

v1.0.2

1.0.2.0 http://pandaphp.org

The Panda PHP Framework Localization component.

  Sources   Download

MIT

The Requires

 

The Development Requires

02/10 2016

v1.0.1

1.0.1.0 http://pandaphp.org

The Panda PHP Framework Localization component.

  Sources   Download

MIT

The Requires

 

The Development Requires

02/10 2016

v1.0

1.0.0.0 http://pandaphp.org

The Panda PHP Framework Localization component.

  Sources   Download

MIT

The Requires

 

The Development Requires