Opened 11 years ago
Closed 9 years ago
#27050 closed enhancement (wontfix)
Allow to load locales from `WP_LANG_DIR."/$locale/$locale.php"`
Reported by: | Denis-de-Bernardy | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.8 |
Component: | I18N | Keywords: | |
Focuses: | Cc: |
Description
WP has a hard-coded locale file location, in WP_LANG_DIR
.
There are a few pull requests in the composer/installers
project that rejected the idea of adding a wordpress-language
type because the language "packages" were, well… files… instead of folders that can be uniquely identified and deleted by composer during updates. For instance:
https://github.com/woothemes/woocommerce/pull/760
There's a workaround, of course, e.g. defining WP_LANG_DIR
as WP_CONTENT_DIR."/languages/".WPLANG
, but it's kind of messy because a plugin might want to override WPLANG
(and WP_LANG_DIR
is defined before they load), and one then needs to write a composer plugin (or abuse the wordpress-plugin
type) to make the needed files install where wanted.
In the interest of re-submitting the relevant pull request in composer/installers, I'd like to suggest that we try loading locale files from two locations:
- the current one for backwards compatibility
- a composer-friendlier one
Attachments (2)
Change History (10)
#1
@
11 years ago
Arf… Just realized I posted a link to the wrong pull request. Was meant:
https://github.com/composer/installers/pull/112
Also of interest:
#4
in reply to:
↑ 3
@
11 years ago
Replying to ocean90:
Why only
$locale.php
? What about the language files?
It was only $locale.php
before (see patch). This just allows it to be optionally loaded from a subdirectory (named after WP_LANG) as well.
#5
@
11 years ago
We're trying to eliminate the need for $locale.php by absorbing their functionality into core. By the end of 2014 (I hope), no official language distribution will have them anymore. That's not to say we'd stop including them if the file exists, but I don't see a need to do this.
fix space