$this->fetchData($this->group_forum_id);
if ($create_default_message) {
$fm=new ForumMessage($this);
- if (!$fm->create("Welcome to ".$forum_name,"Welcome to ".$forum_name)) {
+ // Use the system side default language
+ setup_gettext_from_sys_lang ();
+ $string=sprintf(_('Welcome to %1$s'), $forum_name);
+ // and switch back to the user preference
+ setup_gettext_from_browser ();
+ if (!$fm->create($string, $string)) {
$this->setError($fm->getErrorMessage());
return false;
}
setup_gettext_from_locale ($locale) ;
}
+function setup_gettext_from_sys_lang () {
+
+ $lang = "English";
+ if ($GLOBALS['sys_lang']) {
+ $lang = $GLOBALS['sys_lang'] ;
+ }
+
+ $locale = language_name_to_locale_code($lang).'.utf8';
+ setup_gettext_from_locale ($locale) ;
+}
+
function setup_gettext_from_locale ($locale) {
setlocale(LC_ALL, $locale);
setlocale (LC_TIME, _('en_US'));