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

Class: Translation2_Admin_Decorator_Autoadd

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

Class Overview

Translation2
   |
   --Translation2_Decorator
      |
      --Translation2_Admin_Decorator
         |
         --Translation2_Admin_Decorator_Autoadd

Automatically add requested strings


Author(s):

Copyright:

  • 2004-2007 Ian Eure

Variables

Methods


Inherited Variables

Inherited Methods

Class: Translation2_Admin_Decorator

Translation2_Admin_Decorator::add()
Add a new translation
Translation2_Admin_Decorator::addLang()
Prepare the storage container for a new lang.
Translation2_Admin_Decorator::cleanCache()
If you use the CacheLiteFunction decorator, you may want to invalidate the cache after a change in the data base.
Translation2_Admin_Decorator::getPageNames()
Get a list of all the pageIDs in any table.
Translation2_Admin_Decorator::remove()
Remove a translated string
Translation2_Admin_Decorator::removeLang()
Remove the lang from the langsAvail table and drop the strings table.
Translation2_Admin_Decorator::removePage()
Remove all the strings in the given page/group
Translation2_Admin_Decorator::update()
Update an existing translation
Translation2_Admin_Decorator::updateLang()
Update the lang info in the langsAvail table

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 72]
Automatically add requested strings

This Decorator will add strings to a language when a request for them to be translated happens. The 'autoaddlang' option must be set to the language the strings will be added as.

Example:

 $tr =& Translation2_Admin::factory(...);
 $tr->setLang('en');
 $tr =& $tr->getAdminDecorator('Autoadd');
 $tr->setOption('autoaddlang', 'en');
 ...
 $tr->get('Entirely new string', 'samplePage', 'de');

'Entirely new string' will be added to the English language table.



[ Top ]


Class Variables

$autoaddlang =  ''

[line 79]

Language to add strings in

Type:   string


[ Top ]



Method Detail

get   [line 91]

string get( string $stringID, [string $pageID = TRANSLATION2_DEFAULT_PAGEID], [string $langID = null])

Get a translated string

Overrides Translation2_Decorator::get() (Get translated string)

Parameters:

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

[ Top ]


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