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

Class: Translation2_Admin_Container_gettext

Source Location: /Translation2-2.0.4/Translation2/Admin/Container/gettext.php

Class Overview

Translation2_Container
   |
   --Translation2_Container_gettext
      |
      --Translation2_Admin_Container_gettext

Storage driver for storing/fetching data to/from a gettext file


Author(s):

Version:

  • CVS: $Id: gettext.php 305985 2010-12-05 22:55:33Z clockwerx $

Copyright:

  • 2004-2007 Lorenzo Alberton, Michael Wallner

Methods


Inherited Variables

Inherited Methods

Class: Translation2_Container_gettext

Translation2_Container_gettext::fetchLangs()
Fetch the available langs if they're not cached yet.
Translation2_Container_gettext::getOne()
Get a single item from the container, without caching the whole page
Translation2_Container_gettext::getPage()
Get all the strings from a domain (parsing the .mo file)
Translation2_Container_gettext::getStringID()
Get the stringID for the given string
Translation2_Container_gettext::init()
Initialize the container
Translation2_Container_gettext::setLang()
Sets the current lang

Class: Translation2_Container

Translation2_Container::Translation2_Container()
Constructor Has to be overwritten by each storage class
Translation2_Container::fetchLangs()
Fetch the available langs if they're not cached yet.
Translation2_Container::getLang()
Gets the current lang
Translation2_Container::getLangData()
Gets the array data for the lang
Translation2_Container::getLangs()
Gets the available languages
Translation2_Container::getOne()
Get a single item from the container, without caching the whole page Containers should implement this method.
Translation2_Container::getPage()
Returns an array of the strings in the selected page Containers should implement this method.
Translation2_Container::getStringID()
Get the stringID for the given string
Translation2_Container::raiseError()
Trigger a PEAR error
Translation2_Container::setCharset()
Set charset used to read/store the translations
Translation2_Container::setLang()
Sets the current language
Translation2_Container::_parseOptions()
Parse options passed to the container class

Class Details

[line 59]
Storage driver for storing/fetching data to/from a gettext file

This storage driver requires the gettext extension



[ Top ]


Method Detail

add   [line 137]

true|PEAR_Error add( string $stringID, string $pageID, array $strings)

Add a new entry in the strings domain.
  • Return: on failure

Parameters:

string   $stringID     string ID
string   $pageID     page/group ID
array   $strings     Associative array with string translations. Sample format: array('en' => 'sample', 'it' => 'esempio')

[ Top ]

addLang   [line 78]

mixed addLang( array $langData, [string $path = null])

Creates a new entry in the langs_avail .ini file.
  • Return: Returns true on success or PEAR_Error on failure.

Parameters:

array   $langData     language data
string   $path     path to gettext data dir

[ Top ]

addLangToList   [line 116]

true|PEAR_Error addLangToList( array $langData)

Creates a new entry in the langsAvail .ini file.

If the file doesn't exist yet, it is created.

  • Return: on failure

Parameters:

array   $langData     array('lang_id' => 'en', 'name' => 'english', 'meta' => 'some meta info', 'error_text' => 'not available' 'encoding' => 'iso-8859-1', );

[ Top ]

begin   [line 330]

void begin( )

Begin
  • Access: public

[ Top ]

commit   [line 344]

true|PEAR_Error commit( )

Commit
  • Return: on failure.
  • Access: public

[ Top ]

getPageNames   [line 316]

array getPageNames( )

Get a list of all the domains
  • Access: public

[ Top ]

remove   [line 178]

true|PEAR_Error remove( string $stringID, string $pageID)

Remove an entry from the domain.
  • Return: on failure

Parameters:

string   $stringID     string ID
string   $pageID     page/group ID

[ Top ]

removeLang   [line 269]

true|PEAR_Error removeLang( string $langID, [bool $force = false])

Remove Language
  • Access: public

Parameters:

string   $langID     language ID
bool   $force     (unused)

[ Top ]

removePage   [line 205]

mixed removePage( [string $pageID = null], [string $path = null])

Remove all the strings in the given page/group (domain)
  • Return: true on success, PEAR_Error on failure

Parameters:

string   $pageID     page/group ID
string   $path     path to gettext data dir

[ Top ]

update   [line 252]

mixed update( string $stringID, string $pageID, array $strings)

Update

Alias for Translation2_Admin_Container_gettext::add()


Parameters:

string   $stringID     string ID
string   $pageID     page/group ID
array   $strings     strings

[ Top ]

updateLang   [line 299]

mixed updateLang( array $langData)

Update the lang info in the langs_avail file
  • Return: Returns true on success or PEAR_Error on failure.
  • Access: public

Parameters:

array   $langData     language data

[ Top ]


Documentation generated on Mon, 06 Dec 2010 00:00:25 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.