Class Index

_404

Acl

AppController

AppModel

Cache

Configure

Controller

Date

Dispatcher

Form

Html

Input

Javascript

Language

Loader

Model

Pagination

Record

Router

Session

UnknownException

View

Xml

Language Class

Declaration

class Language

File name

lib/language.php

Description

Provides a set of static methods to aid in the use of multi-language support.
Supports the use of both a primary language and a default (fallback)
language. When the definition can not be found in the set of primary keys,
the default is used instead.

Properties

static array default_text = null

The default text for the default language if used

static array lang_files = null

An associative array containing name of all of the language files loaded and the language they pertain to

static array lang_text = null

The text for the given language

Methods

_( string $lang_key, boolean $return = false, mixed $... )

getText( string $lang_key, boolean $return = false, mixed $... )

loadLang( mixed $lang_file, string $language = null, string $lang_dir = "/home/repo/minphp/language/" )

_

Alias of Language::getText()

Parameters:

string $lang_key required

The language key identifier for this requested text

boolean $return = false

Whether to return the text or output it

mixed $...

Values to substitute in the language result. Uses sprintf(). If parameter is an array, only that value is passed to sprintf().

Access:

public static final

Returns:

void

See also:

Language::getText()

getText

Fetches text from the loaded language file. Will search the preferred language file first, if not found in there, then will search the default language file for the $lang_key text.

Parameters:

string $lang_key required

The language key identifier for this requested text

boolean $return = false

Whether to return the text or output it

mixed $...

Values to substitute in the language result. Uses sprintf(). If parameter is an array, only that value is passed to sprintf().

Access:

public static final

Returns:

void

loadLang

Loads a language file whose properties may then be invoked.

Parameters:

mixed $lang_file required

A string as a single language file or array containing a list of language files to load

string $language = null

The language to load the $lang_file for (e.g. en-us), default is "Language.default" config value

string $lang_dir = "/home/repo/minphp/language/"

The directory from which to load the given language file(s), defaults to LANGDIR

Access:

public static final

Returns:

void