default
[ class tree: default ] [ index: default ] [ all elements ]

Class: gettext_reader

Source Location: /pem-includes/class-gettext.php

Class Overview


Provides a simple gettext replacement that works independently from the system's gettext abilities.


Variables

Methods



Class Details

[line 36]
Provides a simple gettext replacement that works independently from the system's gettext abilities.

It can read MO files and use them for translating strings. The files are passed to gettext_reader as a Stream (see streams.php)

This version has the ability to cache all strings and translations to speed up the string lookup. While the cache is enabled by default, it can be switched off with the second parameter in the constructor (e.g. whenusing very large MO files that you don't want to keep in memory)




[ Top ]


Class Variables

$BYTEORDER =  0

[line 41]


Type:   mixed


[ Top ]

$cache_translations =  NULL

[line 51]


Type:   mixed


[ Top ]

$enable_cache =  false

[line 44]


Type:   mixed


[ Top ]

$error =  0

[line 38]


Type:   mixed


[ Top ]

$originals =  NULL

[line 45]


Type:   mixed


[ Top ]

$pluralheader =  NULL

[line 47]


Type:   mixed


[ Top ]

$short_circuit =  false

[line 43]


Type:   mixed


[ Top ]

$STREAM =  NULL

[line 42]


Type:   mixed


[ Top ]

$table_originals =  NULL

[line 49]


Type:   mixed


[ Top ]

$table_translations =  NULL

[line 50]


Type:   mixed


[ Top ]

$total =  0

[line 48]


Type:   mixed


[ Top ]

$translations =  NULL

[line 46]


Type:   mixed


[ Top ]



Class Methods


constructor gettext_reader [line 95]

gettext_reader gettext_reader( object Reader $Reader, [boolean $enable_cache = true])

Constructor



Parameters:

object Reader   $Reader   the StreamReader object
boolean   $enable_cache   enable_cache Enable or disable caching of strings (default on)

[ Top ]

method ngettext [line 321]

translated ngettext( string $single, string $plural, string $number)

Plural version of gettext



Tags:

return:  plural form
access:  public


Parameters:

string   $single   single
string   $plural   plural
string   $number   number

[ Top ]

method readintarray [line 79]

Array readintarray( int $count)

Reads an array of Integers from the Stream



Tags:

return:  of Integers


Parameters:

int   $count   count How many elements should be read

[ Top ]

method translate [line 243]

string translate( string $string)

Translates a string



Tags:

return:  translated string (or original, if not found)
access:  public


Parameters:

string   $string   string to be translated

[ Top ]


Documentation generated on Tue, 21 Aug 2007 14:49:24 -0500 by phpDocumentor 1.4.0a2