Changeset 13096 for trunk/wp-includes/l10n.php
- Timestamp:
- 02/13/2010 07:28:19 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/l10n.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/l10n.php
r12988 r13096 78 78 } 79 79 80 /**81 * Translates $text like translate(), but assumes that the text82 * contains a context after its last vertical bar.83 *84 * @since 2.585 * @uses translate()86 *87 * @param string $text Text to translate88 * @param string $domain Domain to retrieve the translated text89 * @return string Translated text90 */91 function translate_with_context( $text, $domain = 'default' ) {92 return before_last_bar( translate( $text, $domain ) );93 }94 95 80 function translate_with_gettext_context( $text, $context, $domain = 'default' ) { 96 81 $translations = &get_translations_for_domain( $domain ); … … 193 178 * 194 179 * By including the context in the pot file translators can translate the two 195 * string differently 196 * 197 * @since 2.8 180 * string differently. 181 * 182 * @since 2.8.0 198 183 * 199 184 * @param string $text Text to translate … … 202 187 * @return string Translated context string without pipe 203 188 */ 204 205 189 function _x( $single, $context, $domain = 'default' ) { 206 190 return translate_with_gettext_context( $single, $context, $domain ); … … 213 197 function esc_html_x( $single, $context, $domain = 'default' ) { 214 198 return esc_html( translate_with_gettext_context( $single, $context, $domain ) ); 215 }216 217 function __ngettext() {218 _deprecated_function( __FUNCTION__, '2.8', '_n()' );219 $args = func_get_args();220 return call_user_func_array('_n', $args);221 199 } 222 200 … … 232 210 * type will be a string. 233 211 * 234 * @since 1.2.0212 * @since 2.8.0 235 213 * @uses $l10n Gets list of domain translated string (gettext_reader) objects 236 214 * @uses apply_filters() Calls 'ngettext' hook on domains text returned, … … 260 238 $translation = $translations->translate_plural( $single, $plural, $number, $context ); 261 239 return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain ); 262 }263 264 /**265 * @deprecated Use _n_noop()266 */267 function __ngettext_noop() {268 _deprecated_function( __FUNCTION__, '2.8', '_n_noop()' );269 $args = func_get_args();270 return call_user_func_array('_n_noop', $args);271 272 240 } 273 241 … … 305 273 } 306 274 307 308 275 /** 309 276 * Loads a MO file into the domain $domain.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)