#6951 closed enhancement (fixed)
load_theme_textdomain should allow one to specify directory
Reported by: | filosofo | Owned by: | |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | load_theme_textdomain l10n i18n has-patch needs-testing |
Focuses: | Cc: |
Description
Currently, you have to put .mo files in the top-most part of the theme directory, which can make things kind of crowded. It would be good to be able to specify another directory, so one could organize them in a sub-directory.
My patch preserves existing behavior by default, but adds an extra argument for load_theme_textdomain for the directory path.
Attachments (1)
Change History (8)
#2
@
17 years ago
Viper007Bond, what sort of bad habits and practices do you have in mind? I'm not disagreeing, just unaware. Most of the time it seems like people with bad practices won't use l10n at all.
I also thought it might occasionally be handy to keep l10n files outside the theme directory. Say, for example, that you've standardized the text of all your themes, and you allow users to switch themes.
#3
@
17 years ago
That's a good point (a global file).
I was trying to avoid theme authors setting the localization directory to like /wp-includes/languages/
or something.
#4
@
17 years ago
It should certainly _default_ to being relative to the theme directory.
+1 on this.
I think it might be worthwhile to force the translation file to be somewhere inside the theme's folder. That way theme developers with bad habits and practices can't have it be located elsewhere.
I propose
$path
should be a relative to the current theme's directory.