Source for file Autoadd.php
Documentation is available at Autoadd.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
// $Id: Autoadd.php,v 1.2 2004/10/28 11:20:43 quipo Exp $
require_once 'Translation2/Admin/Decorator.php';
* 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.
* $tr =& Translation2_Admin::factory(...);
* $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>
* Language to add strings in
* Get a translated string
* @see Translation2::get()
function get($stringID, $pageID = TRANSLATION2_DEFAULT_PAGEID , $langID = null )
$string = $this->translation2->get ($stringID, $pageID, $langID);
if (PEAR ::isError ($string) || empty ($string) &&
Documentation generated on Mon, 11 Mar 2019 13:58:32 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|