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

Class: Translation2_Admin_Container_gettext

Source Location: /Translation2-2.0.0beta3/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:

  • $Revision: 1.16 $

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
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::setLang()
Sets the current lang

Class Details

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

This storage driver requires gettext extension

  • Version: $Revision: 1.16 $


[ Top ]


Method Detail

add   [line 146]

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

Add a new entry in the strings domain.
  • Return: true on success, PEAR_Error on failure

Parameters:

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

[ Top ]

addLangToAvailList   [line 92]

mixed addLangToAvailList( array $langData)

Creates a new entry in the langsAvail .ini file.

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

  • Return: true on success, PEAR_Error on failure

Parameters:

array   $langData   —  array('lang_id' => 'en', 'name' => 'english', 'meta' => 'some meta info', 'windows' => 'enu', 'error_text' => 'not available');

[ Top ]

begin   [line 261]

void begin( )

Begin
  • Access: public

[ Top ]

commit   [line 275]

true|PEAR_Error commit( )

Commit
  • Access: public

[ Top ]

createNewLang   [line 56]

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

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

Parameters:

array   $langData   — 
   $path   — 

[ Top ]

remove   [line 186]

mixed remove( string $stringID, string $pageID)

Remove an entry from the domain.
  • Return: true on success, PEAR_Error on failure

Parameters:

string   $stringID   — 
string   $pageID   — 

[ Top ]

removeLang   [line 233]

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

Remove Language
  • Access: public

Parameters:

string   $langID   — 
bool   $force   —  (unused)

[ Top ]

update   [line 217]

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

Update

Alias for Translation2_Admin_Container_gettext::add()


Parameters:

string   $stringID   — 
string   $pageID   — 
array   $strings   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:58:32 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.