Index: trunk/tools/ToolserverI18N/TsIntuition.php |
— | — | @@ -29,15 +29,7 @@ |
30 | 30 | |
31 | 31 | private $localBaseDir = __DIR__; // to be moved to p_i18n |
32 | 32 | |
33 | | - private static $registeredTextdomains = array( |
34 | | - 'General' => 'General.i18n.php', |
35 | | - 'Getwikiapi' => 'Getwikiapi.i18n.php', |
36 | | - 'Jarry' => 'Jarry.i18n.php', |
37 | | - 'Monumentsapi' => 'Monumentsapi.i18n.php', |
38 | | - 'Orphantalk2' => 'Orphantalk2.i18n.php', |
39 | | - 'Svgtranslate' => 'Svgtranslate.i18n.php', |
40 | | - 'Tsintuition' => 'Tsintuition.i18n.php', |
41 | | - ); |
| 33 | + private $registeredTextdomains = null; |
42 | 34 | |
43 | 35 | private $suppresserrors = false; |
44 | 36 | private $suppressnotices = true; |
— | — | @@ -110,6 +102,8 @@ |
111 | 103 | if ( is_string( $options) ) { |
112 | 104 | $options = array( 'domain' => $options ); |
113 | 105 | } |
| 106 | + |
| 107 | + $this->loadDomains(); |
114 | 108 | |
115 | 109 | // Allow a tool to suppress errors, which will prevent TsIntuition from showing fatal errors |
116 | 110 | if ( isset( $options['suppresserrors'] ) && $options['suppresserrors'] == true ) { |
— | — | @@ -232,7 +226,7 @@ |
233 | 227 | * @return array |
234 | 228 | */ |
235 | 229 | public function getAllRegisteredDomains(){ |
236 | | - return self::$registeredTextdomains; |
| 230 | + return $this->registeredTextdomains; |
237 | 231 | } |
238 | 232 | |
239 | 233 | /** |
— | — | @@ -584,12 +578,12 @@ |
585 | 579 | $domain = ucfirst( strtolower( $domain ) ); |
586 | 580 | |
587 | 581 | // Don't load if already loaded or unregistered |
588 | | - if ( isset( $this->loadedTextdomains[$domain] ) || !isset( self::$registeredTextdomains[$domain] ) ) { |
| 582 | + if ( isset( $this->loadedTextdomains[$domain] ) || !isset( $this->registeredTextdomains[$domain] ) ) { |
589 | 583 | return false; |
590 | 584 | } |
591 | 585 | |
592 | 586 | // File exists ? |
593 | | - $path = $this->localBaseDir . "/language/messages/" . self::$registeredTextdomains[$domain]; |
| 587 | + $path = $this->localBaseDir . "/language/messages/" . $this->registeredTextdomains[$domain]; |
594 | 588 | if ( !file_exists( $path ) ) { |
595 | 589 | $this->errTrigger( "Textdomain file not found for \"$domain\" at $path. Ignoring", |
596 | 590 | __METHOD__, E_NOTICE, __FILE__, __LINE__ ); |
— | — | @@ -795,6 +789,35 @@ |
796 | 790 | |
797 | 791 | |
798 | 792 | /** |
| 793 | + * Load domains |
| 794 | + * |
| 795 | + * @private |
| 796 | + * |
| 797 | + * @return true |
| 798 | + */ |
| 799 | + private function loadDomains(){ |
| 800 | + |
| 801 | + // Don't load twice |
| 802 | + if ( is_array( $this->registeredTextdomains ) ) { |
| 803 | + return false; |
| 804 | + } |
| 805 | + |
| 806 | + $path = $this->localBaseDir . '/language/Domains.php'; |
| 807 | + if ( !file_exists( $path ) ) { |
| 808 | + $this->errTrigger( 'Domains.php is missing', __METHOD__, E_NOTICE, __FILE__, __LINE__ ); |
| 809 | + return false; |
| 810 | + } |
| 811 | + |
| 812 | + // Load it |
| 813 | + $domains = array(); |
| 814 | + include( $path ); |
| 815 | + $this->registeredTextdomains = $domains; |
| 816 | + |
| 817 | + return true; |
| 818 | + } |
| 819 | + |
| 820 | + |
| 821 | + /** |
799 | 822 | * Load fallbacks |
800 | 823 | * |
801 | 824 | * @private |
Index: trunk/tools/ToolserverI18N/ToolStart.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | */ |
13 | 13 | |
14 | 14 | // This is a valid entry, define true |
15 | | -define( 'TS_INTUITION', true ); |
| 15 | +define( 'TS_INTUITION', __DIR__ ); |
16 | 16 | |
17 | 17 | // Files |
18 | 18 | require_once( __DIR__ . '/TsIntuitionUtil.php' ); |
Index: trunk/tools/ToolserverI18N/language/Domains.php |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +<?php |
| 3 | +$domains = array( |
| 4 | + 'General' => 'General.i18n.php', |
| 5 | + 'Getwikiapi' => 'Getwikiapi.i18n.php', |
| 6 | + 'Jarry' => 'Jarry.i18n.php', |
| 7 | + 'Monumentsapi' => 'Monumentsapi.i18n.php', |
| 8 | + 'Orphantalk2' => 'Orphantalk2.i18n.php', |
| 9 | + 'Recentanonymousactivity' => 'Recentanonymousactivity.i18n.php', |
| 10 | + 'Svgtranslate' => 'Svgtranslate.i18n.php', |
| 11 | + 'Tsintuition' => 'Tsintuition.i18n.php', |
| 12 | +); |
\ No newline at end of file |
Property changes on: trunk/tools/ToolserverI18N/language/Domains.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 13 | + native |
Index: trunk/tools/ToolserverI18N/language/messages/Getwikiapi.i18n.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Interface messages for tool "getWikiAPI". |
| 4 | + * Interface messages for tool "Get Wiki API". |
5 | 5 | * |
6 | 6 | * @toolowner krinkle |
7 | 7 | */ |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | * @author Krinkle |
15 | 15 | */ |
16 | 16 | $messages['en'] = array( |
17 | | - 'title' => 'getWikiAPI', // Do not translate |
| 17 | + 'title' => 'Get Wiki API', // Ignore, do not translate |
18 | 18 | 'formats-heading' => 'Output formats', |
19 | 19 | 'input' => 'Input', |
20 | 20 | 'label-wikiids' => 'Wiki identifiers', |
Index: trunk/tools/ToolserverI18N/language/messages/Svgtranslate.i18n.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | * @author Jarry |
15 | 15 | */ |
16 | 16 | $messages['en'] = array( |
17 | | - 'title' => 'SVG Translate', // Do not translate |
| 17 | + 'title' => 'SVG Translate', // Optional |
18 | 18 | 'error-tryagain' => '$1 Hit your browser\'s back button to retry.', |
19 | 19 | 'error-nothing' => 'Nothing to translate.', |
20 | 20 | 'error-notsvg' => 'Not an SVG file.', |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | * @author Jarry |
41 | 41 | */ |
42 | 42 | $messages['qqq'] = array( |
43 | | - 'title' => "{{Notranslate}}\n\nThe title of the tool.", |
| 43 | + 'title' => "The title of the tool.", |
44 | 44 | 'begin-translation' => 'This is the opening heading on the home page of the tool.', |
45 | 45 | 'th-original' => 'Heading of the "Original"-column.', |
46 | 46 | 'th-translation' => 'Heading of the "Translation"-column.', |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | * @author Gerard Meijssen |
61 | 61 | */ |
62 | 62 | $messages['nl'] = array( |
| 63 | + 'title' => 'SVG Vertaling', |
63 | 64 | 'begin-translation' => 'Start de vertaling', |
64 | 65 | 'th-original' => 'Origineel', |
65 | 66 | 'th-translation' => 'Vertaling', |
Index: trunk/tools/ToolserverI18N/language/messages/Orphantalk2.i18n.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | * @author Krinkle |
15 | 15 | */ |
16 | 16 | $messages['en'] = array( |
17 | | - 'title' => 'OrphanTalk2', // ignore |
| 17 | + 'title' => 'OrphanTalk2', // optional |
18 | 18 | 'settings-legend' => 'Settings', |
19 | 19 | 'label-wiki' => 'Wiki', // optional |
20 | 20 | 'select-wiki-first' => '(select a wiki first)', |
— | — | @@ -38,6 +38,7 @@ |
39 | 39 | * @author Krinkle |
40 | 40 | */ |
41 | 41 | $messages['qqq'] = array( |
| 42 | + 'title' => 'The title of the tool. Note that this is a sequel of an old tool by the same name. "2" is part of the name.', |
42 | 43 | 'settings-legend' => 'This is the title for the settings box in the input form.', |
43 | 44 | 'label-wiki' => 'Label in the input form indicating which wiki searched.', |
44 | 45 | 'update' => 'Clicking this button will update the form to adapt to the new settings. {{Identical|Update}}', |
— | — | @@ -56,6 +57,7 @@ |
57 | 58 | * @author Krinkle |
58 | 59 | */ |
59 | 60 | $messages['nl'] = array( |
| 61 | + 'title' => 'WeesOverleg2', |
60 | 62 | 'settings-legend' => 'Instellingen', |
61 | 63 | 'output' => 'Uitvoer', |
62 | 64 | 'update' => 'Bijwerken', |
Index: trunk/tools/ToolserverI18N/language/messages/Recentanonymousactivity.i18n.php |
— | — | @@ -0,0 +1,35 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Interface messages for tool "Recent Anonymous Activity". |
| 5 | + * |
| 6 | + * @toolowner krinkle |
| 7 | + */ |
| 8 | + |
| 9 | +$url = '~krinkle/recentAnonymousActivity/'; |
| 10 | + |
| 11 | +/** |
| 12 | + * English |
| 13 | + * |
| 14 | + * @author Krinkle |
| 15 | + */ |
| 16 | +$messages['en'] = array( |
| 17 | + 'title' => 'Recent Anonymous Activity', |
| 18 | +); |
| 19 | + |
| 20 | +/** |
| 21 | + * Documentation |
| 22 | + * |
| 23 | + * @author Krinkle |
| 24 | + */ |
| 25 | +$messages['qqq'] = array( |
| 26 | + 'title' => 'This is the title of the tool.', |
| 27 | +); |
| 28 | + |
| 29 | +/** |
| 30 | + * Nederlands |
| 31 | + * |
| 32 | + * @author Krinkle |
| 33 | + */ |
| 34 | +$messages['nl'] = array( |
| 35 | + 'title' => 'Recente activiteit van anonieme gebruikers', |
| 36 | +); |
\ No newline at end of file |
Property changes on: trunk/tools/ToolserverI18N/language/messages/Recentanonymousactivity.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 37 | + native |
Index: trunk/tools/ToolserverI18N/language/messages/Jarry.i18n.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | * @author Jarry |
15 | 15 | */ |
16 | 16 | $messages['en'] = array( |
17 | | - 'title' => 'JARRY1250\'S TOOLSERVER TOOLS', // Do not translate |
| 17 | + 'title' => 'Jarry1250\'s Toolserver Tools', // Ignore, do not translate |
18 | 18 | ); |
19 | 19 | |
20 | 20 | /** |
— | — | @@ -22,13 +22,5 @@ |
23 | 23 | * @author Krinkle |
24 | 24 | */ |
25 | 25 | $messages['qqq'] = array( |
26 | | - 'title' => 'The title. This message should not be translated in other languages.', |
27 | | -); |
28 | | - |
29 | | -/** |
30 | | - * Nederlands |
31 | | - * |
32 | | - * @author Krinkle |
33 | | - */ |
34 | | -$messages['nl'] = array( |
35 | | -); |
| 26 | + 'title' => 'The head line of Jarry tools. {{Notranslate}}', |
| 27 | +); |
\ No newline at end of file |