Changeset 5450 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-i18n.php
- Timestamp:
- 04/30/2017 07:39:09 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-i18n.php
r4764 r5450 10 10 11 11 /** 12 * Translate a Term Name.12 * Translates term names and descriptions. 13 13 * 14 14 * @param \WP_Term $term The Term object to translate. 15 * @return \WP_Term The term object with a translated `name` field.15 * @return \WP_Term The term object with a translated `name` and/or `description` field. 16 16 */ 17 static function translate_term( $term ) {17 public static function translate_term( $term ) { 18 18 if ( 'en_US' == get_locale() ) { 19 19 return $term; … … 24 24 } elseif ( 'plugin_section' == $term->taxonomy ) { 25 25 $term->name = esc_html( translate_with_gettext_context( html_entity_decode( $term->name ), 'Plugin Section Name', 'wporg-plugins' ) ); 26 if ( $term->description ) { 27 $term->description = esc_html( translate_with_gettext_context( html_entity_decode( $term->description ), 'Plugin Section Description', 'wporg-plugins' ) ); 28 } 26 29 } elseif ( 'plugin_business_model' == $term->taxonomy ) { 27 30 $term->name = esc_html( translate_with_gettext_context( html_entity_decode( $term->name ), 'Plugin Business Model', 'wporg-plugins' ) ); … … 39 42 private function static_strings() { 40 43 41 // Category Terms.44 // Category terms. 42 45 _x( 'Accessibility', 'Plugin Category Name', 'wporg-plugins' ); 43 46 _x( 'Advertising', 'Plugin Category Name', 'wporg-plugins' ); … … 67 70 _x( 'Utilities & Tools', 'Plugin Category Name', 'wporg-plugins' ); 68 71 69 // Section Terms.72 // Section terms. 70 73 _x( 'Adopt Me', 'Plugin Section Name', 'wporg-plugins' ); 71 74 _x( 'Beta', 'Plugin Section Name', 'wporg-plugins' ); … … 73 76 _x( 'Featured', 'Plugin Section Name', 'wporg-plugins' ); 74 77 _x( 'Popular', 'Plugin Section Name', 'wporg-plugins' ); 78 79 // Section descriptions. 80 _x( 'Plugins that have been offered for adoption by others.', 'Plugin Section Description', 'wporg-plugins' ); 81 _x( 'Beta plugins are in development for possible inclusion in a future version of WordPress.', 'Plugin Section Description', 'wporg-plugins' ); 82 _x( 'Plugins contained within this category get displayed on the Featured tab.', 'Plugin Section Description', 'wporg-plugins' ); 83 _x( 'The below plugins have been marked as favorites.', 'Plugin Section Description', 'wporg-plugins' ); 75 84 } 76 85 }
Note: See TracChangeset
for help on using the changeset viewer.