summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authormillette <millette@controlyourself.ca>2008-12-04 15:34:33 -0500
committermillette <millette@controlyourself.ca>2008-12-04 15:34:33 -0500
commit9c3c1e0272c34adf315612d717c3640923d4fe62 (patch)
treea7a40eeb694674d1c03cd946d66b51565cafabdc /lib/util.php
parentf9c88fe09c3f3946c8599154e1c4dc4919bf72df (diff)
trac494 email is now in recipient's language
darcs-hash:20081204203433-099f7-41be8f47b2a8e647414225f26318da005144006d.gz
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/util.php b/lib/util.php
index 204ad511c..077c9219a 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -131,17 +131,24 @@ function common_end_xml() {
$xw->flush();
}
+function common_init_locale($language=null) {
+ if(!$language) {
+ $language = common_language();
+ }
+ putenv('LANGUAGE='.$language);
+ putenv('LANG='.$language);
+ return setlocale(LC_ALL, $language . ".utf8",
+ $language . ".UTF8",
+ $language . ".utf-8",
+ $language . ".UTF-8",
+ $language);
+}
+
function common_init_language() {
mb_internal_encoding('UTF-8');
$language = common_language();
# So we don't have to make people install the gettext locales
- putenv('LANGUAGE='.$language);
- putenv('LANG='.$language);
- $locale_set = setlocale(LC_ALL, $language . ".utf8",
- $language . ".UTF8",
- $language . ".utf-8",
- $language . ".UTF-8",
- $language);
+ $locale_set = common_init_locale($language);
bindtextdomain("laconica", common_config('site','locale_path'));
bind_textdomain_codeset("laconica", "UTF-8");
textdomain("laconica");