Index: trunk/extensions/TranslateSvg/TranslateSvg.i18n.php |
— | — | @@ -1,21 +1,33 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | $messages = array(); |
| 4 | + |
5 | 5 | $messages['en'] = array( |
6 | | - 'translatesvg' => 'TranslateSVG', |
7 | | - 'translatesvg-desc' => 'A MediaWiki extension that creates a Special page to provide a native-style interface for translating SVGs in line with the SVG1.1 specification.',# Special:translatesvg |
| 6 | + 'translatesvg' => 'TranslateSVG', //Ignore |
| 7 | + 'translatesvg-desc' => 'A MediaWiki extension that creates a Special page to provide a native-style interface for translating SVGs in line with the SVG1.1 specification.', |
8 | 8 | 'translatesvg-legend' => 'File path', |
9 | 9 | 'translatesvg-page' => 'File:', |
10 | 10 | 'translatesvg-submit' => 'Go', |
11 | 11 | 'translatesvg-summary' => 'This special page allows you to add, remove and modify translations embedded within a given SVG image file.', |
12 | | - 'translatesvg-add' => 'If your language is not listed already, you can ', |
13 | | - 'translatesvg-addlink' => 'add it.', |
| 12 | + 'translatesvg-add' => 'If your language is not listed already, you can [[#addlanguage|add it]].', |
14 | 13 | 'translatesvg-xcoordinate-pre' => 'X-coordinate (horizontal): ', |
15 | | - //'translatesvg-xcoordinate-post' => '', |
16 | 14 | 'translatesvg-ycoordinate-pre' => 'Y-coordinate (vertical): ', |
17 | | - //'translatesvg-ycoordinate-post' => '' |
18 | 15 | 'translatesvg-specify' => 'Specify new language code (e.g. en, fr, de, es...)', |
19 | 16 | 'translatesvg-fallbackdesc' => 'Default (no language specified)', |
20 | 17 | 'translatesvg-qqqdesc' => 'Advice to translators', |
21 | 18 | 'translatesvg-nodesc' => '(no description)', |
| 19 | + ); |
| 20 | + |
| 21 | + $messages['qqq'] = array( |
| 22 | + 'translatesvg-desc' => 'General purpose short description of the extension', |
| 23 | + 'translatesvg-legend' => 'Form legend; general description of the purposes of the form (to ask for a file path)', |
| 24 | + 'translatesvg-page' => 'Label for a form input', |
| 25 | + 'translatesvg-submit' => 'Text of a button to progress onto next stage of the translation', |
| 26 | + 'translatesvg-summary' => 'General description of the special page, displayed at the top of it so users know what they are looking at', |
| 27 | + 'translatesvg-add' => 'Introduction sentence available to JavaScript-enabled users including a link to add translations in a new language. The anchor (#addlanguage) does not need translation.', |
| 28 | + 'translatesvg-xcoordinate-pre' => 'Label for a form input for the adjustment of the X-coordinate (horizontal position) of the text being translated', |
| 29 | + 'translatesvg-ycoordinate-pre' => 'Label for a form input for the adjustment of the Y-coordinate (vertical position) of the text being translated', |
| 30 | + 'translatesvg-specify' => 'Prompt asking for the two or three letter code (or similar) of the language they wish to translate into', |
| 31 | + 'translatesvg-fallbackdesc' => 'The heading of the section that contains translations representing the fallback (default) language. The fallback language is used when translations aren\'t available. Comparable to other language headings such as "English", "Deutsch", etc.', |
| 32 | + 'translatesvg-qqqdesc' => 'The heading of the section that contains descriptions of the context of each translation (i.e. translations into the language with code "qqq"). Comparable to other language headings such as "English", "Deutsch", etc.', |
| 33 | + 'translatesvg-nodesc' => 'The text that appears next to a translation when no description (translation into language qqq) exists.', |
22 | 34 | ); |
\ No newline at end of file |
Index: trunk/extensions/TranslateSvg/TranslateSvg.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | $dir = dirname( __FILE__ ) . '/'; |
23 | 23 | $wgAutoloadClasses['SpecialTranslateSvg'] = $dir . 'SpecialTranslateSvg.php'; |
24 | 24 | $wgExtensionMessagesFiles['TranslateSvg'] = $dir . 'TranslateSvg.i18n.php'; |
25 | | -$wgExtensionAliasesFiles['TranslateSvg'] = $dir . 'TranslateSvg.alias.php'; |
| 25 | +$wgExtensionMessagesFiles['TranslateSvg-alias'] = $dir . 'TranslateSvg.alias.php'; |
26 | 26 | $wgSpecialPages['TranslateSvg'] = 'SpecialTranslateSvg'; # Tell MediaWiki about the new special page and its class name |
27 | 27 | $wgSpecialPageGroups['TranslateSvg'] = 'media'; |
28 | 28 | |
Index: trunk/extensions/TranslateSvg/ext.translateSvg.core.js |
— | — | @@ -1,5 +1,10 @@ |
2 | | -var link = $('<a id="newtrans" href="#"></a>') |
3 | | - .text( mw.msg('translatesvg-addlink') ) |
| 2 | +var paragraph = $('<p></p>').text( mw.msg('translatesvg-add') ); |
| 3 | +var match = paragraph.html().match( /\[\[#addlanguage\|(.*?)\]\]/ ); |
| 4 | +addtext = paragraph.html().replace( /\[\[#addlanguage\|.*?\]\]/, '<a id="newtrans" href="#"></a>' ); |
| 5 | +paragraph.html( addtext ); |
| 6 | +$('form#specialtranslatesvg').prepend(paragraph); |
| 7 | +$('#newtrans') |
| 8 | + .text( match[1] ) |
4 | 9 | .click(function() { |
5 | 10 | var langcode = prompt( mw.msg('translatesvg-specify') ); |
6 | 11 | if( langcode !== null ){ |
— | — | @@ -19,9 +24,6 @@ |
20 | 25 | } |
21 | 26 | return false; |
22 | 27 | }); //TODO: validate input |
23 | | -var paragraph = $('<p></p>').text( mw.msg('translatesvg-add')) |
24 | | - .append( link ); |
25 | | -$('form#specialtranslatesvg').prepend(paragraph); |
26 | 28 | |
27 | 29 | function getExisting( fallback ){ |
28 | 30 | //No need to check for an existing translation since we're creating a new language box |