Documentation

SimpleTranslation
in package
Uses Log

Table of Contents

$name  : mixed
$parent  : mixed
__construct()  : mixed
Constructs a new Settings Object
__get()  : mixed
Not to be confused with the the {@see get()} method.
get()  : string
Returns the translation for $txt_id
load()  : bool
Loads a translation File with some logic
loadLangArray()  : mixed
loadText()  : mixed
loadTranslationFile()  : bool
Loads a translation File
out()  : mixed
Prints out the translation for $txt_id
printText()  : mixed

Properties

Methods

__construct()

Constructs a new Settings Object

public __construct([string $lng = null ][, string $name = null ][, string $parent = null ]) : mixed
Parameters
$lng : string = null

The language to translate to

$name : string = null

The name of the translation File (not the Filename!)

$parent : string = null

The parent SimpleTranslation Object

Return values
mixed

__get()

Not to be confused with the the {@see get()} method.

public __get(mixed $name) : mixed

This method is for namespacing and loading different translation files

Parameters
$name : mixed
Return values
mixed

get()

Returns the translation for $txt_id

public get(int $txt_id, mixed ...$params) : string
Parameters
$txt_id : int
$params : mixed

Passed on to printf for substitution

Return values
string

The translated text

load()

Loads a translation File with some logic

public load(string $name) : bool

Loads a file called $name_{$this->lng}.xml

Parameters
$name : string

The filename prefix

Tags
throws
ErrorException

if language is not set

Return values
bool

Returns true if the file was loaded, false otherwise

loadLangArray()

public loadLangArray(mixed $lng) : mixed
Parameters
$lng : mixed
Tags
deprecated
Return values
mixed

loadText()

public loadText(mixed $lng, mixed $txt_id) : mixed
Parameters
$lng : mixed
$txt_id : mixed
Tags
deprecated

Use get() instead

Return values
mixed

loadTranslationFile()

Loads a translation File

public loadTranslationFile(string $file) : bool
Parameters
$file : string

The fully quallified filename to load

Tags
deprecated

Use load() instead

Return values
bool

true on succsess dies if not :(

out()

Prints out the translation for $txt_id

public out(int $txt_id, mixed ...$params) : mixed
Parameters
$txt_id : int
$params : mixed

Passed on to printf for substitution

Return values
mixed

printText()

public printText(mixed $lng, mixed $txt_id) : mixed
Parameters
$lng : mixed
$txt_id : mixed
Tags
deprecated

Use out() instead

Return values
mixed

Search results