1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: /**
13: * Xoops locale
14: *
15: * @copyright XOOPS Project (http://xoops.org)
16: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
17: * @package kernel
18: * @since 2.3.0
19: * @author Taiwen Jiang <phppp@users.sourceforge.net>
20: * @version $Id$
21: * @todo To be handled by i18n/l10n
22: */
23:
24: setlocale(LC_ALL, 'en_US');
25:
26: // !!IMPORTANT!! insert '\' before any char among reserved chars: "a", "A", "B", "c", "d", "D", "F", "g", "G", "h", "H", "i", "I", "j", "l", "L", "m", "M", "n", "O", "r", "s", "S", "t", "T", "U", "w", "W", "Y", "y", "z", "Z"
27: // insert double '\' before 't', 'r', 'n'
28: define("_TODAY", "\T\o\d\a\y G:i");
29: define("_YESTERDAY", "\Y\e\s\\t\e\\r\d\a\y G:i");
30: define("_MONTHDAY", "n/j G:i");
31: define("_YEARMONTHDAY", "Y/n/j G:i");
32: define("_ELAPSE", "%s ago");
33: define("_TIMEFORMAT_DESC", "Valid formats: \"s\" - " . _SHORTDATESTRING . "; \"m\" - " . _MEDIUMDATESTRING . "; \"l\" - " . _DATESTRING . ";<br />" . "\"c\" or \"custom\" - format determined according to interval to present; \"e\" - Elapsed; \"mysql\" - Y-m-d H:i:s;<br />" . "specified string - Refer to <a href=\"http://php.net/manual/en/function.date.php\" rel=\"external\">PHP manual</a>.");
34: define("_TIMEZONE_SET", "Europe/London");
35:
36: /**
37: * A Xoops Local
38: *
39: * @package kernel
40: * @subpackage Language
41: *
42: * @author Taiwen Jiang <phppp@users.sourceforge.net>
43: * @copyright copyright (c) 2000-2009 XOOPS.org
44: */
45: class XoopsLocal extends XoopsLocalAbstract
46: {
47: /**
48: * Number Formats
49: *
50: * @param unknown_type $number
51: * @return string
52: */
53: static function number_format($number)
54: {
55: return number_format($number, 2, '.', ',');
56: }
57:
58: /**
59: * Money Format
60: *
61: * @param string $format
62: * @param string $number
63: * @return string format
64: */
65: static function money_format($format, $number)
66: {
67: setlocale(LC_MONETARY, 'en_US');
68: return money_format($format, $number);
69: }
70: }
71: