Changeset 8065
- Timestamp:
- 06/09/2008 07:39:04 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/l10n.php
r8041 r8065 277 277 * dash followed by a dash, and then the locale exactly. 278 278 * 279 * The plugin may place all of the .mo files in another folder and set280 * the $path based on the relative location from ABSPATH constant. The281 * plugin may use the constant WP_PLUGIN_DIR and/or plugin_basename() to282 * get path of the plugin and then add the folder which holds the .mo283 * files.284 *285 279 * @since 1.5.0 286 280 * 287 281 * @param string $domain Unique identifier for retrieving translated strings 288 * @param string $path Optional. Path of the folder where the .mo files reside. 289 */ 290 function load_plugin_textdomain($domain, $path = false) { 282 * @param string $abs_rel_path Optional. Relative path to ABSPATH of a folder, 283 * where the .mo file resides. Deprecated, but still functional until 2.7 284 * @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 285 */ 286 function load_plugin_textdomain($domain, $abs_rel_path = false, $plugin_rel_path = false) { 291 287 $locale = get_locale(); 292 293 if ( false === $path ) 294 $path = ''; 288 289 if ( false !== $plugin_rel_path ) 290 $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/'); 291 else if ( false !== $abs_rel_path) 292 $path = ABSPATH . trim( $abs_rel_path, '/'); 295 293 else 296 $path = '/' . trim(trim($path), '/');297 298 $mofile = WP_PLUGIN_DIR .$path . '/'. $domain . '-' . $locale . '.mo';294 $path = WP_PLUGIN_DIR; 295 296 $mofile = $path . '/'. $domain . '-' . $locale . '.mo'; 299 297 load_textdomain($domain, $mofile); 300 298 }
Note: See TracChangeset
for help on using the changeset viewer.