summaryrefslogtreecommitdiffstats
path: root/wp-includes/l10n.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-13 17:21:00 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-13 17:21:00 +0000
commit12de05107e4c8b006bde6ee8916f34eb476d08da (patch)
tree123ee54ecd1f3f777373b7df54a4604012d43640 /wp-includes/l10n.php
parente51c7a9ca4bfdb45fa3ec7334bd33871e78c68b1 (diff)
downloadwordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.gz
wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.xz
wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.zip
WP Merge with revision 8075
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1328 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/l10n.php')
-rw-r--r--wp-includes/l10n.php32
1 files changed, 13 insertions, 19 deletions
diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php
index 0584f9d..f48a4c9 100644
--- a/wp-includes/l10n.php
+++ b/wp-includes/l10n.php
@@ -38,7 +38,7 @@ function get_locale() {
$locale = WPLANG;
if (empty($locale))
- $locale = '';
+ $locale = 'en_US';
$locale = apply_filters('locale', $locale);
@@ -263,8 +263,6 @@ function load_textdomain($domain, $mofile) {
*/
function load_default_textdomain() {
$locale = get_locale();
- if ( empty($locale) )
- $locale = 'en_US';
$mofile = ABSPATH . LANGDIR . "/$locale.mo";
@@ -278,26 +276,24 @@ function load_default_textdomain() {
* directory. The .mo file should be named based on the domain with a
* dash followed by a dash, and then the locale exactly.
*
- * The plugin may place all of the .mo files in another folder and set
- * the $path based on the relative location from ABSPATH constant. The
- * plugin may use the constant PLUGINDIR and/or plugin_basename() to
- * get path of the plugin and then add the folder which holds the .mo
- * files.
- *
* @since 1.5.0
*
* @param string $domain Unique identifier for retrieving translated strings
- * @param string $path Optional. Path of the folder where the .mo files reside.
+ * @param string $abs_rel_path Optional. Relative path to ABSPATH of a folder,
+ * where the .mo file resides. Deprecated, but still functional until 2.7
+ * @param string $plugin_rel_path Optional. Relative path to WP_PLUGIN_DIR. This is the preferred argument to use. It takes precendence over $abs_rel_path
*/
-function load_plugin_textdomain($domain, $path = false) {
+function load_plugin_textdomain($domain, $abs_rel_path = false, $plugin_rel_path = false) {
$locale = get_locale();
- if ( empty($locale) )
- $locale = 'en_US';
-
- if ( false === $path )
- $path = PLUGINDIR;
+
+ if ( false !== $plugin_rel_path )
+ $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/');
+ else if ( false !== $abs_rel_path)
+ $path = ABSPATH . trim( $abs_rel_path, '/');
+ else
+ $path = WP_PLUGIN_DIR;
- $mofile = ABSPATH . "$path/$domain-$locale.mo";
+ $mofile = $path . '/'. $domain . '-' . $locale . '.mo';
load_textdomain($domain, $mofile);
}
@@ -315,8 +311,6 @@ function load_plugin_textdomain($domain, $path = false) {
*/
function load_theme_textdomain($domain) {
$locale = get_locale();
- if ( empty($locale) )
- $locale = 'en_US';
$mofile = get_template_directory() . "/$locale.mo";
load_textdomain($domain, $mofile);