Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
<?php _e( $text, $domain ) ?>

$domain

(string) (optional) Domain to retrieve the translated text Default: 'default

can't understand the second argument well. when i custom a theme, where the $domain's value shows on the theme, what value should i give it to.? could i write the $domain part optionally?i see some themes using its theme name as the $domain. but the document says Domain to retrieve the translated text.it's not a domain. why? some using other strings which doesn't have any relevance of the theme?

share|improve this question

1 Answer 1

$domain is the unique identifier for retrieving translated strings.

It is set in functions.php

<?php load_theme_textdomain( $domain, $path ) ?>

ex:

load_theme_textdomain('my_theme', get_template_directory() . '/languages');

<?php _e( 'Translate this text', 'my_theme' ) ?>

If you don't have a translation file but want't to make it translatable just define the textdomain.

load_theme_textdomain('my_theme');

share|improve this answer
    
if i don't have the languages file. how do i do? –  enjoylife May 31 '11 at 0:34
    
it is not absolutely necessary to have a languages file, for example the translation plugin WPML can also translate the strings within the Dashboard, without the need for a .mo file. –  Piet May 31 '11 at 1:07

Your Answer

 
discard

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.