Index: branches/wmf-deployment/extensions/LocalisationUpdate/LocalisationUpdate.i18n.php |
— | — | @@ -86,6 +86,13 @@ |
87 | 87 | 'localisationupdate-desc' => 'Źaržy lokalizěrowane powěźeńki tak aktualne ako móžno', |
88 | 88 | ); |
89 | 89 | |
| 90 | +/** Greek (Ελληνικά) |
| 91 | + * @author Omnipaedista |
| 92 | + */ |
| 93 | +$messages['el'] = array( |
| 94 | + 'localisationupdate-desc' => 'Διατηρεί τις μεταφράσεις μηνυμάτων όσο πιο ενημερωμένες γίνεται', |
| 95 | +); |
| 96 | + |
90 | 97 | /** Spanish (Español) |
91 | 98 | * @author Crazymadlover |
92 | 99 | */ |
— | — | @@ -296,6 +303,13 @@ |
297 | 304 | 'localisationupdate-desc' => 'Udržiava lokalizované správy čo najaktuálnejšie', |
298 | 305 | ); |
299 | 306 | |
| 307 | +/** Veps (Vepsan kel') |
| 308 | + * @author Игорь Бродский |
| 309 | + */ |
| 310 | +$messages['vep'] = array( |
| 311 | + 'localisationupdate-desc' => 'Pidab lokaliziruidud tedotused veresin, ku voib', |
| 312 | +); |
| 313 | + |
300 | 314 | /** Vietnamese (Tiếng Việt) |
301 | 315 | * @author Vinhtantran |
302 | 316 | */ |
Index: branches/wmf-deployment/extensions/LocalisationUpdate/LocalisationUpdate.php |
— | — | @@ -21,6 +21,18 @@ |
22 | 22 | |
23 | 23 | $wgLocalisationUpdateRetryAttempts = 5; |
24 | 24 | |
| 25 | +/** |
| 26 | + * If you want to share LocalisationUpdate info between multiple wikis, |
| 27 | + * you can have them reference a central copy of the tables in a given |
| 28 | + * database. Must be accessible via the main database connection. |
| 29 | + * |
| 30 | + * Note that if your wikis have different extensions enabled, you may |
| 31 | + * wish to pass the --all option to LocalisationUpdate/update.php so it |
| 32 | + * pulls updates for all extensions present in the source tree instead |
| 33 | + * of just the ones you have enabled on the wiki you run it from. |
| 34 | + */ |
| 35 | +$wgLocalisationUpdateDatabase = false; |
| 36 | + |
25 | 37 | // Info about me! |
26 | 38 | $wgExtensionCredits['other'][] = array( |
27 | 39 | 'path' => __FILE__, |
Index: branches/wmf-deployment/extensions/LocalisationUpdate/LocalisationUpdate.class.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | |
22 | 22 | // Get the message from the database |
23 | 23 | $conds = array( 'lo_key' => $lckey, 'lo_language' => $langcode ); |
24 | | - $result = $db->selectField( 'localisation', 'lo_value', $conds, __METHOD__ ); // Check if the database has any updated message |
| 24 | + $result = $db->selectField( self::table( 'localisation' ), 'lo_value', $conds, __METHOD__ ); // Check if the database has any updated message |
25 | 25 | if ( $result === false ) { // If no results found, exit here |
26 | 26 | return true; |
27 | 27 | } |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | $dbr = wfGetDB ( DB_SLAVE ); |
37 | 37 | |
38 | 38 | // Get the messages from the database |
39 | | - $res = $dbr->select( 'localisation', |
| 39 | + $res = $dbr->select( self::table( 'localisation' ), |
40 | 40 | array( 'lo_key', 'lo_value' ), |
41 | 41 | array( 'lo_language' => $langcode ), |
42 | 42 | __METHOD__ ); |
— | — | @@ -279,7 +279,7 @@ |
280 | 280 | // Add the messages we got with our previous update(s) to the local array (as we already got these as well) |
281 | 281 | $fields = array( 'lo_key', 'lo_value' ); |
282 | 282 | $conds = array( 'lo_language' => $langcode ); |
283 | | - $result = $db->select( 'localisation', $fields, $conds, __METHOD__ ); |
| 283 | + $result = $db->select( self::table( 'localisation' ), $fields, $conds, __METHOD__ ); |
284 | 284 | foreach ( $result as $r ) { |
285 | 285 | $compare_messages[$r->lo_key] = $r->lo_value; |
286 | 286 | } |
— | — | @@ -316,7 +316,7 @@ |
317 | 317 | $db = wfGetDB( DB_MASTER ); |
318 | 318 | |
319 | 319 | $hashConds = array( 'lfh_file' => $file, 'lfh_hash' => $hash ); |
320 | | - $result = $db->select( 'localisation_file_hash', '*', $hashConds, __METHOD__ ); |
| 320 | + $result = $db->select( self::table( 'localisation_file_hash' ), '*', $hashConds, __METHOD__ ); |
321 | 321 | if ( $db->numRows( $result ) == 0 ) { |
322 | 322 | return true; |
323 | 323 | } else { |
— | — | @@ -329,7 +329,7 @@ |
330 | 330 | // Double query sucks but we wanna make sure we don't update |
331 | 331 | // the timestamp when the hash hasn't changed |
332 | 332 | if ( self::checkHash( $file, $hash ) ) |
333 | | - $db->replace( 'localisation_file_hash', array( 'lfh_file' ), array( |
| 333 | + $db->replace( self::table( 'localisation_file_hash' ), array( 'lfh_file' ), array( |
334 | 334 | 'lfh_file' => $file, |
335 | 335 | 'lfh_hash' => $hash, |
336 | 336 | 'lfh_timestamp' => $db->timestamp( wfTimestamp() ) |
— | — | @@ -358,7 +358,7 @@ |
359 | 359 | 'lo_language' => $langcode, |
360 | 360 | 'lo_key' => $key |
361 | 361 | ); |
362 | | - $db->replace( 'localisation', |
| 362 | + $db->replace( self::table( 'localisation' ), |
363 | 363 | array( 'PRIMARY' ), $values, |
364 | 364 | __METHOD__ ); |
365 | 365 | |
— | — | @@ -479,7 +479,7 @@ |
480 | 480 | // Add the already known messages to the array so we will only find new changes |
481 | 481 | $fields = array( 'lo_key', 'lo_value' ); |
482 | 482 | $conds = array( 'lo_language' => $language ); |
483 | | - $result = $db->select( 'localisation', $fields, $conds, __METHOD__ ); |
| 483 | + $result = $db->select( self::table( 'localisation' ), $fields, $conds, __METHOD__ ); |
484 | 484 | foreach ( $result as $r ) { |
485 | 485 | $compare_messages[$r->lo_key] = $r->lo_value; |
486 | 486 | } |
— | — | @@ -544,6 +544,15 @@ |
545 | 545 | return false; |
546 | 546 | } |
547 | 547 | } |
| 548 | + |
| 549 | + public static function table( $table ) { |
| 550 | + global $wgLocalisationUpdateDatabase; |
| 551 | + if( $wgLocalisationUpdateDatabase ) { |
| 552 | + return "$wgLocalisationUpdateDatabase.$table"; |
| 553 | + } else { |
| 554 | + return $table; |
| 555 | + } |
| 556 | + } |
548 | 557 | } |
549 | 558 | |
550 | 559 | class LUDependency extends CacheDependency { |
— | — | @@ -561,7 +570,9 @@ |
562 | 571 | function getTimestamp() { |
563 | 572 | $dbr = wfGetDB( DB_SLAVE ); |
564 | 573 | return $dbr->selectField( |
565 | | - 'localisation_file_hash', 'MAX(lfh_timestamp)', '', |
| 574 | + LocalisationUpdate::table( 'localisation_file_hash' ), |
| 575 | + 'MAX(lfh_timestamp)', |
| 576 | + '', |
566 | 577 | __METHOD__ ); |
567 | 578 | } |
568 | 579 | |
Property changes on: branches/wmf-deployment/extensions/LocalisationUpdate |
___________________________________________________________________ |
Name: svn:mergeinfo |
569 | 580 | - /trunk/extensions/LocalisationUpdate:56207,56209,56296,56333,56355 |
/trunk/phase3/extensions/LocalisationUpdate:55198,56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350 |
570 | 581 | + /trunk/extensions/LocalisationUpdate:56151-56784 |
/trunk/phase3/extensions/LocalisationUpdate:55198,56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350 |