2017 © Pedro Peláez
 

molajo-package language

Molajo Language Services for PHP Applications

image

molajo/language

Molajo Language Services for PHP Applications

  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

=======, (*1)

Language Package

Build Status, (*2)

Language Services supporting translations for the User Interface for PHP applications using Adapters for different implementation types., (*3)

How to specify Language

Language strings are loaded in startup for language determined in this order (and installed):, (*4)

  1. Injected value during class instantiation
  2. Session
  3. User Data
  4. Client Language
  5. Application Configuration
  6. Defaults to en-GB

Instantiation

To instantiate the Language Class:, (*5)

php $language = new Language($language);, (*6)

Once instantiated, all calls to the class can be made using the $language instance., (*7)

Language Properties

To retrieve the key value (ex. 'en-GB') for the language which is loaded: php $language->get('language');, (*8)

Retrieve Language Strings

To retrieve all language strings and translations for the loaded language: php $language->get('strings');, (*9)

Retrieve List of all installed Languages

To retrieve a list of all languages installed in this application: php $language->get('installed');, (*10)

Retrieve Language Attribute

To retrieve a registry attribute value (id, name, rtl, local, first_day) for the loaded language: php $language->get('name-of-attribute');, (*11)

Retrieve all Language Attributes

To retrieve all registry attribute values as an array for the loaded language:, (*12)

php $language->get('registry');, (*13)

Translate

To translate the string $xyz: php $language->translate($xyz);, (*14)

To retrieve a list of language strings and translations matching a wildcard value: php $language->translate($xyz, 1);, (*15)

Identify Untranslated Strings

To insert strings found in code but are not already in database:, (*16)

  • If an administrator is logged on, the primary language services automatically insert untranslated strings
  • To avoid doing so, override the LanguagePlugin and set insert_missing_strings to 0
  • For instances you define, set the insert_missing_strings, as needed.

To log strings found in code, but are not already in database:, (*17)

  • Set the Application configuration option profile_missing_strings to 1 and turn on profiling

Requirements and Compliance

  • PHP framework independent, no dependencies
  • Requires PHP 5.4, or above
  • Semantic Versioning
  • Compliant with:
  • [phpDocumentor2] (https://github.com/phpDocumentor/phpDocumentor2)
  • [phpUnit Testing] (https://github.com/sebastianbergmann/phpunit)
  • Author AmyStephen
  • [Travis Continuous Improvement] (https://travis-ci.org/profile/Molajo)
  • Listed on [Packagist] (http://packagist.org) and installed using [Composer] (http://getcomposer.org/)
  • Use github to submit pull requests and features
  • Licensed under the MIT License - see the LICENSE file for details

The Versions

31/08 2015

dev-master

9999999-dev http://github.com/Molajo/Language

Molajo Language Services for PHP Applications

  Sources   Download

MIT

The Requires

 

language commonapi molajo

07/04 2014

v0.4

0.4.0.0 http://github.com/Molajo/Language

Molajo Language Services for PHP Applications

  Sources   Download

MIT

The Requires

 

language commonapi molajo

01/02 2014

v0.3

0.3.0.0 http://github.com/Molajo/Language

Molajo Language Services for PHP Applications

  Sources   Download

MIT

The Requires

 

language commonapi molajo

03/01 2014

v0.2

0.2.0.0 http://github.com/Molajo/Language

Molajo Language Services for PHP Applications

  Sources   Download

MIT

The Requires

 

language commonapi molajo