Index: trunk/tools/ToolserverI18N/TsIntuition.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | private $paramNames = array( 'userlang' => 'userlang' ); |
58 | 58 | |
59 | 59 | // Here everything will be stored as arrays in arrays |
60 | | - // Such as: $messageBlob['Textdomain']['messagename']['langcode'] = 'Message string'; |
| 60 | + // Such as: $messageBlob['Textdomain']['langcode']['messagename'] = 'Message string'; |
61 | 61 | private $messageBlob = array(); |
62 | 62 | |
63 | 63 | // All loaded text domains and (if available) their information (such as url) in an array |
— | — | @@ -512,7 +512,11 @@ |
513 | 513 | } |
514 | 514 | } |
515 | 515 | |
| 516 | + public function listMsgs( $domain ) { |
| 517 | + return array_keys( $this->messageBlob[$domain]['en'] ); |
| 518 | + } |
516 | 519 | |
| 520 | + |
517 | 521 | /* Lang functions |
518 | 522 | * ------------------------------------------------- */ |
519 | 523 | |
— | — | @@ -599,6 +603,7 @@ |
600 | 604 | * Load a textdomain (if not loaded already). |
601 | 605 | * |
602 | 606 | * @param $domain string Name of the textdomain (case-insensitive) |
| 607 | + * @return False on error, (normalized) domainname if success. |
603 | 608 | */ |
604 | 609 | public function loadTextdomain( $domain ) { |
605 | 610 | |
— | — | @@ -610,8 +615,13 @@ |
611 | 616 | // Sanatize domainnames (case-insensitive) |
612 | 617 | $domain = ucfirst( strtolower( $domain ) ); |
613 | 618 | |
614 | | - // Don't load if already loaded or unregistered |
615 | | - if ( isset( $this->loadedTextdomains[$domain] ) || !isset( $this->registeredTextdomains[$domain] ) ) { |
| 619 | + // Don't load if already loaded |
| 620 | + if ( isset( $this->loadedTextdomains[$domain] ) ) { |
| 621 | + return $domain; |
| 622 | + } |
| 623 | + |
| 624 | + // Error out if unregistered |
| 625 | + if ( !isset( $this->registeredTextdomains[$domain] ) ) { |
616 | 626 | return false; |
617 | 627 | } |
618 | 628 | |
— | — | @@ -626,7 +636,8 @@ |
627 | 637 | // Load it |
628 | 638 | $load = $this->loadTextdomainFromFile( $path, $domain ); |
629 | 639 | |
630 | | - return !!$load; |
| 640 | + // Return (normalized) domainname or false |
| 641 | + return !!$load ? $domain : false; |
631 | 642 | |
632 | 643 | } |
633 | 644 | |
Index: trunk/tools/ToolserverI18N/ToolStart.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | * This file loads everything the individual tools need. |
12 | 12 | */ |
13 | 13 | |
14 | | -// This is a valid entry, define true |
| 14 | +// This is a valid entry, define |
15 | 15 | define( 'TS_INTUITION', __DIR__ ); |
16 | 16 | |
17 | 17 | // Local override |