• theboywonder

    (@theboywonder)


    Defined in wp-l10n.php

    // Return a translated string.
    function __($text, $domain = ‘default’) {
    global $l10n;

    if (isset($l10n[$domain])) {
    return $l10n[$domain]->translate($text);
    } else {
    return $text;
    }
    }

    // Echo a translated string.
    function _e($text, $domain = ‘default’) {
    global $l10n;

    if (isset($l10n[$domain])) {
    echo $l10n[$domain]->translate($text);
    } else {
    echo $text;
    }
    }

    Used all over the place in the WordPress code…. but what purpose do they serve exactly?

    Thanks for any help! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • They serve to give translation for all the Admin interface and for default theme too.

    You can have WP talking to you in a lot of different languages, actually there is various locale team translating last version of WP, the goal is to have a ready to install version for WP 1.5 in lot of different languages (ex. I’m coordinator for Italian).

    More info on l10n at:

    https://codex.www.ads-software.com/WordPress_Localization

    Thread Starter theboywonder

    (@theboywonder)

    Ok, that helps – thanks ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘function _e and __’ is closed to new replies.