Ticket #10527: 10527.patch
| File 10527.patch, 1.8 KB (added by hakre, 4 years ago) |
|---|
-
wp-includes/l10n.php
314 314 * 315 315 * @param string $domain Unique identifier for retrieving translated strings 316 316 * @param string $mofile Path to the .mo file 317 * @param bool $merge (optional) flag wether or not to merge the .mo file with an textdomain in nemory. default is false. 317 318 * @return bool true on success, false on failure 318 319 */ 319 function load_textdomain($domain, $mofile ) {320 function load_textdomain($domain, $mofile, $merge = false) { 320 321 global $l10n; 321 322 322 323 if ( !is_readable( $mofile ) ) return false; 324 325 if ( isset( $l10n[$domain] ) && false == $merge ) 326 return true; 323 327 324 328 $mo = new MO(); 325 329 if ( !$mo->import_from_file( $mofile ) ) return false; … … 359 363 * @param string $abs_rel_path Optional. Relative path to ABSPATH of a folder, 360 364 * where the .mo file resides. Deprecated, but still functional until 2.7 361 365 * @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 366 * @param bool $merge (optional) flag wether or not to merge the .mo file with an textdomain in nemory. default is false. 367 * @return bool true on success, false on failure 362 368 */ 363 function load_plugin_textdomain($domain, $abs_rel_path = false, $plugin_rel_path = false ) {369 function load_plugin_textdomain($domain, $abs_rel_path = false, $plugin_rel_path = false, $merge = false) { 364 370 $locale = get_locale(); 365 371 366 372 if ( false !== $plugin_rel_path ) … … 371 377 $path = WP_PLUGIN_DIR; 372 378 373 379 $mofile = $path . '/'. $domain . '-' . $locale . '.mo'; 374 return load_textdomain($domain, $mofile );380 return load_textdomain($domain, $mofile, $merge); 375 381 } 376 382 377 383 /**
