Template: Languages

From LibrePlanet
Jump to: navigation, search
(Added SMW 'Content language' property setting)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This is the &quot;'''Languages'''&quot; template. Edit the page to see the template text.
+
นี่คือ"'ภาษา '''''"แม่แบบ แก้ไขหน้าเว็บเพื่อดูข้อความแม่แบบ
<!--  
+
<! --
Coded by: alexus <http://libreplanet.org/wiki/User:Alexus>
+
เขียนโดย : <http://libreplanet.org/wiki/User:Alexus> alexus
Revision: 2.0
+
Revision : 2.0
Date:     25/01/2011
+
วันที่ : 25/01/2011
 
-->
 
-->
  
'''Description'''
+
'คำอธิบาย '''''
  
This template shows a bar linking to the available translations of a page. Only works for the pages (should be the "original" master page and its translations) which include this template itself.
+
แม่แบบนี้จะแสดงแถบการเชื่อมโยงไปยังการแปลที่ใช้ได้ของหน้า ใช้งานได้เฉพาะสำหรับหน้าเว็บ (ควรเป็น"ต้นฉบับ"หน้าหลักและการแปล) ซึ่งรวมถึงแม่ตัวเองนี้
  
This template should be included, either in the "original" master page and in all its translations, ONLY IF almost one translation of the master page really exist in the wiki.
+
แม่แบบนี้ควรจะรวมทั้งใน"ต้นฉบับ"หน้าหลักและในทุกการแปล, เฉพาะในกรณีที่เกือบหนึ่งในการแปลหน้าหลักจริงๆอยู่ในวิกิพีเดีย
  
It also set the MediaWiki property 'Language code' of the page in which the template itself has being included (see below).
+
นอกจากนี้ยังตั้ง'รหัสภาษา'คุยเกี่ยวกับคุณสมบัติของหน้าเว็บที่แม่ตัวเองได้รับการบันทึกไว้ (ดูด้านล่าง)
  
This template calls:
+
แม่แบบนี้เป็นการเรียก :
* the &quot;LanguageOtherMsg&quot; sub-template
+
*"LanguageOtherMsg"Sub - แม่แบบ
* the &quot;LanguageNativeLink&quot; sub-template
+
*"LanguageNativeLink"Sub - แม่แบบ
  
'''Usage'''
+
'การใช้งาน '''''
  
It should be called in the following format:
+
มันควรจะเรียกว่าในรูปแบบดังต่อไปนี้
 
<pre>
 
<pre>
{{Languages|master page=<MasterPage>|language=<LangCode>}}
+
{{ภาษา | หน้าหลัก = <MasterPage> | ภาษา = <LangCode>}}
</pre>
+
</ pre>
where:
+
ที่ :
* <MasterPage> is the "original" master page
+
<MasterPage> * คือ"ต้นฉบับ"หน้าหลัก
* <LangCode> is the (2-digit lowercase) language code (ISO 639-1) of the content in the page in which the template itself has being included (either if it is the "original" master page or one of its translations)
+
<LangCode> * คือ (ตัวพิมพ์เล็ก 2 หลัก) รหัสภาษา (ISO 639-1) ของเนื้อหาในหน้าแม่แบบที่ตัวเองได้รับการบันทึกไว้ (ไม่ว่าถ้าเป็น"ต้นฉบับ"หน้าหลักหรือหนึ่งในการแปล )
  
'''''Note''''' - This also set the MediaWiki properties 'Language code' and 'Content language' of the calling page to the <LangCode> parameter.
+
''''' ''''' หมายเหตุ -- ชุดนี้ยัง'รหัสภาษา'คุยเกี่ยวกับคุณสมบัติและ'ภาษาเนื้อหา'ของหน้าโทรไปยังพารามิเตอร์ของ <LangCode>
  
'''Example'''
+
'ตัวอย่าง '''''
  
If the "original" master page 'MyPage' is written in English (as more often is) and it has an Italian translation at the page 'MyPage/it", then:
+
ถ้า"ต้นฉบับ"หน้าโท MyPage'จะเขียนเป็นภาษาอังกฤษ (เป็นมากมักจะเป็น) และจะมีการแปลภาษาอิตาลีที่ MyPage หน้า'/ มัน"แล้ว :
* into 'MyPage', include this:
+
* ลงใน'MyPage', รวมถึงการใช้ :
 
<pre>
 
<pre>
{{Languages|master page=MyPage|language=en}}
+
{{ภาษา | หน้าหลัก = MyPage | ภาษา = th}}
</pre>
+
</ pre>
* in 'MyPage/it', include this:
+
* ใน'MyPage / IT'รวมนี้ :
 
<pre>
 
<pre>
{{Languages|master page=MyPage|language=it}}
+
{{ภาษา | หน้าหลัก = MyPage | ภาษา = it}}
</pre>
+
</ pre>
</noinclude><includeonly>{{#ifeq:{{#ask: [[master page::{{{master page}}}]] [[language code::!{{{language}}}]]|format=count}}|0||
+
</ noinclude> {{# <includeonly> ifeq : {{# ถาม : [โท ::{{{ หน้า [หน้าหลัก }}}]] [ภาษา [รหัสภาษา ::!{{{ }}}]]| รูปแบบการนับ =}} | 0 | |
<table style="width:100%; margin:4px 10%; border-collapse:collapse; border:1px solid #aaaaaa; background:#f9f9f9; clear:both; font-size:89%; margin:0.25em 0;">
+
รูปแบบตาราง <="ความกว้าง : 100%; ขอบ : 4px 10%; ชายแดนยุบ : ยุบ; ชายแดน : 1px solid # พูดในครัวเรือน; background : # f9f9f9; ชัดเจน : ทั้งสอง font - size : 89%; ขอบ : 0.25em 0 ;">
 
<tr>
 
<tr>
<td style="border:none; border-right:1px solid #aaaaaa; padding:0.1em 1.0em 0.1em 1.0em; align=left; white-space:nowrap;">
+
<td border-right:1px ของแข็ง padding:0.1em #aaaaaa; style="border:none; 1.0em 0.1em 1.0em; align=left; white-space:nowrap;">
<span lang="{{{language}}}" xml:lang="{{{language}}}">'''[[Translation_Policy|{{LanguageOtherMsg|{{{language}}}}}]]'''</span>:</td>
+
<span lang="{{{language}}}" xml:lang="{{{language}}}"> '''[[ Translation_Policy | {{LanguageOtherMsg | {{{ภาษา }}}}}]]' '' </ font> : </ font>
<td style="border:none; padding:0.1em 1.0em 0em 1.0em; align=left; width:99%;">
+
padding:0.1em style="border:none; <td 1.0em 0em 1.0em; align=left; width:99%;">
{{#ask: [[master page::{{{master page}}}]] [[language code::!{{{language}}}]]|
+
{{# ถาม : [หลัก [หน้าหลักหน้า ::{{{ }}}]] [ภาษา [รหัสภาษา ::!{{{ }}}]]|
  ?language code =|
+
  ? รหัสภาษา = |
  link=none|
+
  ลิงค์ไม่มี = |
  format=list|
+
  รูปแบบรายการ = |
  sep=&nbsp;&bull;&nbsp;_|
+
  กันยายน = _ |
  template=LanguageNativeLink|
+
  แม่แบบ = LanguageNativeLink |
  sort = language code|
+
  เรียงลำดับ = รหัสภาษา |
  order = asc|
+
  คำสั่ง = asc |
  limit = 30|
+
  จำกัด = 30 |
  searchlabel = [&hellip;]
+
  sea​​rchlabel = [... ]
}}</td>
+
}} </ font>
</tr>
+
</ tr>
</table>
+
</ table>
 
}}
 
}}
<div style="display: none; read: none;">
+
<div style="display: none;"> none; read:
[[master page::{{{master page}}}]] [[language code::{{{language}}}]] [[Content language::{{{language}}}]]
+
[หน้าหลัก [::{{{ หลักหน้า }}}]] [[ภาษารหัส ::{{{ ภาษา }}}]] [[เนื้อหาภาษา }}}]] ภาษา ::{{{
</div></includeonly>
+
</ font> </ includeonly>

Revision as of 01:07, 27 May 2011

นี่คือ"'ภาษา "แม่แบบ แก้ไขหน้าเว็บเพื่อดูข้อความแม่แบบ <! -- เขียนโดย : <http://libreplanet.org/wiki/User:Alexus> alexus Revision : 2.0 วันที่ : 25/01/2011 -->

'คำอธิบาย

แม่แบบนี้จะแสดงแถบการเชื่อมโยงไปยังการแปลที่ใช้ได้ของหน้า ใช้งานได้เฉพาะสำหรับหน้าเว็บ (ควรเป็น"ต้นฉบับ"หน้าหลักและการแปล) ซึ่งรวมถึงแม่ตัวเองนี้

แม่แบบนี้ควรจะรวมทั้งใน"ต้นฉบับ"หน้าหลักและในทุกการแปล, เฉพาะในกรณีที่เกือบหนึ่งในการแปลหน้าหลักจริงๆอยู่ในวิกิพีเดีย

นอกจากนี้ยังตั้ง'รหัสภาษา'คุยเกี่ยวกับคุณสมบัติของหน้าเว็บที่แม่ตัวเองได้รับการบันทึกไว้ (ดูด้านล่าง)

แม่แบบนี้เป็นการเรียก :

  • "LanguageOtherMsg"Sub - แม่แบบ
  • "LanguageNativeLink"Sub - แม่แบบ

'การใช้งาน

มันควรจะเรียกว่าในรูปแบบดังต่อไปนี้

Template:ภาษา
</ pre>
ที่ :
<MasterPage> * คือ"ต้นฉบับ"หน้าหลัก
<LangCode> * คือ (ตัวพิมพ์เล็ก 2 หลัก) รหัสภาษา (ISO 639-1) ของเนื้อหาในหน้าแม่แบบที่ตัวเองได้รับการบันทึกไว้ (ไม่ว่าถ้าเป็น"ต้นฉบับ"หน้าหลักหรือหนึ่งในการแปล )

  หมายเหตุ -- ชุดนี้ยัง'รหัสภาษา'คุยเกี่ยวกับคุณสมบัติและ'ภาษาเนื้อหา'ของหน้าโทรไปยังพารามิเตอร์ของ <LangCode>

'ตัวอย่าง 

ถ้า"ต้นฉบับ"หน้าโท MyPage'จะเขียนเป็นภาษาอังกฤษ (เป็นมากมักจะเป็น) และจะมีการแปลภาษาอิตาลีที่ MyPage หน้า'/ มัน"แล้ว :
* ลงใน'MyPage', รวมถึงการใช้ :
Template:ภาษา
</ pre>
* ใน'MyPage / IT'รวมนี้ :
Template:ภาษา
</ pre>
</ noinclude> {{#