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');
Technically, this is possible. You can load as many language files as you want:
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.