Пример #1
0
function engelsystem_email_to_user($recipient_user, $title, $message, $not_if_its_me = false)
{
    global $user;
    if ($not_if_its_me && $user['UID'] == $recipient_user['UID']) {
        return true;
    }
    gettext_locale($recipient_user['Sprache']);
    $message = sprintf(_("Hi %s,"), $recipient_user['Nick']) . "\n\n" . _("here is a message for you from the engelsystem:") . "\n\n" . $message . "\n\n" . _("This email is autogenerated and has not to be signed. You got this email because you are registered in the engelsystem.");
    gettext_locale();
    return engelsystem_email($recipient_user['email'], $title, $message);
}
/**
 * Initializes gettext for internationalization and updates the sessions locale to use for translation.
 */
function gettext_init()
{
    global $locales, $default_locale;
    if (isset($_REQUEST['set_locale']) && in_array($_REQUEST['set_locale'], array_keys($locales))) {
        $_SESSION['locale'] = $_REQUEST['set_locale'];
    } elseif (!isset($_SESSION['locale'])) {
        $_SESSION['locale'] = $default_locale;
    }
    gettext_locale();
    bindtextdomain('default', '../locale');
    bind_textdomain_codeset('default', 'UTF-8');
    textdomain('default');
}