Bahaipedia
Bahaipedia
Menu
About Bahaipedia
Ask a question
General help
Random page
Recent changes
In other projects
Tools
What links here
Related changes
Upload file
Special pages
Printable version
Permanent link
Page information
Message
Discussion
View source
View history
Talk
Contributions
Create account
Log in
Navigation
About Bahaipedia
Ask a question
General help
Random page
Recent changes
In other projects
Learn more
Core topics
Bahá’í Faith
Central Figures
Teachings
Practices
Tools
What links here
Related changes
Upload file
Special pages
Printable version
Permanent link
Page information
Translations

MediaWiki:ImageAnnotatorTranslator.js

From Bahaipedia
Jump to:navigation, search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/**** Intended to pre-fill a "edit new section" form for the translation pleas generated by
      MediaWiki:Gadget-ImageAnnotator.js */

$(document).ready(function ()
{
  try {
    if (mw.config.get('wgPageName') == 'MediaWiki_talk:ImageAnnotatorTexts') {
      var language = getParamValue ('language');
      var msg_id   = getParamValue ('iamsg');
      var summary  = document.editform.wpSummary;
      if (summary && language)
        summary.value = 'Translations for language code ' + language + ', by \[\[User:'
                        + mw.config.get('wgUserName') + '\]\]';
      var editbox = document.editform.wpTextbox1;
      if (editbox) {
        var file = 'MediaWiki:ImageAnnotatorUITexts';
        editbox.value =
            'Thank you, [[User:' + mw.config.get('wgUserName') 
          + ']], for volunteering to translate the interface of the '
          + '[[Help:Gadget-ImageAnnotator|ImageAnnotator]] gadget. Just add your translations '
          + 'in the edit box below.\n\n'
          + '\<div style="font-size:smaller;"\>'
          + (msg_id ? '\<\!\--' + msg_id + '--\>' : "")
          + '\{\{'
          + file
          + '\}\}\<\/div\>\n\n'
          + 'Above, you will see a list of all the interface texts this gadget uses. '
          + 'The first five (up to "MediaWiki:ImageAnnotatorRevertButtonLabel") are optional. They '
          + 'use a default value from other system messages. You need to provide translations for '
          + 'these five only if the default was inappropriate.\n\n'
          + 'Please add your translations in the edit box below.\n\n'
          + '(If you do not see any English texts above the edit form, click "preview"!)\n\n'
          + 'The texts in your language are currently set as follows:\n\n'
          + '\<div style="font-size:smaller;"\>\{\{' + file + '|lang=' + language + '\}\}\</div\>\n'
          + '=== New translations by \[\[User:' + mw.config.get('wgUserName') + '\]\] ===\n\n'
          + '\<\!-- Add your translations here --\>'          
          ;
        var preview = document.getElementById ('wpPreview');
        if (preview) {
          var to_hide = document.getElementById ('bodyContent')
                     || document.getElementById ('mw_contentholder')
                     || document.forms[0];
          if (to_hide) to_hide.style.display = 'none';
          preview.click ();
        } else
          editbox.value = editbox.value
            + '\nClick preview to see the English texts!\n\n';
      }
    }
  } catch (e) {
    // Swallow
  }
});
Retrieved from "https://bahaipedia.org/index.php?title=MediaWiki:ImageAnnotatorTranslator.js&oldid=106830"
This page was last edited on 15 May 2022, at 05:05.
Text is available under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
Privacy policy
About Bahaipedia
Disclaimers
Powered by MediaWiki