#11033 closed defect (bug) (fixed)
Function needed to support l10n for child themes
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | high | Milestone: | 2.9 |
| Component: | I18N | Version: | 2.9 |
| Severity: | major | Keywords: | has-patch |
| Cc: |
Description
The "load_theme_textdomain" function falls short when there is a parent theme to the currently active child theme style. Because load_theme_textdomain uses get_theme_directory, it will always load the parents textdomain, even if there are text changes included in the child style.
This patch includes a new function "load_style_textdomain" to allow child themes to have their own po/mo's. This would presumably be called in the child themes functions.php, or somewhere relative to it.
This may become more important with BuddyPress 1.1+ as the parent/child theme/style relationships become more popular.
Attachments (1)
Change History (9)
johnjamesjacoby
— 4 years ago
comment:1
johnjamesjacoby
— 4 years ago
- Component changed from General to i18n
Change component to i18n.
comment:2
johnjamesjacoby
— 4 years ago
- Priority changed from normal to high
- Severity changed from normal to major
Any chance to have this put to the test for 2.9?
comment:3
westi
— 4 years ago
- Owner changed from johnjamesjacoby to westi
- Status changed from new to reviewing
comment:4
nbachiyski
— 4 years ago
It would have been perfect to be able to do it in load_theme_textdomain(), but we don't know the domain of the child theme there. so we can't load the strings to the right place. So, we need this function.
But I think we should call it load_child_theme_textdomain(). It should state what is the effect, not what it does under the hood. Also, I can't imagine why would you want to load the MO file from the stylesheet directory if you are not in a child theme.
comment:6
johnjamesjacoby
— 4 years ago
No where in the WordPress code does the nomenclature "child_theme" appear.
Instead the differences are always referred to as "theme" and "style".
If we're going for effect, almost all of these functions need to be renamed to match the parent/child relationship.
STYLESHEETPATH, get_stylesheet_directory(), etc...
+1 for putting this to core :D
-1 for renaming it in a way that doesn't match the rest :(
comment:7
nbachiyski
— 4 years ago
Do most of theme developers use other theme/style functions? I think most of the functions are used only internally, so it's ok the break the convention.
load_style_textdomain