WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using twentytwelve theme with 1.0 version. I saw many codes like following,

'name' = __('page','twentytwelve');

If I give,

'name' = 'page';

It's also working fine. Then why using __()?
What is use of that?

share|improve this question
I would venture to guess that you've either seen array( 'name' => __('page','twentytwelve') ); or $name = __('page','twentytwelve');. Just as an aside. – Johannes Pille Oct 3 '13 at 12:08
up vote 14 down vote accepted

Internationalization and localization (commonly abbreviated as i18n and l10n respectively) are terms used to describe the effort to make WordPress (and other such projects) available in languages other than English, for people from different locales, who use different dialects and local preferences.

__() is used when the message is passed as an argument to another function. _e() is used to write the message directly to the page. More detail on this @ http://codex.wordpress.org/Translating_WordPress

share|improve this answer
+1 and for a thorough breakdown on gettext in WP see this answer – Johannes Pille Oct 3 '13 at 12:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.