Initial commit.
This commit is contained in:
58
lib/php/monica/gettext.inc.php
Normal file
58
lib/php/monica/gettext.inc.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// File name: gettext.inc.php
|
||||
// Description: PHP subroutine to implement gettext functions
|
||||
// Date: 2002-04-11
|
||||
// Author: imacat <imacat@pristine.com.tw>
|
||||
// Copyright: Copyright (C) 2002-2007 Pristine Communications
|
||||
|
||||
// Referenced subroutines
|
||||
require_once "monica/requri.inc.php";
|
||||
|
||||
// Settings
|
||||
if (!defined("COMMONDOMAIN")) {
|
||||
define("COMMONDOMAIN", "monica");
|
||||
}
|
||||
if (!defined("COMMONLOCALEDIR")) {
|
||||
define("COMMONLOCALEDIR", dirname(dirname(dirname(dirname(__FILE__)))) . "/locale");
|
||||
}
|
||||
if (!defined("LOCALEDIR")) {
|
||||
define("LOCALEDIR", DOC_ROOT . "/admin/locale");
|
||||
}
|
||||
|
||||
// _: gettext implementation
|
||||
if (!function_exists("_")) {
|
||||
function _($a)
|
||||
{
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
// C_: shortcut to dgettext(COMMONDOMAIN, text)
|
||||
function C_($a)
|
||||
{
|
||||
return dgettext(COMMONDOMAIN, $a);
|
||||
}
|
||||
|
||||
// N_: null gettext implementation
|
||||
if (!function_exists("N_")) {
|
||||
function N_($a)
|
||||
{
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
// Nn_: null plural gettext implementation
|
||||
function Nn_($as, $ap, $n)
|
||||
{
|
||||
return array($as, $ap, $n);
|
||||
}
|
||||
// NC_: null gettext implementation of dgettext(COMMONDOMAIN, text)
|
||||
function NC_($a)
|
||||
{
|
||||
return array(COMMONDOMAIN, $a);
|
||||
}
|
||||
// NCn_: null plural gettext implementation of dngettext(COMMONDOMAIN, singular, plural, number)
|
||||
function NCn_($as, $ap, $n)
|
||||
{
|
||||
return array(COMMONDOMAIN, $as, $ap, $n);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user