Changeset 1817 for trunk/wp-includes/wp-l10n.php
- Timestamp:
- 10/19/2004 12:18:12 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/wp-l10n.php
r1809 r1817 3 3 4 4 require_once($parentpath.'/wp-config.php'); 5 6 $curpath = dirname(__FILE__).'/';7 5 8 6 $locale = ''; … … 17 15 } 18 16 19 $mofile = $curpath . "languages/$locale.mo"; 20 21 require($curpath . 'streams.php'); 22 require($curpath . 'gettext.php'); 23 24 // If the mo file does not exist or is not readable, or if the locale is 25 // en_US, do not load the mo. 26 if ( is_readable($mofile) && ($locale != 'en_US') ) { 27 $input = new FileReader($mofile); 28 } else { 29 $input = false; 30 } 31 32 $l10n['default'] = new gettext_reader($input); 17 require_once(ABSPATH . 'wp-includes/streams.php'); 18 require_once(ABSPATH . 'wp-includes/gettext.php'); 33 19 34 20 // Return a translated string. … … 68 54 global $l10n; 69 55 56 if (isset($l10n[$domain])) { 57 return; 58 } 59 70 60 if ( is_readable($mofile)) { 71 61 $input = new FileReader($mofile); … … 75 65 76 66 $l10n[$domain] = new gettext_reader($input); 67 } 68 69 function load_default_textdomain() { 70 global $l10n, $locale; 71 72 $mofile = ABSPATH . "wp-includes/languages/$locale.mo"; 73 74 load_textdomain('default', $mofile); 77 75 } 78 76 … … 91 89 } 92 90 91 // Load the default domain. 92 load_default_textdomain(); 93 93 94 require($curpath . 'locale.php'); 94 95 ?>
Note: See TracChangeset
for help on using the changeset viewer.