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

Class: Translation2_Admin_Decorator

Source Location: /Translation2-2.0.4/Translation2/Admin/Decorator.php

Class Overview

Translation2
   |
   --Translation2_Decorator
      |
      --Translation2_Admin_Decorator

Decorates a Translation2_Admin class.


Author(s):

Copyright:

  • 2004-2007 Lorenzo Alberton

Methods


Child classes:

Translation2_Admin_Decorator_Autoadd
Automatically add requested strings

Inherited Variables

Inherited Methods

Class: Translation2_Decorator

Translation2_Decorator::Translation2_Decorator()
Constructor Constructs the Translation2_Decorator
Translation2_Decorator::get()
Get translated string
Translation2_Decorator::getDecorator()
Return an instance of a decorator
Translation2_Decorator::getLang()
Get language info
Translation2_Decorator::getLangs()
Get languages
Translation2_Decorator::getPage()
Same as getRawPage, but resort to fallback language and replace parameters when needed
Translation2_Decorator::getRaw()
Get translated string
Translation2_Decorator::getRawPage()
Get the array of strings in a page
Translation2_Decorator::getStringID()
Get the stringID for the given string. This method is the reverse of get().
Translation2_Decorator::replaceEmptyStringsWithKeys()
Replace empty strings with their stringID
Translation2_Decorator::setCharset()
Set charset used to read/store the translations
Translation2_Decorator::setContainerOptions()
Set some storage driver options
Translation2_Decorator::setLang()
Set default language
Translation2_Decorator::setOption()
set Decorator option
Translation2_Decorator::setOptions()
set Decorator options
Translation2_Decorator::setPageID()
Set default page
Translation2_Decorator::setParams()
Set parameters for next string
Translation2_Decorator::_replaceParams()
Replace parameters in strings
Translation2_Decorator::__clone()
Clone internal object references

Class: Translation2

Translation2::Translation2()
Constructor
Translation2::factory()
Return a Translation2 instance already initialized
Translation2::get()
Get translated string
Translation2::getDecorator()
Return an instance of a decorator
Translation2::getLang()
get lang info
Translation2::getLangs()
get langs
Translation2::getPage()
Get an entire group of strings
Translation2::getRaw()
Get translated string (as-is)
Translation2::getRawPage()
Get the array of strings in a page
Translation2::getStringID()
Get the stringID for the given string. This method is the reverse of get().
Translation2::replaceEmptyStringsWithKeys()
Replace empty strings with their stringID
Translation2::setCharset()
Set charset used to read/store the translations
Translation2::setContainerOptions()
Set some storage driver options
Translation2::setLang()
Set default lang
Translation2::setPageID()
Set default page
Translation2::setParams()
Set parameters for next string
Translation2::_replaceParams()
Replace parameters in strings
Translation2::__clone()
Clone internal object references

Class Details

[line 59]
Decorates a Translation2_Admin class.

Create a subclass of this class for your own "decoration".



[ Top ]


Method Detail

add   [line 133]

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

Add a new translation

Parameters:

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

[ Top ]

addLang   [line 78]

mixed addLang( array $langData, [array $options = array()])

Prepare the storage container for a new lang.

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


Parameters:

array   $langData   —  array('lang_id' => 'en', 'table_name' => 'i18n', 'name' => 'english', 'meta' => 'some meta info', 'error_text' => 'not available');
array   $options   —  array('charset' => 'utf8', 'collation' => 'utf8_general_ci');

[ Top ]

cleanCache   [line 214]

void cleanCache( )

If you use the CacheLiteFunction decorator, you may want to invalidate the cache after a change in the data base.

[ Top ]

getPageNames   [line 199]

array getPageNames( )

Get a list of all the pageIDs in any table.

[ Top ]

remove   [line 169]

mixed remove( string $stringID, [string $pageID = null])

Remove a translated string

Parameters:

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

[ Top ]

removeLang   [line 98]

mixed removeLang( [string $langID = null], [boolean $force = false])

Remove the lang from the langsAvail table and drop the strings table.

If the strings table holds other langs and $force==false, then only the lang column is dropped. If $force==true the whole table is dropped without any check


Parameters:

string   $langID   —  language ID
boolean   $force   —  remove the language info without further checks

[ Top ]

removePage   [line 185]

mixed removePage( [string $pageID = null])

Remove all the strings in the given page/group

Parameters:

string   $pageID   —  page/group ID

[ Top ]

update   [line 152]

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

Update an existing translation

Parameters:

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

[ Top ]

updateLang   [line 114]

mixed updateLang( array $langData)

Update the lang info in the langsAvail table

Parameters:

array   $langData   —  array containing language info

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:41:51 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.