mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-27 18:10:42 +00:00
112 lines
4.3 KiB
PHP
112 lines
4.3 KiB
PHP
<?php
|
||
// MyDMS. Document Management System
|
||
// Copyright (C) 2002-2005 Markus Westphal
|
||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||
// Copyright (C) 2010-2013 Uwe Steinmann
|
||
//
|
||
// This program is free software; you can redistribute it and/or modify
|
||
// it under the terms of the GNU General Public License as published by
|
||
// the Free Software Foundation; either version 2 of the License, or
|
||
// (at your option) any later version.
|
||
//
|
||
// This program is distributed in the hope that it will be useful,
|
||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
// GNU General Public License for more details.
|
||
//
|
||
// You should have received a copy of the GNU General Public License
|
||
// along with this program; if not, write to the Free Software
|
||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||
|
||
use Seeddms\Seeddms\Translator;
|
||
|
||
$translator = new Translator($settings);
|
||
$translator->init();
|
||
|
||
function getAvailableLanguages() { /* {{{ */
|
||
trigger_error("getAvailableLanguages() is deprecated.", E_USER_DEPRECATED);
|
||
foreach(debug_backtrace() as $n) {
|
||
trigger_error($n['file'].": Line ".$n['line'], E_USER_DEPRECATED);
|
||
}
|
||
|
||
return $GLOBALS['settings']->getAvailableLanguages();
|
||
} /* }}} */
|
||
|
||
function getLanguages() { /* {{{ */
|
||
trigger_error("getLanguages() is deprecated.", E_USER_DEPRECATED);
|
||
foreach(debug_backtrace() as $n) {
|
||
trigger_error($n['file'].": Line ".$n['line'], E_USER_DEPRECATED);
|
||
}
|
||
|
||
return $GLOBALS['settings']->getLanguages();
|
||
} /* }}} */
|
||
|
||
/**
|
||
* Get translation
|
||
*
|
||
* Returns the translation for a given key. It will replace markers
|
||
* in the form [xxx] with those elements from the array $replace.
|
||
* A default text can be gіven for the case, that there is no translation
|
||
* available. The fourth parameter can override the currently set language
|
||
* in the session or the default language from the configuration.
|
||
*
|
||
* @param string $key key of translation text
|
||
* @param array $replace list of values that replace markers in the text
|
||
* @param string $defaulttext text used if no translation can be found
|
||
* @param string $lang use this language instead of the currently set lang
|
||
*/
|
||
function getMLText($key, $replace = array(), $defaulttext = null, $lang="") { /* {{{ */
|
||
// trigger_error("getMLText() is deprecated.", E_USER_DEPRECATED);
|
||
// foreach(debug_backtrace() as $n) {
|
||
// trigger_error($n['file'].": Line ".$n['line'], E_USER_DEPRECATED);
|
||
// }
|
||
|
||
return $GLOBALS['translator']->translate($key, $replace, $defaulttext, $lang);
|
||
} /* }}} */
|
||
|
||
function printMLText($key, $replace = array(), $defaulttext = null, $lang="") { /* {{{ */
|
||
$GLOBALS['translator']->print($key, $replace, $defaulttext, $lang);
|
||
}
|
||
/* }}} */
|
||
|
||
function printReviewStatusText($status, $date=0) { /* {{{ */
|
||
$GLOBALS['translator']->printReviewStatusText($status, $date);
|
||
} /* }}} */
|
||
|
||
function getReviewStatusText($status, $date=0) { /* {{{ */
|
||
return $GLOBALS['translator']->getReviewStatusText($status, $date);
|
||
} /* }}} */
|
||
|
||
function printApprovalStatusText($status, $date=0) { /* {{{ */
|
||
$GLOBALS['translator']->printApprovalStatusText($status, $date);
|
||
} /* }}} */
|
||
|
||
function getApprovalStatusText($status, $date=0) { /* {{{ */
|
||
return $GLOBALS['translator']->getApprovalStatusText($status, $date);
|
||
} /* }}} */
|
||
|
||
function printOverallStatusText($status) { /* {{{ */
|
||
$GLOBALS['translator']->printOverallStatusText($status);
|
||
} /* }}} */
|
||
|
||
function getOverallStatusText($status) { /* {{{ */
|
||
return $GLOBALS['translator']->getOverallStatusText($status);
|
||
} /* }}} */
|
||
|
||
function getAttributeTypeText($attrdef) { /* {{{ */
|
||
return $GLOBALS['translator']->getAttributeTypeText($attrdef);
|
||
} /* }}} */
|
||
|
||
function getAttributeObjectTypeText($attrdef) { /* {{{ */
|
||
return $GLOBALS['translator']->getAttributeObjectTypeText($attrdef);
|
||
} /* }}} */
|
||
|
||
function getAttributeValidationText($error, $attrname='', $attrvalue='', $regex='') { /* {{{ */
|
||
return $GLOBALS['translator']->getAttributeValidationText($error, $attrname, $attrvalue, $regex);
|
||
} /* }}} */
|
||
|
||
function getAttributeValidationError($error, $attrname='', $attrvalue='', $regex='') { /* {{{ */
|
||
return $GLOBALS['translator']->getAttributeValidationText($error, $attrname, $attrvalue, $regex);
|
||
} /* }}} */
|
||
|