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'm building a theme which includes a separate "section" and I want to make both the theme and the separate section localizable. However, I don't want to have them under the same textdomain.

Would someone advise against doing this? Could there be any issues?

I don't want to have the separate section as a plugin.

This is what could appear inside e.g. functions.php:

__('String', 'themename');
__('Another string', 'somethingelse');
share|improve this question
    
hmm... have you tried that? does it work? what have you done to call multilple translation files meaning with this line (for example): load_theme_textdomain('sagive', $lang); –  Sagive SEO Mar 31 '12 at 20:21
add comment

1 Answer

Technically, this is possible. You can load as many language files as you want:

load_theme_textdomain( 'text_domain_1', get_template_directory() . '/languages/td1' ) );
load_theme_textdomain( 'text_domain_2', get_template_directory() . '/languages/td2' ) );

In terms of performance it may be useful if want to separate front-end and back-end translations.

But it is the wrong solution if do this to manage plugin code that you have moved into a theme. For example the notorious contact form, shortcodes or a dashboard widget – these parts should be handled by real plugins.

TL;DR: It depends on the problem you want to solve.

share|improve this answer
add comment

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.