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.

I am creating a series of WP child themes which are dependent of a parent theme which I will be using as a framework.

I need to have these themes (both parent and children) localized.

from http://codex.wordpress.org/Function_Reference/load_theme_textdomain I understood I need to add the following to my theme:

add_action('after_setup_theme', 'my_theme_setup');
function my_theme_setup(){
    load_theme_textdomain('mytextdomain', get_template_directory() . '/lang');
}

this goes in the functions.php, I suppose

however, what about children themes? functions.php of a children theme overrides functions.php of a parent theme

should textdomain ("mytextdomain") of the child theme be the same as parent theme or be different (and also call load_theme_textdomain function with a different function name (see above code "my_theme_Setup()")?

what is the correct way of localizing both a parent and child theme?

thank you for clarifying this :)

share|improve this question
    
The functions.php of a child does not "override" the parent, it gets loaded before the parent's functions.php file loads. BOTH functions.php files will be loaded by WordPress. –  Otto Sep 11 '12 at 20:04

1 Answer 1

up vote 3 down vote accepted

Child themes should use load_child_theme_textdomain(). You can find it in /wp-includes/l10n.php. Use a new slug and a separate po file.

share|improve this answer

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.