Changes from branches/2.8/wp-includes/l10n.php at r11681 to trunk/wp-includes/l10n.php at r11411
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/l10n.php
r11681 r11411 302 302 303 303 /** 304 * Loads a MO file into the domain $domain.305 * 306 * If the domain already exists, the translations will be merged. If both307 * sets have the same string, the translation from the original value will be taken.304 * Loads MO file into the list of domains. 305 * 306 * If the domain already exists, the inclusion will fail. If the MO file is not 307 * readable, the inclusion will fail. 308 308 * 309 309 * On success, the .mo file will be placed in the $l10n global by $domain 310 * and will be a MOobject.310 * and will be an gettext_reader object. 311 311 * 312 312 * @since 1.5.0 313 * @uses $l10n Gets list of domain translated string objects 313 * @uses $l10n Gets list of domain translated string (gettext_reader) objects 314 * @uses CacheFileReader Reads the MO file 315 * @uses gettext_reader Allows for retrieving translated strings 314 316 * 315 317 * @param string $domain Unique identifier for retrieving translated strings 316 318 * @param string $mofile Path to the .mo file 317 * @return bool true on success, false on failure319 * @return null On failure returns null and also on success returns nothing. 318 320 */ 319 321 function load_textdomain($domain, $mofile) { 320 322 global $l10n; 321 323 322 if ( !is_readable( $mofile ) ) return false;324 if ( !is_readable($mofile)) return; 323 325 324 326 $mo = new MO(); 325 if ( !$mo->import_from_file( $mofile ) ) return false;326 327 if ( isset( $l10n[$domain] ))327 $mo->import_from_file( $mofile ); 328 329 if (isset($l10n[$domain])) 328 330 $mo->merge_with( $l10n[$domain] ); 329 331 330 332 $l10n[$domain] = &$mo; 331 return true;332 333 } 333 334 … … 345 346 $mofile = WP_LANG_DIR . "/$locale.mo"; 346 347 347 returnload_textdomain('default', $mofile);348 load_textdomain('default', $mofile); 348 349 } 349 350 … … 372 373 373 374 $mofile = $path . '/'. $domain . '-' . $locale . '.mo'; 374 returnload_textdomain($domain, $mofile);375 load_textdomain($domain, $mofile); 375 376 } 376 377 … … 393 394 394 395 $mofile = "$path/$locale.mo"; 395 returnload_textdomain($domain, $mofile);396 load_textdomain($domain, $mofile); 396 397 } 397 398 … … 423 424 */ 424 425 function translate_user_role( $name ) { 425 return translate_with_gettext_context( before_last_bar($name), 'User role');426 return before_last_bar( translate_with_gettext_context( $name, 'User role' ) ); 426 427 } 427 428 ?>
Note: See TracChangeset
for help on using the changeset viewer.