Ticket #48383: 48383.2.diff
File 48383.2.diff, 3.1 KB (added by , 6 years ago) |
---|
-
src/wp-includes/l10n.php
169 169 * @param string $text Text to translate. 170 170 * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings. 171 171 * Default 'default'. 172 * @return string Translated text 172 * @return string Translated text. 173 173 */ 174 174 function translate( $text, $domain = 'default' ) { 175 175 $translations = get_translations_for_domain( $domain ); … … 210 210 /** 211 211 * Retrieve the translation of $text in the context defined in $context. 212 212 * 213 * If there is no translation, or the text domain isn't loaded the original 214 * text is returned. 213 * If there is no translation, or the text domain isn't loaded, the original text is returned. 215 214 * 216 215 * *Note:* Don't use translate_with_gettext_context() directly, use _x() or related functions. 217 216 * … … 282 281 * @param string $text Text to translate. 283 282 * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings. 284 283 * Default 'default'. 285 * @return string Translated text 284 * @return string Translated text. 286 285 */ 287 286 function esc_html__( $text, $domain = 'default' ) { 288 287 return esc_html( translate( $text, $domain ) ); … … 304 303 /** 305 304 * Display translated text that has been escaped for safe use in an attribute. 306 305 * 306 * Encodes `< > & " '` (less than, greater than, ampersand, double quote, single quote). 307 * Will never double encode entities. 308 * 309 * If you need the value for use in PHP, use esc_attr__(). 310 * 307 311 * @since 2.8.0 308 312 * 309 313 * @param string $text Text to translate. … … 317 321 /** 318 322 * Display translated text that has been escaped for safe use in HTML output. 319 323 * 324 * If there is no translation, or the text domain isn't loaded, the original text 325 * is escaped and displayed. 326 * 327 * If you need the value for use in PHP, use esc_html__(). 328 * 320 329 * @since 2.8.0 321 330 * 322 331 * @param string $text Text to translate. … … 366 375 /** 367 376 * Translate string with gettext context, and escapes it for safe use in an attribute. 368 377 * 378 * If there is no translation, or the text domain isn't loaded, the original text 379 * is escaped and returned. 380 * 369 381 * @since 2.8.0 370 382 * 371 383 * @param string $text Text to translate. … … 372 384 * @param string $context Context information for the translators. 373 385 * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings. 374 386 * Default 'default'. 375 * @return string Translated text 387 * @return string Translated text. 376 388 */ 377 389 function esc_attr_x( $text, $context, $domain = 'default' ) { 378 390 return esc_attr( translate_with_gettext_context( $text, $context, $domain ) ); … … 381 393 /** 382 394 * Translate string with gettext context, and escapes it for safe use in HTML output. 383 395 * 396 * If there is no translation, or the text domain isn't loaded, the original text 397 * is escaped and returned. 398 * 384 399 * @since 2.9.0 385 400 * 386 401 * @param string $text Text to translate.