Forum Replies Created

Viewing 1 replies (of 1 total)
  • Here is my code which help me resolve problems with sending emails from admin translated, when rest is in english.


    function redefine_locale($locale) {
    global $l10n;
    unset($l10n['YOUR_DOMAIN']);
    add_filter('locale', $f=create_function('', "return '{$locale}';"));
    load_plugin_textdomain('YOUR_DOMAIN', FALSE, dirname(plugin_basename(__FILE__)));
    remove_filter('locale', $f);
    }

    Usage:

    function send_mail() {
    PolcodeWpsc_Utils::redefine_locale(get_option('WPLANG'));
    $message = __('lorem ipsum', 'YOUR_DOMAIN');
    wp_mail();
    PolcodeWpsc_Utils::redefine_locale(get_locale());
    }

Viewing 1 replies (of 1 total)