Index: trunk/tools/ToolserverI18N/TsIntuition.php |
— | — | @@ -645,11 +645,9 @@ |
646 | 646 | * Load a textdomain (if not loaded already). |
647 | 647 | * |
648 | 648 | * @param $domain string Name of the textdomain (case-insensitive) |
649 | | - * @param $msgAction string What to do with the messages from the text domain |
650 | | - * one of 'register', 'ignore'. |
651 | 649 | * @return False on error, (normalized) domainname if success. |
652 | 650 | */ |
653 | | - public function loadTextdomain( $domain, $msgAction = 'register' ) { |
| 651 | + public function loadTextdomain( $domain ) { |
654 | 652 | |
655 | 653 | // Generally validate input and protect against path traversal |
656 | 654 | if ( !TsIntuitionUtil::nonEmptyStr( $domain ) || strcspn( $domain, ":/\\\000" ) !== strlen( $domain ) ) { |
— | — | @@ -678,7 +676,7 @@ |
679 | 677 | } |
680 | 678 | |
681 | 679 | // Load it |
682 | | - $load = $this->loadTextdomainFromFile( $path, $domain, $msgAction ); |
| 680 | + $load = $this->loadTextdomainFromFile( $path, $domain ); |
683 | 681 | |
684 | 682 | // Return (normalized) domainname or false |
685 | 683 | return !!$load ? $domain : false; |
— | — | @@ -688,7 +686,7 @@ |
689 | 687 | /** |
690 | 688 | * @DOCME: |
691 | 689 | */ |
692 | | - public function loadTextdomainFromFile( $filePath = '', $domain = '', $msgAction = 'register' ) { |
| 690 | + public function loadTextdomainFromFile( $filePath = '', $domain = '' ) { |
693 | 691 | if ( !TsIntuitionUtil::nonEmptyStrs( $filePath, $domain ) ) { |
694 | 692 | $this->errTrigger( 'One or more arguments are missing', __METHOD__, E_NOTICE, __FILE__, __LINE__ ); |
695 | 693 | return false; |
— | — | @@ -704,14 +702,14 @@ |
705 | 703 | |
706 | 704 | // Parse it |
707 | 705 | $compact = compact( $this->includeVariables ); |
708 | | - $this->parseTextdomain( $compact, $domain, $filePath, $msgAction ); |
| 706 | + $this->parseTextdomain( $compact, $domain, $filePath ); |
709 | 707 | return true; |
710 | 708 | } |
711 | 709 | |
712 | 710 | /** |
713 | 711 | * @DOCME: |
714 | 712 | */ |
715 | | - private function parseTextdomain( $data, $domain, $filePath, $msgAction ) { |
| 713 | + private function parseTextdomain( $data, $domain, $filePath ) { |
716 | 714 | if ( !is_array( $data ) ) { |
717 | 715 | $this->errTrigger( 'Invalid $data passed to ' . __FUNCTION__, |
718 | 716 | __METHOD__, E_ERROR, __FILE__, __LINE__ ); |
— | — | @@ -723,19 +721,13 @@ |
724 | 722 | } |
725 | 723 | unset( $data['messages']['qqq'] ); // Workaround |
726 | 724 | |
727 | | - if ( $msgAction === 'register' ) { |
728 | | - // Load the message into the blob |
729 | | - // overwrites the existing array of messages if it already existed |
730 | | - // If you need to add or overwrite some messages temporarily, |
731 | | - // use Itui::setMsg() or Itui::setMsgs() instead |
732 | | - foreach ( $data['messages'] as $langCode => $messages ) { |
733 | | - $this->availableLanguages[$langCode] = true; |
734 | | - $this->setMsgs( (array)$messages, $domain, $langCode ); |
735 | | - } |
736 | | - } else { |
737 | | - foreach ( array_keys( $data['messages'] ) as $langCode ) { |
738 | | - $this->availableLanguages[$langCode] = true; |
739 | | - } |
| 725 | + // Load the message into the blob |
| 726 | + // overwrites the existing array of messages if it already existed |
| 727 | + // If you need to add or overwrite some messages temporarily, |
| 728 | + // use Itui::setMsg() or Itui::setMsgs() instead |
| 729 | + foreach ( $data['messages'] as $langcode => $messages ) { |
| 730 | + $this->availableLanguages[$langcode] = true; |
| 731 | + $this->setMsgs( (array)$messages, $domain, $langcode ); |
740 | 732 | } |
741 | 733 | |
742 | 734 | // Was there a url defined in the textdomain file ? |
Index: trunk/tools/ToolserverI18N/public_html/index.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | // Load all domains so we can get some statistics later on and |
38 | 38 | // make sure "getAvailableLangs" is complete |
39 | 39 | foreach ( $I18N->getAllRegisteredDomains() as $domainKey => $domainInfo ) { |
40 | | - $I18N->loadTextdomain( $domainKey, 'ignore' ); |
| 40 | + $I18N->loadTextdomain( $domainKey ); |
41 | 41 | } |
42 | 42 | |
43 | 43 | /* Initialize BaseTool */ |