From 98ffd2baf716f17aa187528e3721dc83e0972717 Mon Sep 17 00:00:00 2001 From: Siddhartha-Ghai Date: Mon, 22 Oct 2012 21:08:25 +0530 Subject: [PATCH] Fix and localize Unlink unlink: translate UI morebits: fix functions needed by unlink, localize namespace names shared, config: UI translation --- modules/friendlyshared.js | 54 +++++++-------- modules/twinkleconfig.js | 137 +++++++++++++++++++------------------- modules/twinkleunlink.js | 40 +++++------ morebits.js | 125 ++++++++++++++++++++-------------- 4 files changed, 188 insertions(+), 168 deletions(-) diff --git a/modules/friendlyshared.js b/modules/friendlyshared.js index 73e5ecdb2..6e7adb23a 100644 --- a/modules/friendlyshared.js +++ b/modules/friendlyshared.js @@ -10,20 +10,20 @@ Twinkle.shared = function friendlyshared() { if( mw.config.get('wgNamespaceNumber') === 3 && Morebits.isIPAddress(mw.config.get('wgTitle')) ) { var username = mw.config.get('wgTitle').split( '/' )[0].replace( /\"/, "\\\""); // only first part before any slashes - twAddPortletLink( function(){ Twinkle.shared.callback(username); }, "Shared IP", "friendly-shared", "Shared IP tagging" ); + twAddPortletLink( function(){ Twinkle.shared.callback(username); }, "साझा आइ॰पी॰", "friendly-shared", "साझा आइ॰पी॰ पता टैगिंग" ); } }; Twinkle.shared.callback = function friendlysharedCallback( uid ) { var Window = new Morebits.simpleWindow( 600, 400 ); - Window.setTitle( "साझा आई॰पी॰ पता टैगिंग" ); + Window.setTitle( "साझा आइ॰पी॰ पता टैगिंग" ); Window.setScriptName( "Twinkle" ); Window.addFooterLink( "Twinkle help", "WP:TW/DOC#shared" ); var form = new Morebits.quickForm( Twinkle.shared.callback.evaluate ); var div = form.append( { type: 'div', id: 'sharedip-templatelist' } ); - div.append( { type: 'header', label:'साझा आई॰पी॰ पता साँचे' } ); + div.append( { type: 'header', label:'साझा आइ॰पी॰ पता साँचे' } ); div.append( { type: 'radio', name: 'shared', list: Twinkle.shared.standardList, event: function( e ) { Twinkle.shared.callback.change_shared( e ); @@ -31,7 +31,7 @@ Twinkle.shared.callback = function friendlysharedCallback( uid ) { } } ); - var org = form.append( { type:'field', label:'नीचे आई॰पी॰ पते के स्वामी/संचालक का नाम, होस्ट-नाम तथा संपर्क-सूचना (यदि लागू हो तो) भरें, और \"Submit\" बटन पर क्लिक करें।' } ); + var org = form.append( { type:'field', label:'नीचे आइ॰पी॰ पते के स्वामी/संचालक का नाम, होस्ट-नाम तथा संपर्क-सूचना (यदि लागू हो तो) भरें, और \"Submit\" बटन पर क्लिक करें।' } ); org.append( { type: 'input', name: 'organization', @@ -68,44 +68,40 @@ Twinkle.shared.callback = function friendlysharedCallback( uid ) { Twinkle.shared.standardList = [ { - label: '{{shared IP}}: मानक साझा आई॰पी॰ साँचा', + label: '{{shared IP}}: मानक साझा आइ॰पी॰ साँचा', value: 'shared IP', - tooltip: 'आई॰पी॰ सदस्य वार्ता पृष्ठ पर प्रयोग हेतु साँचा। यह साँचा आई॰पी॰ सदस्य तथा उन लोगों को जो उसे चेतावनी देना चाहते हैं या प्रतिबन्धित करना चाहते हैं, को उपयोगी जानकारी उपलब्ध करता है।' + tooltip: 'आइ॰पी॰ सदस्य वार्ता पृष्ठ पर प्रयोग हेतु साँचा। यह साँचा आइ॰पी॰ सदस्य तथा उन लोगों को जो उसे चेतावनी देना चाहते हैं या प्रतिबन्धित करना चाहते हैं, को उपयोगी जानकारी उपलब्ध करता है।' }, { - label: '{{shared IP edu}}: शैक्षिक संस्थानों के लिए संशोधित साझा आई॰पी॰ साँचा', + label: '{{shared IP edu}}: शैक्षिक संस्थानों के लिए संशोधित साझा आइ॰पी॰ साँचा', value: 'shared IP edu' }, { - label: '{{shared IP public}}: सार्वजनिक टर्मिनलों के लिए संशोधित साझा आई॰पी॰ साँचा', + label: '{{shared IP public}}: सार्वजनिक टर्मिनलों के लिए संशोधित साझा आइ॰पी॰ साँचा', value: 'shared IP public' }, { - label: '{{shared IP gov}}: सरकारी सुविधाओं या एजेंसियों के लिए संशोधित साझा आई॰पी॰ साँचा', + label: '{{shared IP gov}}: सरकारी सुविधाओं या एजेंसियों के लिए संशोधित साझा आइ॰पी॰ साँचा', value: 'shared IP gov' }, { - label: '{{dynamicIP}}: अस्थिर पतों(dynamic IP) वाले संगठनो के लिए संशोधित साझा आई॰पी॰ साँचा', + label: '{{dynamicIP}}: अस्थिर पतों(dynamic IP) वाले संगठनो के लिए संशोधित साझा आइ॰पी॰ साँचा', value: 'dynamicIP' }, { - label: '{{ISP}}: इंटरनेट सेवा प्रदाता(ISP) संगठनों(खासकर प्रॉक्सीज़) के लिए संशोधित साझा आई॰पी॰ साँचा', + label: '{{ISP}}: इंटरनेट सेवा प्रदाता(ISP) संगठनों(खासकर प्रॉक्सीज़) के लिए संशोधित साझा आइ॰पी॰ साँचा', value: 'ISP' }, { - label: '{{mobileIP}}: मोबाइल फोन कंपनी और उनके ग्राहकों के लिए संशोधित साझा आई॰पी॰ साँचा', + label: '{{mobileIP}}: मोबाइल फोन कंपनी और उनके ग्राहकों के लिए संशोधित साझा आइ॰पी॰ साँचा', value: 'mobileIP' } ]; Twinkle.shared.callback.change_shared = function friendlysharedCallbackChangeShared(e) { - if( e.target.value === 'shared IP edu' ) { - e.target.form.contact.disabled = false; - } else { - e.target.form.contact.disabled = true; - } - e.target.form.organization.disabled=false; - e.target.form.host.disabled=false; + e.target.form.contact.disabled = ( e.target.value === 'shared IP edu' ) ? false : true; + e.target.form.organization.disabled = false; + e.target.form.host.disabled = false; }; Twinkle.shared.callbacks = { @@ -118,16 +114,12 @@ Twinkle.shared.callbacks = { for( var i=0; i < Twinkle.shared.standardList.length; i++ ) { var tagRe = new RegExp( '(\\{\\{' + Twinkle.shared.standardList[i].value + '(\\||\\}\\}))', 'im' ); if( tagRe.exec( pageText ) ) { - Morebits.status.warn( 'Info', 'Found {{' + Twinkle.shared.standardList[i].value + '}} on the user\'s talk page already...aborting' ); - found = true; + Morebits.status.warn( 'Info', 'सदस्य वार्ता पृष्ठ पर {{' + Twinkle.shared.standardList[i].value + '}} पाया गया। टैगिंग रद्द कर डी गयी है।' ); + return; } } - if( found ) { - return; - } - - Morebits.status.info( 'Info', 'Will add the shared IP address template to the top of the user\'s talk page.' ); + Morebits.status.info( 'Info', 'साझा आइ॰पी॰ पता साँचा सदस्य के वार्ता पृष्ठ में ऊपर-ऊपर जोड़ा जाएगा।' ); text += params.value + '|' + params.organization; if( params.value === 'shared IP edu' && params.contact !== '') { text += '|' + params.contact; @@ -137,7 +129,7 @@ Twinkle.shared.callbacks = { } text += '}}\n\n'; - var summaryText = 'Added {{[[Template:' + params.value + '|' + params.value + ']]}} template.'; + var summaryText = '{{[[सा:' + params.value + '|' + params.value + ']]}} साँचा जोड़ा।'; pageobj.setPageText(text + pageText); pageobj.setEditSummary(summaryText + Twinkle.getPref('summaryAd')); pageobj.setMinorEdit(Twinkle.getFriendlyPref('markSharedIPAsMinor')); @@ -149,14 +141,14 @@ Twinkle.shared.callbacks = { Twinkle.shared.callback.evaluate = function friendlysharedCallbackEvaluate(e) { var shared = e.target.getChecked( 'shared' ); if( !shared || shared.length <= 0 ) { - alert( 'You must select a shared IP address template to use!' ); + alert( 'आपको प्रयोग करने के लिए एक साझा आइ॰पी साँचा चुनना होगा।' ); return; } var value = shared[0]; if( e.target.organization.value === '') { - alert( 'You must input an organization for the {{' + value + '}} template!' ); + alert( 'आपको {{' + value + '}} साँचे के लिए संगठन का नाम देना होगा।' ); return; } @@ -171,9 +163,9 @@ Twinkle.shared.callback.evaluate = function friendlysharedCallbackEvaluate(e) { Morebits.status.init( e.target ); Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName'); - Morebits.wiki.actionCompleted.notice = "टैगिंग संपूर्ण, वार्ता पन्ना कुछ ही क्षणों में रीलोड होगा"; + Morebits.wiki.actionCompleted.notice = "टैगिंग सम्पूर्ण, वार्ता पन्ना कुछ ही क्षणों में रीलोड होगा"; - var wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "User talk page modification"); + var wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "सदस्य वार्ता पृष्ठ सम्पादन"); wikipedia_page.setFollowRedirect(true); wikipedia_page.setCallbackParameters(params); wikipedia_page.load(Twinkle.shared.callbacks.main); diff --git a/modules/twinkleconfig.js b/modules/twinkleconfig.js index b95b8fdd1..d4d861e9f 100644 --- a/modules/twinkleconfig.js +++ b/modules/twinkleconfig.js @@ -19,7 +19,7 @@ Twinkle.config = {}; Twinkle.config.commonEnums = { watchlist: { yes: "ध्यानसूची में जोड़ें", no: "ध्यानसूची में नहीं जोड़ें", "default": "आपकी वरीयताओं अनुसार चलें" }, - talkPageMode: { window: "In a window, replacing other user talks", tab: "In a new tab", blank: "In a totally new window" } + talkPageMode: { window: "एक नई विंडो में, पहले से खुले वार्ता पृष्ठ की जगह", tab: "एक नए टैब में", blank: "एक बिलकुल नई विंडो में" } }; Twinkle.config.commonSets = { @@ -102,14 +102,14 @@ Twinkle.config.commonSets = { Twinkle.config.sections = [ { - title: "General", + title: "सामान्य", preferences: [ // TwinkleConfig.summaryAd (string) // Text to be appended to the edit summary of edits made using Twinkle { name: "summaryAd", - label: "\"Ad\" to be appended to Twinkle's edit summaries", - helptip: "The summary ad should start with a space, and be kept short.", + label: "ट्विंकल के सम्पादन सारांश में जोड़ने हेतु \"ऐड\"", + helptip: "यह स्पेस से शुरू होना चाहिए, और छोटा होना चाहिए।", type: "string" }, @@ -117,8 +117,8 @@ Twinkle.config.sections = [ // Text to be appended to the edit summary of deletions made using Twinkle { name: "deletionSummaryAd", - label: "Summary ad to use for deletion summaries", - helptip: "Normally the same as the edit summary ad above.", + label: "पृष्ठ हटाते समय सम्पादन सारांश में जोड़ने हेतु \"ऐड\"", + helptip: "यह आम-तौर पर सामान्य ऐड ही रखी जाती है।", adminOnly: true, type: "string" }, @@ -127,8 +127,8 @@ Twinkle.config.sections = [ // Text to be appended to the edit summary of page protections made using Twinkle { name: "protectionSummaryAd", - label: "Summary ad to use for page protections", - helptip: "Normally the same as the edit summary ad above.", + label: "पृष्ठ सुरक्षित करते समय सम्पादन सारांश में जोड़ने हेतु \"ऐड\"", + helptip: "यह आम-तौर पर सामान्य ऐड ही रखी जाती है।", adminOnly: true, type: "string" }, @@ -139,7 +139,7 @@ Twinkle.config.sections = [ // 'blank': force open in a new window, even if such a window exists { name: "userTalkPageMode", - label: "When opening a user talk page, open it", + label: "वार्ता पृष्ठ खोलते समय उसे खोलें", type: "enum", enumValues: Twinkle.config.commonEnums.talkPageMode }, @@ -147,7 +147,7 @@ Twinkle.config.sections = [ // TwinkleConfig.dialogLargeFont (boolean) { name: "dialogLargeFont", - label: "Use larger text in Twinkle dialogs", + label: "ट्विंकल की विंडो में बड़े पाठ का प्रयोग करें", type: "boolean" } ] @@ -221,12 +221,12 @@ Twinkle.config.sections = [ }, { - title: "Shared IP tagging", + title: "साझा आइ॰पी॰ पता टैगिंग", inFriendlyConfig: true, preferences: [ { name: "markSharedIPAsMinor", - label: "Mark shared IP tagging as a minor edit", + label: "साझा आइ॰पी॰ पता टैगिंग को छोटा बदलाव चिन्हित करें", type: "boolean" } ] @@ -240,7 +240,7 @@ Twinkle.config.sections = [ // Whether to add speedy tagged pages to watchlist { name: "watchSpeedyPages", - label: "Add page to watchlist when tagging with these criteria", + label: "निम्न मापदंडों से नामांकन करते समय लेख को ध्यानसूची में डालें", type: "set", setValues: Twinkle.config.commonSets.csdCriteria, setDisplayOrder: Twinkle.config.commonSets.csdCriteriaDisplayOrder @@ -258,8 +258,8 @@ Twinkle.config.sections = [ // If, when applying speedy template to page, to mark the page as patrolled (if the page was reached from NewPages) { name: "markSpeedyPagesAsPatrolled", - label: "Mark page as patrolled when tagging (if possible)", - helptip: "Due to technical limitations, pages are only marked as patrolled when they are reached via Special:NewPages.", + label: "नामांकन करते समय लेख को जाँचा हुआ (patrolled) चिन्हित करें (यदि संभव हो)", + helptip: "पृष्ठ जाँचे हुए तभी चिन्हित किये जाएँगे यदि उनपर विशेष:नए_पृष्ठ द्वारा जाया गया हो।", type: "boolean" }, @@ -267,8 +267,8 @@ Twinkle.config.sections = [ // What types of actions should result that the author of the page being notified of nomination { name: "notifyUserOnSpeedyDeletionNomination", - label: "Notify page creator only when tagging with these criteria", - helptip: "Even if you choose to notify from the CSD screen, the notification will only take place for those criteria selected here.", + label: "निम्न मापदंडों से नामांकन करते समय पृष्ठ निर्माता को सूचित करें", + helptip: "यदि आप नामांकन विंडो में से सूचित करना चुनते हैं और यहाँ उपयुक्त चेकबॉक्स चेक करते हैं, पृष्ठ निर्माता को तभी सूचित किया जाएगा।", type: "set", setValues: Twinkle.config.commonSets.csdCriteria, setDisplayOrder: Twinkle.config.commonSets.csdCriteriaNotificationDisplayOrder @@ -290,7 +290,7 @@ Twinkle.config.sections = [ // What types of actions that should result user talk page to be opened when speedily deleting (admin only) { name: "openUserTalkPageOnSpeedyDelete", - label: "Open user talk page when deleting under these criteria", + label: "निम्न मापदंडों के अंतर्गत पृष्ठ हटाते समय पृष्ठ निर्माता का वार्ता पृष्ठ खोलें", adminOnly: true, type: "set", setValues: Twinkle.config.commonSets.csdCriteria, @@ -301,7 +301,7 @@ Twinkle.config.sections = [ // If talk page if exists should also be deleted (CSD G8) when spedying a page (admin only) { name: "deleteTalkPageOnDelete", - label: "Check the \"also delete talk page\" box by default", + label: "\"वार्ता पृष्ठ भी हटाएँ\" चेकबॉक्स को डिफ़ॉल्ट रूप से चेक करें", adminOnly: true, type: "boolean" }, @@ -310,7 +310,7 @@ Twinkle.config.sections = [ // Make the CSD screen default to "tag" instead of "delete" (admin only) { name: "deleteSysopDefaultToTag", - label: "Default to speedy tagging instead of outright deletion", + label: "नामांकन को हटाने के बजाए डिफ़ॉल्ट रखें", adminOnly: true, type: "boolean" }, @@ -319,7 +319,7 @@ Twinkle.config.sections = [ // Defines the width of the Twinkle SD window in pixels { name: "speedyWindowWidth", - label: "Width of speedy deletion window (pixels)", + label: "विंडो की चौड़ाई (पिक्सेल में)", type: "integer" }, @@ -327,26 +327,26 @@ Twinkle.config.sections = [ // Defines the width of the Twinkle SD window in pixels { name: "speedyWindowHeight", - label: "Height of speedy deletion window (pixels)", - helptip: "If you have a big monitor, you might like to increase this.", + label: "विंडो की ऊँचाई (पिक्सेल में)", + helptip: "यदि आपके पास बड़ा मॉनिटर है तो आप इसे बढ़ाना पसंद करेंगे।", type: "integer" }, { name: "logSpeedyNominations", - label: "Keep a log in userspace of all CSD nominations", - helptip: "Since non-admins do not have access to their deleted contributions, the userspace log offers a good way to keep track of all pages you nominate for CSD using Twinkle.", + label: "सभी शीघ्र हटाने के नामांकनों का अपने सदस्य नामस्थान में लॉग रखें", + helptip: "चूँकि आम सदस्य अपने हटाए हुए योगदान नहीं देख सकते हैं, अपने सदस्य नामस्थान में नामांकनों का लॉग रखना ट्विंकल द्वारा किये गए नामांकनों की सूची पाने का आसान तरीका है।", type: "boolean" }, { name: "speedyLogPageName", - label: "Keep the CSD userspace log at this user subpage", - helptip: "i.e. User:username/subpage name. Only works if you turn on the CSD userspace log.", + label: "सदस्य नामस्थान का लॉग इस पृष्ठ पर रखें", + helptip: "यहाँ अपने सदस्य उप-पृष्ठ का नाम दें। इसमें अपना सदस्य नाम एवं नामस्थान ना जोड़ें। यह तभी काम करता है यदि आप सदस्य नामस्थान लॉग सक्षम करें।", type: "string" }, { name: "noLogOnSpeedyNomination", - label: "Do not create a userspace log entry when tagging with these criteria", + label: "सदस्य नामस्थान लॉग में निम्न मापदंडों से किये गए नामांकनों की प्रविष्टि ना जोड़ें", type: "set", setValues: Twinkle.config.commonSets.csdCriteria, setDisplayOrder: Twinkle.config.commonSets.csdCriteriaDisplayOrder @@ -355,78 +355,79 @@ Twinkle.config.sections = [ }, { - title: "Tag", + title: "टैग", inFriendlyConfig: true, preferences: [ { name: "watchTaggedPages", - label: "Add page to watchlist when tagging", + label: "पृष्ठों को रखरखाव के लिए टैग करते समय उन्हें ध्यानसूची में जोड़ें", type: "boolean" }, { name: "markTaggedPagesAsMinor", - label: "Mark addition of tags as a minor edit", + label: "रखरखाव टैगिंग को छोटा सम्पादन चिन्हित करें", type: "boolean" }, { name: "markTaggedPagesAsPatrolled", - label: "Mark pages as patrolled when tagging (if possible)", - helptip: "Due to technical limitations, pages are only marked as patrolled when they are reached via Special:NewPages.", + label: "पृष्ठों को टैग करते समय उन्हें जाँचा हुआ (patrolled) चिन्हित करें (यदि संभव हो)", + helptip: "पृष्ठ जाँचे हुए तभी चिन्हित किये जाएँगे यदि उनपर विशेष:नए_पृष्ठ द्वारा जाया गया हो।", type: "boolean" }, { name: "groupByDefault", - label: "Check the \"group into {{multiple issues}}\" box by default", + label: "\"यदि संभव हो तो {{अनेक समस्याएँ}} द्वारा वर्गीकृत करें\" चेकबॉक्स को डिफ़ॉल्ट रूप से चेक करें", type: "boolean" }, { name: "tagArticleSortOrder", - label: "Default view order for article tags", + label: "लेख रखरखाव साँचों के लिए डिफ़ॉल्ट दृश्यता", type: "enum", - enumValues: { "cat": "By categories", "alpha": "In alphabetical order" } + enumValues: { "cat": "वर्ग अनुसार", "alpha": "वर्णमाला अनुसार" } }, { name: "customTagList", - label: "Custom article maintenance tags to display", - helptip: "These appear as additional options at the bottom of the list of tags. For example, you could add new maintenance tags which have not yet been added to Twinkle's defaults.", + label: "लेख रखरखाव के लिए दिखाने हेतु विशिष्ट टैग", + helptip: "ये टैग सूची के अंत में अतिरिक्त विकल्पों की तरह नज़र आते हैं। आप इसमें ऐसे रखरखाव साँचे जोड़ सकते हैं जो ट्विंकल में डिफ़ॉल्ट रूप से उपलब्ध नहीं हैं।", type: "customList", - customListValueTitle: "Template name (no curly brackets)", - customListLabelTitle: "Text to show in Tag dialog" + customListValueTitle: "साँचे का नाम (बिना ब्रैकेट के)", + customListLabelTitle: "टैग विंडो में दिखाने हेतु पाठ" } ] }, { - title: "Talkback", + title: "सन्देश", inFriendlyConfig: true, preferences: [ { name: "markTalkbackAsMinor", - label: "Mark talkbacks as minor edits", + label: "सन्देशों को छोटा सम्पादन चिन्हित करें।", type: "boolean" }, { name: "insertTalkbackSignature", - label: "Insert signature within talkbacks", + label: "सन्देशों में हस्ताक्षर जोड़ें", + helptip: "यदि यह सक्षम है तो केवल {{सन्देश}} साँचा जोड़ने पर भी उसके नीचे आपके हस्ताक्षर जोड़े जाएँगे।", type: "boolean" }, { name: "talkbackHeading", - label: "Section heading to use for talkbacks", + label: "सन्देश के लिए प्रयोग किया जाने वाला अनुभाग शीर्षक", type: "string" } ] }, { - title: "Unlink", + title: "कड़ीतोड़", preferences: [ // TwinkleConfig.unlinkNamespaces (array) // In what namespaces unlink should happen, default in 0 (article) and 100 (portal) { name: "unlinkNamespaces", - label: "Remove links from pages in these namespaces", - helptip: "Avoid selecting any talk namespaces, as Twinkle might end up unlinking on talk archives (a big no-no).", + label: "कड़ियाँ निम्न नामस्थानों से हटाएँ", + helptip: "किसी भी चर्चा/वार्ता नामस्थान को चुनते समय याद रखें कि इससे पुरालेखों में से भी कड़ियाँ हट जाएँगी (जो नहीं किया जाना चाहिए)।", type: "set", setValues: Twinkle.config.commonSets.namespacesNoSpecial } @@ -476,75 +477,75 @@ Twinkle.config.sections = [ }, { - title: "Welcome user", + title: "स्वागत", inFriendlyConfig: true, preferences: [ { name: "topWelcomes", - label: "Place welcomes above existing content on user talk pages", + label: "स्वागत साँचे सदस्य वार्ता पृष्ठ पर ऊपर-ऊपर जोड़ें", type: "boolean" }, { name: "watchWelcomes", - label: "Add user talk pages to watchlist when welcoming", - helptip: "Doing so adds to the personal element of welcoming a user - you will be able to see how they are coping as a newbie, and possibly help them.", + label: "स्वागत करते समय सदस्य वार्ता पृष्ठ अपनी ध्यानसूची में जोड़ें", + helptip: "इससे आप उस नए सदस्य का ध्यान रख सकेंगे, और आवश्यकता पड़ने पर उनकी मदद कर सकेंगे।", type: "boolean" }, { name: "insertHeadings", - label: "Insert a section heading before welcomes", + label: "स्वागत से पहले अनुभाग शीर्षक जोड़ें", type: "boolean" }, { name: "welcomeHeading", - label: "Section heading to use for welcomes", - helptip: "Only has an effect if headings are enabled, and the heading is not part of the template.", + label: "स्वागत के लिए प्रयुक्त अनुभाग शीर्षक", + helptip: "इससे तभी फ़र्क पड़ेगा यदि अनुभाग शीर्षक सक्षम है और साँचे में पहले से अनुभाग शीर्षक नहीं है।", type: "string" }, { name: "insertUsername", - label: "Add your username to the template (where applicable)", - helptip: "Some welcome templates have an opening sentence like \"Hi, I'm <username>. Welcome\" etc. If you turn off this option, these templates will not display your username in that way.", + label: "साँचों में अपना सदस्यनाम जोड़ें (जहाँ आवश्यक हो)", + helptip: "कुछ स्वागत साँचों में स्वागत करने वाले सदस्य का नाम भी जुड़ता है। यदि आप इस विकल्प को अक्षम करते हैं तो ऐसे साँचों में आपका सदस्यनाम नहीं दिखाई देगा।", type: "boolean" }, { name: "insertSignature", - label: "Add your signature after the welcome", + label: "स्वागत के बाद हस्ताक्षर जोड़ें", helptip: "Strongly recommended.", type: "boolean" }, { name: "maskTemplateInSummary", - label: "Omit the name of the welcome template in the edit summary", - helptip: "The names of some of the templates (e.g. \"welcome-anon-vandal\") may be viewed by the user as attacks, so it is better to leave them out of the edit summary", + label: "सम्पादन सारांश में साँचे का नाम णा जोड़ें", + helptip: "नए सदस्यों को \"Welcomevandal\" जैसे नाम अटपटे या बुरे लग सकते हैं, इसलिए उन्हें सम्पादन सारांश में ना जोड़ा जाए तो अच्छा है।", type: "boolean" }, { name: "quickWelcomeMode", - label: "Clicking the \"welcome\" link on a diff page will", + label: "अवतरण अंतर पृष्ठ पर \"स्वागत\" पर क्लिक करने पर", helptip: "If you choose to welcome automatically, the template you specify below will be used.", type: "enum", - enumValues: { auto: "welcome automatically", norm: "prompt you to select a template" } + enumValues: { auto: "अपने-आप स्वागत करे", norm: "आपसे साँचा चुनने को कहे" } }, { name: "quickWelcomeTemplate", - label: "Template to use when welcoming automatically", - helptip: "Enter the name of a welcome template, without the curly brackets. A link to the given article will be added.", + label: "अपने-आप स्वागत करते समय प्रयोग करने हेतु साँचा", + helptip: "एक स्वागत साँचा का नाम जोड़ें, बिना ब्रैकेट के। उपयुक्त पृष्ठ की कड़ी अपने-आप जोड़ी जाएगी।", type: "string" }, { name: "customWelcomeList", - label: "Custom welcome templates to display", - helptip: "You can add other welcome templates, or user subpages that are welcome templates (prefixed with \"User:\"). Don't forget that these templates are substituted onto user talk pages.", + label: "विशिष्ट स्वागत साँचे", + helptip: "आप अन्य विशिष्ट स्वागत साँचे (अथवा सदस्य नामस्थान के पृष्ठ जो साँचे हैं) यहाँ जोड़ सकते हैं। ये स्वागत विंडो में जोड़ के दिखाए जाएँगे और सदस्य वार्ता पृष्ठों पर substitute किये जाएँगे। सदस्य नामस्थान के पृष्ठ जोड़ते समय पृष्ठ का पूरा नाम (नाम्थान सहित) बताएँ। साँचों के लिए ऐसा करने की आवश्यकता नहीं है।", type: "customList", - customListValueTitle: "Template name (no curly brackets)", - customListLabelTitle: "Text to show in Welcome dialog" + customListValueTitle: "साँचे का नाम (बिना ब्रैकेट के)", + customListLabelTitle: "स्वागत विंडो में दिखाने हेतु पाठ" } ] }, { - title: "पृष्ठ हटाने हेतु चर्चा", + title: "पृष्ठ हटाने हेतु चर्चा (हहेच)", preferences: [ // TwinkleConfig.xfdWatchPage (string) // The watchlist setting of the page being nominated for XfD. Either "yes" (add to watchlist), "no" (don't diff --git a/modules/twinkleunlink.js b/modules/twinkleunlink.js index 1d6bc1a7b..038b9e936 100644 --- a/modules/twinkleunlink.js +++ b/modules/twinkleunlink.js @@ -1,4 +1,4 @@ -/* +/* **************************************** *** twinkleunlink.js: Unlink module **************************************** @@ -11,7 +11,7 @@ Twinkle.unlink = function twinkleunlink() { if( mw.config.get('wgNamespaceNumber') < 0 ) { return; } - twAddPortletLink( Twinkle.unlink.callback, "Unlink", "tw-unlink", "Unlink backlinks" ); + twAddPortletLink( Twinkle.unlink.callback, "कड़ीतोड़", "tw-unlink", "अन्य पृष्ठों से इस पृष्ठ की कड़ियाँ हटाएँ" ); }; Twinkle.unlink.getChecked2 = function twinkleunlinkGetChecked2( nodelist ) { @@ -30,7 +30,7 @@ Twinkle.unlink.getChecked2 = function twinkleunlinkGetChecked2( nodelist ) { // the parameter is used when invoking unlink from admin speedy Twinkle.unlink.callback = function(presetReason) { var Window = new Morebits.simpleWindow( 800, 400 ); - Window.setTitle( "Unlink backlinks" ); + Window.setTitle( "कड़ियाँ हटाएँ" ); Window.setScriptName( "Twinkle" ); Window.addFooterLink( "Twinkle help", "WP:TW/DOC#unlink" ); @@ -38,7 +38,7 @@ Twinkle.unlink.callback = function(presetReason) { form.append( { type: 'textarea', name: 'reason', - label: 'Reason: ', + label: 'कारण: ', value: (presetReason ? presetReason : '') } ); @@ -70,7 +70,7 @@ Twinkle.unlink.callback = function(presetReason) { var root = document.createElement( 'div' ); root.style.padding = '15px'; // just so it doesn't look broken Morebits.status.init( root ); - wikipedia_api.statelem.status( "loading..." ); + wikipedia_api.statelem.status( "कड़ियाँ लोड हो रही हैं..." ); Window.setContent( root ); Window.display(); }; @@ -82,13 +82,13 @@ Twinkle.unlink.callback.evaluate = function twinkleunlinkCallbackEvaluate(event) Twinkle.unlink.imageusagedone = 0; function processunlink(pages, imageusage) { - var statusIndicator = new Morebits.status((imageusage ? 'Unlinking instances of file usage' : 'Unlinking backlinks'), '0%'); + var statusIndicator = new Morebits.status((imageusage ? 'फ़ाइल प्रयोग हटाया जा रहा है' : 'कड़ियाँ हटाई जा रही हैं'), '0%'); var total = pages.length; // removing doubling of this number - no apparent reason for it Morebits.wiki.addCheckpoint(); if( !pages.length ) { - statusIndicator.info( '100% (completed)' ); + statusIndicator.info( '100% (सम्पूर्ण)' ); Morebits.wiki.removeCheckpoint(); return; } @@ -98,7 +98,7 @@ Twinkle.unlink.callback.evaluate = function twinkleunlinkCallbackEvaluate(event) for (var i = 0; i < pages.length; ++i) { var myparams = $.extend({}, params); - var articlepage = new Morebits.wiki.page(pages[i], 'Unlinking in article "' + pages[i] + '"'); + var articlepage = new Morebits.wiki.page(pages[i], '"' + pages[i] + '"' + 'पृष्ठ से कड़ियाँ हटाई जा रही हैं।'); articlepage.setCallbackParameters(myparams); articlepage.load(imageusage ? Twinkle.unlink.callbacks.unlinkImageInstances : Twinkle.unlink.callbacks.unlinkBacklinks); } @@ -144,24 +144,24 @@ Twinkle.unlink.callbacks = { } if (!list.length) { - apiobj.params.form.append( { type: 'div', label: 'No instances of file usage found.' } ); + apiobj.params.form.append( { type: 'div', label: 'फ़ाइल का प्रयोग कहीं नहीं मिला।' } ); } else { - apiobj.params.form.append( { type:'header', label: 'File usage' } ); + apiobj.params.form.append( { type:'header', label: 'फ़ाइल प्रयोग' } ); namespaces = []; $.each(Twinkle.getPref('unlinkNamespaces'), function(k, v) { namespaces.push(Morebits.wikipedia.namespacesFriendly[v]); }); apiobj.params.form.append( { type: 'div', - label: "Selected namespaces: " + namespaces.join(', '), - tooltip: "You can change this with your Twinkle preferences, at [[WP:TWPREFS]]" + label: "चुने हुए नामस्थान: " + namespaces.join(', '), + tooltip: "आप ये नामस्थान अपनी ट्विंकल वरीयताओं में बदल सकते हैं, [[वि:Twinkle/Preferences]] पर।" }); if ($(xmlDoc).find('query-continue').length) { apiobj.params.form.append( { type: 'div', - label: "First " + list.length.toString() + " file usages shown." + label: "पहले " + list.length.toString() + " फ़ाइल प्रयोग नीचे सूचीबद्ध हैं।" }); } apiobj.params.form.append( { @@ -187,13 +187,13 @@ Twinkle.unlink.callbacks = { }); apiobj.params.form.append( { type: 'div', - label: "Selected namespaces: " + namespaces.join(', '), - tooltip: "You can change this with your Twinkle preferences, at [[WP:TWPREFS]]" + label: "चुने हुए नामस्थान: " + namespaces.join(', '), + tooltip: "आप ये नामस्थान अपनी ट्विंकल वरीयताओं में बदल सकते हैं, [[वि:Twinkle/Preferences]] पर।" }); if ($(xmlDoc).find('query-continue').length) { apiobj.params.form.append( { type: 'div', - label: "First " + list.length.toString() + " backlinks shown." + label: "यहाँ की कड़ियों वाले पहले" + list.length.toString() + "पृष्ठ नीचे सूचीबद्ध हैं।" }); } apiobj.params.form.append( { @@ -205,7 +205,7 @@ Twinkle.unlink.callbacks = { } else { - apiobj.params.form.append( { type: 'div', label: 'No backlinks found.' } ); + apiobj.params.form.append( { type: 'div', label: "कोई कड़ियाँ नहीं मिली।" } ); } if (havecontent) { @@ -232,7 +232,7 @@ Twinkle.unlink.callbacks = { } pageobj.setPageText(text); - pageobj.setEditSummary("Removing link(s) to \"" + mw.config.get('wgPageName') + "\": " + params.reason + "." + Twinkle.getPref('summaryAd')); + pageobj.setEditSummary("\"" + mw.config.get('wgPageName') + "\" पृष्ठ की कड़ियाँ हटाई जा रही हैं। कारण: " + params.reason + "।" + Twinkle.getPref('summaryAd')); pageobj.setCreateOption('nocreate'); pageobj.save(Twinkle.unlink.callbacks.success); }, @@ -252,7 +252,7 @@ Twinkle.unlink.callbacks = { } pageobj.setPageText(text); - pageobj.setEditSummary("Commenting out use(s) of file \"" + mw.config.get('wgPageName') + "\": " + params.reason + "." + Twinkle.getPref('summaryAd')); + pageobj.setEditSummary("\"" + mw.config.get('wgPageName') + "\" फ़ाइल का प्रयोग हटाया जा रहा है। कारण: " + params.reason + "।" + Twinkle.getPref('summaryAd')); pageobj.setCreateOption('nocreate'); pageobj.save(Twinkle.unlink.callbacks.success); }, @@ -262,7 +262,7 @@ Twinkle.unlink.callbacks = { var now = parseInt( 100 * (params.imageusage ? ++(Twinkle.unlink.imageusagedone) : ++(Twinkle.unlink.backlinksdone))/total, 10 ) + '%'; params.globalstatus.update( now ); if((params.imageusage ? Twinkle.unlink.imageusagedone : Twinkle.unlink.backlinksdone) >= total) { - params.globalstatus.info( now + ' (completed)' ); + params.globalstatus.info( now + ' (सम्पूर्ण)' ); Morebits.wiki.removeCheckpoint(); } } diff --git a/morebits.js b/morebits.js index 03f14a8a5..4561bd185 100644 --- a/morebits.js +++ b/morebits.js @@ -1153,57 +1153,55 @@ Date.prototype.getUTCMonthNameAbbrev = function() { /** * **************** Morebits.wikipedia **************** - * English Wikipedia-specific objects + * Hindi Wikipedia-specific objects */ Morebits.wikipedia = {}; Morebits.wikipedia.namespaces = { - '-2': 'Media', - '-1': 'Special', - '0': '', - '1': 'Talk', - '2': 'User', - '3': 'User talk', - '4': 'Project', - '5': 'Project talk', - '6': 'File', - '7': 'File talk', - '8': 'MediaWiki', - '9': 'MediaWiki talk', - '10': 'Template', - '11': 'Template talk', - '12': 'Help', - '13': 'Help talk', - '14': 'Category', - '15': 'Category talk', - '100': 'Portal', - '101': 'Portal talk', - '108': 'Book', - '109': 'Book talk' + "0": "", + "1": "वार्ता", + "2": "सदस्य", + "3": "सदस्य वार्ता", + "4": "विकिपीडिया", + "5": "विकिपीडिया वार्ता", + "6": "चित्र", + "7": "चित्र वार्ता", + "8": "मीडियाविकि", + "9": "मीडियाविकि वार्ता", + "10": "साँचा", + "11": "साँचा वार्ता", + "12": "सहायता", + "13": "सहायता वार्ता", + "14": "श्रेणी", + "15": "श्रेणी वार्ता", + "100": "प्रवेशद्वार", + "101": "प्रवेशद्वार वार्ता", + "-1": "विशेष", + "-2": "मीडिया" }; Morebits.wikipedia.namespacesFriendly = { - '0': '(Article)', - '1': 'Talk', - '2': 'User', - '3': 'User talk', - '4': 'Wikipedia', - '5': 'Wikipedia talk', - '6': 'File', - '7': 'File talk', - '8': 'MediaWiki', - '9': 'MediaWiki talk', - '10': 'Template', - '11': 'Template talk', - '12': 'Help', - '13': 'Help talk', - '14': 'Category', - '15': 'Category talk', - '100': 'Portal', - '101': 'Portal talk', - '108': 'Book', - '109': 'Book talk' + "0": "(लेख)", + "1": "वार्ता", + "2": "सदस्य", + "3": "सदस्य वार्ता", + "4": "विकिपीडिया", + "5": "विकिपीडिया वार्ता", + "6": "चित्र", + "7": "चित्र वार्ता", + "8": "मीडियाविकि", + "9": "मीडियाविकि वार्ता", + "10": "साँचा", + "11": "साँचा वार्ता", + "12": "सहायता", + "13": "सहायता वार्ता", + "14": "श्रेणी", + "15": "श्रेणी वार्ता", + "100": "प्रवेशद्वार", + "101": "प्रवेशद्वार वार्ता", + "-1": "विशेष", + "-2": "मीडिया" }; @@ -2811,12 +2809,21 @@ Morebits.wikitext.page.prototype = { reason = reason ? ' ' + reason + ': ' : ''; var first_char = image.substr( 0, 1 ); var image_re_string = "[" + first_char.toUpperCase() + first_char.toLowerCase() + ']' + RegExp.escape( image.substr( 1 ), true ); - + + var AllImageNamespaceAliases = ""; + for ( var alias in mw.config.get('wgNamespaceIds') ) { + if ( mw.config.get('wgNamespaceIds')[alias] === 6 ) { + AllImageNamespaceAliases += alias + "|"; + AllImageNamespaceAliases += alias.substr( 0, 1 ).toUpperCase() + alias.slice(1) + "|"; + } + } + AllImageNamespaceAliases = AllImageNamespaceAliases.slice(0,-1); + /* * Check for normal image links, i.e. [[Image:Foobar.png|...]] * Will eat the whole link */ - var links_re = new RegExp( "\\[\\[(?:[Ii]mage|[Ff]ile):\\s*" + image_re_string ); + var links_re = new RegExp( "\\[\\[(?:" + AllImageNamespaceAliases + "):\\s*" + image_re_string ); var allLinks = Morebits.array.uniq(Morebits.string.splitWeightedByKeys( unbinder.content, '[[', ']]' )); for( var i = 0; i < allLinks.length; ++i ) { if( links_re.test( allLinks[i] ) ) { @@ -2831,7 +2838,7 @@ Morebits.wikitext.page.prototype = { * Check for gallery images, i.e. instances that must start on a new line, eventually preceded with some space, and must include Image: prefix * Will eat the whole line. */ - var gallery_image_re = new RegExp( "(^\\s*(?:[Ii]mage|[Ff]ile):\\s*" + image_re_string + ".*?$)", 'mg' ); + var gallery_image_re = new RegExp( "(^\\s*(?:" + AllImageNamespaceAliases + "):\\s*" + image_re_string + ".*?$)", 'mg' ); unbinder.content.replace( gallery_image_re, "" ); // unbind the newly created comments @@ -2840,7 +2847,7 @@ Morebits.wikitext.page.prototype = { * Check free image usages, for example as template arguments, might have the Image: prefix excluded, but must be preceeded by an | * Will only eat the image name and the preceeding bar and an eventual named parameter */ - var free_image_re = new RegExp( "(\\|\\s*(?:[\\w\\s]+\\=)?\\s*(?:(?:[Ii]mage|[Ff]ile):\\s*)?" + image_re_string + ")", 'mg' ); + var free_image_re = new RegExp( "(\\|\\s*(?:[\\w\\s]+\\=)?\\s*(?:(?:" + AllImageNamespaceAliases + "):\\s*)?" + image_re_string + ")", 'mg' ); unbinder.content.replace( free_image_re, "" ); // Rebind the content now, we are done! @@ -2852,7 +2859,17 @@ Morebits.wikitext.page.prototype = { if( first_char.toUpperCase() !== first_char.toLowerCase() ) { first_char_regex = '[' + RegExp.escape( first_char.toUpperCase(), true ) + RegExp.escape( first_char.toLowerCase(), true ) + ']'; } - var image_re_string = "(?:[Ii]mage|[Ff]ile):\\s*" + first_char_regex + RegExp.escape( image.substr( 1 ), true ); + + var AllImageNamespaceAliases = ""; + for ( var alias in mw.config.get('wgNamespaceIds') ) { + if ( mw.config.get('wgNamespaceIds')[alias] === 6 ) { + AllImageNamespaceAliases += alias + "|"; + AllImageNamespaceAliases += alias.substr( 0, 1 ).toUpperCase() + alias.slice(1) + "|"; + } + } + AllImageNamespaceAliases = AllImageNamespaceAliases.slice(0,-1); + + var image_re_string = "(?:" + AllImageNamespaceAliases + "):\\s*" + first_char_regex + RegExp.escape( image.substr( 1 ), true ); var links_re = new RegExp( "\\[\\[" + image_re_string ); var allLinks = Morebits.array.uniq(Morebits.string.splitWeightedByKeys( this.text, '[[', ']]' )); for( var i = 0; i < allLinks.length; ++i ) { @@ -2869,7 +2886,17 @@ Morebits.wikitext.page.prototype = { }, removeTemplate: function( template ) { var first_char = template.substr( 0, 1 ); - var template_re_string = "(?:[Tt]emplate:)?\\s*[" + first_char.toUpperCase() + first_char.toLowerCase() + ']' + RegExp.escape( template.substr( 1 ), true ); + + var AllTemplateNamespaceAliases = ""; + for ( var alias in mw.config.get('wgNamespaceIds') ) { + if ( mw.config.get('wgNamespaceIds')[alias] === 10 ) { + AllTemplateNamespaceAliases += alias + "|"; + AllTemplateNamespaceAliases += alias.substr( 0, 1 ).toUpperCase() + alias.slice(1) + "|"; + } + } + AllTemplateNamespaceAliases = AllTemplateNamespaceAliases.slice(0,-1); + + var template_re_string = "(?:" + AllTemplateNamespaceAliases + "):?\\s*[" + first_char.toUpperCase() + first_char.toLowerCase() + ']' + RegExp.escape( template.substr( 1 ), true ); var links_re = new RegExp( "\\{\\{" + template_re_string ); var allTemplates = Morebits.array.uniq(Morebits.string.splitWeightedByKeys( this.text, '{{', '}}', [ '{{{', '}}}' ] )); for( var i = 0; i < allTemplates.length; ++i ) {