[theme-reviewers] Internationalization of Child Themes

Andrew Nacin wp at andrewnacin.com
Fri Aug 31 22:22:44 UTC 2012

On Fri, Aug 17, 2012 at 2:00 AM, Michael Fields <michael at mfields.org> wrote:

> Hello!
> I added a new section to the Child Theme page in the Codex. I believe that
> that represents the best practice in preparing a child theme for
> translation. I just wanted to get everyone's opinion on the process. I
> would like to work out any issues with the process and have to most
> up-to-date best practice solution right in the Codex.
> Here's a link:
> http://codex.wordpress.org/Child_Themes#Internationalization

The one thing is that load_child_theme_textdomain() is actually kind of

load_theme_textdomain( 'parent-theme' ) looks in the theme's root directory
for a .mo file. Obviously, /languages is preferred.

load_child_theme_textdomain( 'child-theme' ) looks in the child theme's
root directory for a .mo file. Obviously, /languages is preferred.

When you pass a $path to either, it considers it to be absolute. That means
both functions work identically if a path is passed to it
(get_template_directory() . '/languages' versus get_stylesheet_directory()
. '/languages).

What I'd like to do is make both accept a relative path, and then
load_child_theme_textdomain() is actually useful. But in the examples on
the Codex page, it might as well be load_theme_textdomain().

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20120831/82205b82/attachment.htm>

More information about the theme-reviewers mailing list