[wp-trac] [WordPress Trac] #27050: Allow to load locales from `WP_LANG_DIR."/$locale/$locale.php"`

WordPress Trac noreply at wordpress.org
Fri Feb 7 12:31:35 UTC 2014


#27050: Allow to load locales from `WP_LANG_DIR."/$locale/$locale.php"`
-------------------------------+-----------------------------
 Reporter:  Denis-de-Bernardy  |      Owner:
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  I18N               |    Version:  trunk
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 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:

 1. the current one for backwards compatibility
 2. a composer-friendlier one

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27050>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list