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

Class: Translation2_Admin_Decorator_Autoadd

Source Location: /Translation2-2.0.0beta6/Admin/Decorator/Autoadd.php

Class Overview

Translation2_Decorator
   |
   --Translation2_Admin_Decorator
      |
      --Translation2_Admin_Decorator_Autoadd

Automatically add requested strings


Author(s):

Version:

  • @version@

Variables

Methods


Inherited Variables

Inherited Methods

Class: Translation2_Admin_Decorator

Translation2_Admin_Decorator::add()
Add a translation
Translation2_Admin_Decorator::addLang()
Create a new language
Translation2_Admin_Decorator::cleanCache()
Clean the cache
Translation2_Admin_Decorator::getPageNames()
Get a list of all the pageIDs in any table.
Translation2_Admin_Decorator::remove()
Remove a translation
Translation2_Admin_Decorator::removeLang()
Remove a language
Translation2_Admin_Decorator::update()
Update a translation
Translation2_Admin_Decorator::updateLang()
Update an existing language

Class: Translation2_Decorator

Translation2_Decorator::Translation2_Decorator()
Constructor
Translation2_Decorator::get()
Get translated string
Translation2_Decorator::getDecorator()
Return an instance of a decorator
Translation2_Decorator::getLang()
get lang info
Translation2_Decorator::getLangs()
get langs
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::setLang()
Set default lang
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::translate()
Get translated string
Translation2_Decorator::_replaceParams()
Replace parameters in strings

Class Details

[line 52]
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.

  • Author: Ian Eure <ieure>
  • Version: @version@
  • Since: 2.0.0beta3


[ Top ]


Class Variables

$autoaddlang =  ''

[line 59]

Language to add strings in

Type:   string


[ Top ]



Method Detail

get   [line 66]

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

Get a translated string

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

Parameters:

   $stringID   — 
   $pageID   — 
   $langID   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:22:28 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.