คุยเรื่องมีเดียวิกิ:Gadget-HotCat.js
Localization[แก้]
var HotCat = { isCommonsVersion : false //เซ็ตเป็น false ได้ เพราะเราแยกอิสระจาก Commons // If you copy HotCat to your wiki, you should set this to false! // Localize these messages to the main language of your wiki. ,messages : { cat_removed : 'ลบ[[หมวดหมู่:$1]]สำเร็จแล้ว' // 'ลบ[[หมวดหมู่:$1]]' ,template_removed : 'removed {{[[หมวดหมู่:$1]]}}' // เซ็ตเป็น null ได้เพราะวิกิพีเดียไทยไม่ได้ใช้ (ดูเพิ่มด้านล่าง) ,cat_added : 'เพิ่ม[[หมวดหมู่:$1]]'สำเร็จแล้ว // 'เพิ่ม[[หมวดหมู่:$1]]' ,cat_keychange: 'เปลี่ยนการเรียงลำดับบทความใน[[หมวดหมู่:$1]]: //เปลี่ยนการเรียงลำดับบทความใน[[หมวดหมู่:$1]] ,cat_notFound : ' ไม่พบหมวดหมู่ "$1"' // ไม่พบหมวดหมู่ $1 ,cat_exists : 'มีหมวดหมู่ $1 อยู่แล้ว ไม่เพิ่มหมวดหมู่' //มีหมวดหมู่ $1 อยู่แล้ว ไม่เพิ่มหมวดหมู่ ,cat_resolved : ' (แก้เปลี่ยนทางของ[[หมวดหมู่: $1]])' // แก้เปลี่ยนทางของ[[หมวดหมู่: $1]] ,uncat_removed: 'removed {{ต้องการหมวดหมู่}}' //นำป้าย {{ต้องการหมวดหมู่}} ออก ,separator : '; ' ,prefix : "" // Some text to prefix to the edit summary. ,using : ' using [[Help:Gadget-HotCat|HotCat]]' //เซ็ตเป็น Null ได้ หรือจะเซ็ตให้ลิงก์ไปที่คอมมอนส์ ([[:commons:Help:Gadget-HotCat|HotCat]]) ก็ได้ // Some text to append to the edit summary. Named 'using' for historical reasons. If you prefer // to have a marker at the front, use prefix and set this to the empty string. ,multi_change : '$1 หมวดหมู่' // $1 หมวดหมู่ // $1 is replaced by a number ,commit : 'บันทึก' // บันทึก // Button text. Localize to wgContentLanguage here; localize to wgUserLanguage in a subpage, // see localization hook below. ,ok : 'ตกลง' //ตกลง // Button text. Localize to wgContentLanguage here; localize to wgUserLanguage in a subpage, // see localization hook below. ,cancel : 'ยกเลิก' //ยกเลิก // Button text. Localize to wgContentLanguage here; localize to wgUserLanguage in a subpage, // see localization hook below. ,multi_error : 'Could not retrieve the page text from the server. Therefore, your หมวดหมู่ changes ' +'ไม่สามารถดึงข้อความที่ต้องแก้ไขจากระบบได้ การเปลี่ยนหมวดหมู่ไม่สามารถดำเนินการได้ ขออภัยในความไม่สะดวก' //ไม่สามารถดึงข้อความที่ต้องแก้ไขจากระบบได้ การเปลี่ยนหมวดหมู่ไม่สามารถดำเนินการได้ ขออภัยในความไม่สะดวก // Localize to wgContentLanguage here; localize to wgUserLanguage in a subpage, // see localization hook below. } ,หมวดหมู่_regexp : 'หมวดหมู่' // เพิ่มภาษาไทย เช่น [ห][ม][ว][ด][ห][มู่] (หรือ [ห][ม][ว][ด][ห][ม][ู][่] หรือ [ห][ม][ว][ด][ห][ม][่][ู]) // Regular sub-expression matching all possible names for the หมวดหมู่ namespace. Is automatically localized // correctly if you're running MediaWiki 1.16 or later. Otherwise, set it appropriately, e.g. at the German // Wikipedia, use '[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]|[Kk][Aa][Tt][Ee][Gg][Oo][Rr][Ii][Ee]', or at the // Chinese Wikipedia, use '[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]|分类|分類'. Note that namespaces are case- // insensitive! ,หมวดหมู่_canonical : 'หมวดหมู่' //หมวดหมู่ // The standard หมวดหมู่ name on your wiki. Is automatically localized correctly if you're running // MediaWiki 1.16 or later; otherwise, set it to the preferred หมวดหมู่ name (e.g., "Kategorie"). ,categories : 'หมวดหมู่' //หมวดหมู่ // Plural of หมวดหมู่_canonical ,disambig_หมวดหมู่ : ''แก้ความกำกวม' // 'แก้ความกำกวม' หรือจะเซ็ตเป็น Null ก็ได้ เพราะวิกิพีเดียไทยไม่ได้ใช้ Disambig หมวดหมู่ // Any หมวดหมู่ in this หมวดหมู่ is deemed a disambiguation หมวดหมู่; i.e., a หมวดหมู่ that should not contain // any items, but that contains links to other categories where stuff should be categorized. If you don't have // that concept on your wiki, set it to null. ,redir_หมวดหมู่ : 'หมวดหมู่เปลี่ยนทาง' // 'หมวดหมู่เปลี่ยนทาง' หรือจะเซ็ตเป็น Null ก็ได้ เพราะวิกิพีเดียไทยไม่ได้ใช้ หมวดหมู่ redirect // Any หมวดหมู่ in this หมวดหมู่ is deemed a (soft) redirect to some other หมวดหมู่ defined by the first link // to another หมวดหมู่. If your wiki doesn't have soft หมวดหมู่ redirects, set this to null. ,links : {change: '(±)', remove: '(−)', add: '(+)', restore: '(×)', undo: '(×)', down: '(↓)', up: '(↑)'} // The little modification links displayed after หมวดหมู่ names. ,tooltips : { change: 'แก้ไข' //แก้ไข ,remove: 'นำออก' //นำออก ,add: 'เพิ่มหมวดหมู่ใหม่' //เพิ่มหมวดหมู่ใหม่ ,restore: 'ย้อนการแก้ไข' //ย้อนการแก้ไข ,undo: 'ย้อนการแก้ไข' //ย้อนการแก้ไข ,down: 'เปิดหน้าต่างแก้ไขและแสดงหมวดหมู่ย่อย' //เปิดหน้าต่างแก้ไขและแสดงหมวดหมู่ย่อย ,up: 'เปิดหน้าต่างแก้ไขและแสดงหมวดหมู่หลัก' //เปิดหน้าต่างแก้ไขและแสดงหมวดหมู่หลัก } // The tooltips for the above links ,addmulti : '<span>+<sup>+</sup></span>' // The HTML content of the "enter multi-mode" link at the front. ,multi_tooltip : 'แก้ไขหลาย ๆ หมวดหมู่พร้อมกั' //แก้ไขหลาย ๆ หมวดหมู่พร้อมกัน // Tooltip for the "enter multi-mode" link ,disable : function () { // Return true to disable HotCat return ( wgNamespaceNumber < 0 // Special pages; Special:Upload is handled differently || wgNamespaceNumber == 10 // Templates || wgNamespaceNumber == 8 // MediaWiki || wgNamespaceNumber == 2 && wgTitle && wgTitle.length >= 3 && wgTitle.lastIndexOf ('.js') + 3 == wgTitle.length // User scripts || typeof (wgNamespaceIds) != 'undefined' && ( wgNamespaceNumber == wgNamespaceIds['creator'] || wgNamespaceNumber == wgNamespaceIds['timedtext'] || wgNamespaceNumber == wgNamespaceIds['institution'] ) ); } ,uncat_regexp : /\{\{\s*([Uu]ncat(egori[sz]ed( image)?)?|[Nn]ocat|[Nn]eedsหมวดหมู่)[^}]*\}\}\s*(<\!--.*?--\>)?/g // เพิ่ม ต้องการหมวดหมู่| หน้า [Uu.... // A regexp matching a templates used to mark uncategorized pages, if your wiki does have that. // If not, set it to null. ,existsYes : (wgServer.substring(0, 2) != '//' ? document.location.protocol : "") + '//upload.wikimedia.org/wikipedia/commons/thumb/b/be/P_yes.svg/20px-P_yes.svg.png' ,existsNo : (wgServer.substring(0, 2) != '//' ? document.location.protocol : "") + '//upload.wikimedia.org/wikipedia/commons/thumb/4/42/P_no.svg/20px-P_no.svg.png' // The images used for the little indication icon. Should not need changing. ,template_regexp : 'แม่แบบ' //เพิ่ม [แ][ม่][แ][บ][บ] หรือ [แ][ม][่][แ][บ][บ] // Regexp to recognize templates. Like "หมวดหมู่" above; autolocalized for MW 1.16+, otherwise set manually here. // On the German Wikipedia, you might use '[Tt][Ee][Mm][Pp][Ll][Aa][Tt][Ee]|[Vv][Oo][Rr][Ll][Aa][Gg][Ee]'. ,template_categories : {} // หมวดหมู่ที่เอาออกได้โดยนำแม่แบบออก เซ็ตเป็น Null ได้ // a list of categories which can be removed by removing a template // key: the หมวดหมู่ without namespace // value: A regexp matching the template name, again without namespace // If you don't have this at your wiki, or don't want this, set it to an empty object {}. ,engine_names : { searchindex : 'Search index' ,pagelist : 'Page list' ,combined : 'Combined search' ,subcat : 'Subcategories' ,parentcat : 'Parent categories' } // Names for the search engines
ได้เตรียม Localization ไว้ตามนี้ครับ คำแปลและ/หรือคำอธิบายมีภาษาไทยกำกับไว้ ส่วนที่เป็นคำแปลเป็นการแปลค่าตัวแปร เวลาจะนำไปใช้ให้แทนที่ค่าตัวแปรเดิมด้วยคำที่กำหนดไว้ให้ เช่น 'removed [[:หมวดหมู่:$1]]' ให้เขียนว่า 'ลบ[[:หมวดหมู่:$1]]' (ค่าตัวแปรต้องอยู่ใน Single quote เสมอนะครับ) และส่วนที่เป็น Template/หมวดหมู่ Regex ผมไม่แน่ใจว่ามันจะอ่านแบบไหนเลยเขียนลำดับการพิมพ์ไว้ทุกแบบที่เป็นไปได้ แต่อาจปล่อย null ได้ถ้าเห็นว่าระบบอ่านจากเนมสเปซแล้วไม่มีปัญหา สำหรับ Regex ในส่วนต้องการหมวดหมู่ รบกวนเช็คอีกทีนะครับ --∫G′(∞)dx 20:39, 20 ตุลาคม 2554 (ICT)
- สำเร็จ ขออภัยที่ดำเนินการช้าไปหน่อย --taweethaも 21:31, 30 ตุลาคม 2554 (ICT)
- รบกวนเซ็ตอีกนิดนึงครับ ไลน์
,uncat_regexp : /\{\{\s*([Uu]ncat(egori[sz]ed( image)?)?|[Nn]ocat|[Nn]eedsหมวดหมู่)[^}]*\}\}\s*(<\!--.*?--\>)?/g
อยากให้ใส่ภาษาไทยไปด้วย เท่าที่ดูแล้วจะกลายเป็น (คง category ไว้แบบเดิมน่าจะเข้าท่ากว่า เพราะแปลเป็นไทยครึ่ง ๆ กลาง ๆ แบบนั้นก็ไม่ใช่ชื่อแม่แบบที่เหมาะสม),uncat_regexp : /\{\{\s*([Uu]ncat(egori[sz]ed( image)?)?|[Nn]ocat|[Nn]eedscategory|ต้องการหมวดหมู่)[^}]*\}\}\s*(<\!--.*?--\>)?/g
- ขอบคุณล่วงหน้าครับ --∫G′(∞)dx 21:39, 30 ตุลาคม 2554 (ICT)
- สำเร็จ ทดลองใช้ไปสักพักให้นิ่งก่อนนะครับ ถ้าดีแล้วช่วยกระซิบบอกโครงการอื่นในภาษาไทยให้ปรับปรุงตาม --taweethaも 13:20, 2 พฤศจิกายน 2554 (ICT)