Changeset 3391
- Timestamp:
- 06/16/2016 04:40:43 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-i18n.php
r3326 r3391 34 34 } 35 35 36 37 38 39 40 41 36 function __construct( $db, $tracker = null ) { 37 if ( !empty( $db ) && is_object( $db ) ) { 38 $this->db = $db; 39 } 40 41 wp_cache_add_global_groups( $this->i18n_cache_group ); 42 42 } 43 43 … … 116 116 117 117 $branch_id = $this->db->get_var( $this->db->prepare( 118 'SELECT id FROM ' .GLOTPRESS_TABLE_PREFIX.'_projects WHERE path = %s',118 'SELECT id FROM ' . GLOTPRESS_TABLE_PREFIX . 'projects WHERE path = %s', 119 119 "wp-plugins/{$slug}/{$branch}" 120 120 ) ); … … 162 162 163 163 $originals = $this->db->get_results( $this->db->prepare( 164 'SELECT id, singular, comment FROM ' .GLOTPRESS_TABLE_PREFIX.'_originals WHERE project_id = %d AND status = %s ORDER BY CHAR_LENGTH(singular) DESC',164 'SELECT id, singular, comment FROM ' . GLOTPRESS_TABLE_PREFIX . 'originals WHERE project_id = %d AND status = %s ORDER BY CHAR_LENGTH(singular) DESC', 165 165 $branch_id, '+active' 166 166 ) ); … … 198 198 199 199 $translation_set_id = $this->db->get_var( $this->db->prepare( 200 'SELECT id FROM ' .GLOTPRESS_TABLE_PREFIX.'_translation_sets WHERE project_id = %d AND locale = %s',200 'SELECT id FROM ' . GLOTPRESS_TABLE_PREFIX . 'translation_sets WHERE project_id = %d AND locale = %s', 201 201 $branch_id, $locale ) ); 202 202 … … 204 204 // Don't give up yet. Might be given fr_FR, which actually exists as locale=fr in GP. 205 205 $translation_set_id = $this->db->get_var( $this->db->prepare( 206 'SELECT id FROM ' .GLOTPRESS_TABLE_PREFIX.'_translation_sets WHERE project_id = %d AND locale = %s',206 'SELECT id FROM ' . GLOTPRESS_TABLE_PREFIX . 'translation_sets WHERE project_id = %d AND locale = %s', 207 207 $branch_id, preg_replace( '/^([^-]+)(-.+)?$/', '\1', $locale ) ) ); 208 208 } … … 241 241 242 242 $original = $this->db->get_row( $this->db->prepare( 243 'SELECT id, singular, comment FROM ' .GLOTPRESS_TABLE_PREFIX.'_originals WHERE project_id = %d AND status = %s AND singular = %s',243 'SELECT id, singular, comment FROM ' . GLOTPRESS_TABLE_PREFIX . 'originals WHERE project_id = %d AND status = %s AND singular = %s', 244 244 $branch_id, '+active', $str 245 245 ) ); … … 350 350 351 351 $translation = $this->db->get_var( $this->db->prepare( 352 'SELECT translation_0 FROM ' .GLOTPRESS_TABLE_PREFIX.'_translations WHERE original_id = %d AND translation_set_id = %d AND status = %s',352 'SELECT translation_0 FROM ' . GLOTPRESS_TABLE_PREFIX . 'translations WHERE original_id = %d AND translation_set_id = %d AND status = %s', 353 353 $original->id, $translation_set_id, 'current' 354 354 ) ); … … 385 385 return $content; 386 386 } 387 388 387 } 389
Note: See TracChangeset
for help on using the changeset viewer.