Changeset 15257
- Timestamp:
- 10/01/2026 02:51:52 PM (30 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/glotpress-translate-bridge/glotpress-translate-bridge.php
r10312 r15257 3 3 * Plugin Name: GlotPress Translate Bridge 4 4 * Description: This plugin allows for a code to translate arbitrary strings from a GlotPress instance for the current locale. 5 * Version: 0. 15 * Version: 0.2 6 6 * Plugin URI: https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/glotpress-translate-bridge/ 7 7 * Author: wordpressdotorg … … 131 131 $sql_locale = $wpdb->prepare( "s.locale = %s AND s.slug = %s", $locale['locale'], $locale['slug'] ); 132 132 133 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Dynamic table prefix cannot be passed via placeholders. 133 134 $translation = $wpdb->get_row( 134 135 "SELECT t.translation_0, t.translation_1, t.translation_2, t.translation_3, t.translation_4, t.translation_5 135 136 FROM {$this->gp_prefix}projects p 136 LEFTJOIN {$this->gp_prefix}originals o ON p.id = o.project_id137 LEFTJOIN {$this->gp_prefix}translation_sets s ON p.id = s.project_id138 LEFTJOIN {$this->gp_prefix}translations t ON t.original_id = o.id AND t.translation_set_id = s.id137 INNER JOIN {$this->gp_prefix}originals o ON p.id = o.project_id 138 INNER JOIN {$this->gp_prefix}translation_sets s ON p.id = s.project_id 139 INNER JOIN {$this->gp_prefix}translations t ON t.original_id = o.id AND t.translation_set_id = s.id 139 140 140 141 WHERE … … 147 148 ARRAY_N 148 149 ); 150 // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared 149 151 150 152 if ( ! $translation ) { … … 219 221 * @return string The cache key. 220 222 */ 221 private function cache_key( $strings, $project_path ) { 222 return strtolower( get_locale() ) . ':' . $project_path . ':' . serialize( array_filter( $strings ) ); 223 private function cache_key( array $strings, $project_path ) { 224 $payload = serialize( array_filter( $strings ) ); 225 return 'gp_tb:' . strtolower( get_locale() ) . ':' . md5( $project_path . ':' . $payload ); 223 226 } 224 227 }
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)