diff options
author | Brion Vibber <brion@pobox.com> | 2009-12-20 15:33:33 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2009-12-21 09:06:07 -0800 |
commit | a06af3f12519886a474e0aaa970778861102b3a5 (patch) | |
tree | d4616118c4353632f207fc5878ce85be5c153323 /lib/language.php | |
parent | 5472779240aad58b6fc841e2f15b63de8cfa14af (diff) |
Ticket 1982: define LC_MESSAGES and friends if PHP didn't predefine them for us. (Known problem on Win32)
Diffstat (limited to 'lib/language.php')
-rw-r--r-- | lib/language.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/language.php b/lib/language.php index 0e4ccc409..f5ee7fac5 100644 --- a/lib/language.php +++ b/lib/language.php @@ -32,6 +32,21 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +// Locale category constants are usually predefined, but may not be +// on some systems such as Win32. +$LC_CATEGORIES = array('LC_CTYPE', + 'LC_NUMERIC', + 'LC_TIME', + 'LC_COLLATE', + 'LC_MONETARY', + 'LC_MESSAGES', + 'LC_ALL'); +foreach ($LC_CATEGORIES as $key => $name) { + if (!defined($name)) { + define($name, $key); + } +} + if (!function_exists('gettext')) { require_once("php-gettext/gettext.inc"); } |