ขอบคุณ คุณ Slotpro ครับ
ใครจะช่วยคุณ Slotpro ทำเพิ่มก็ ลงมือเลยนะครับ ผมแนะนำเพิ่มเติมครับ
วิธีการที่ถูกต้อง ควรทำไฟล์ภาษาเป็น Plugin ของ CB ซึ่งจะสามารถติดตั้งผ่านทางเมนู การจัดการ Plugin ของ CB ได้ โดยไม่ต้องไป copy ไฟล์ทับ ซึ่งถ้าทับไปแล้ว จะทำให้ CB มีเมนูเป็นภาษาไทยได้อย่างเดียว เท่านั้น ไม่สามารถสลับภาษาได้ ตามภาษาที่ user เลือก (Joomla 1.5 user แต่ละคนเลือกภาษาของตัวเองได้)
พอดีไฟล์ที่คุณ Slotpro ทำมา ไม่ใช่ไฟล์ภาษาของ CB 1.1 ที่เป็นเวอร์ชั่นที่แจกอยู่ ซึ่งน่าจะเป็นเวอร์ชั่น RC ที่แจกสำหรับสมาชิกที่ ชำระเงิน เท่านั้น
การสร้างไฟล์ Plugin ภาษา สำหรับ CB โครงสร้างจะเป็นดังนี้
Quote:
[-]thai (folder) ต้นฉบับจาก /components/com_comprofiler/plugin/language/default_language
- calendar-locals.js
- thai.php (แปลจากไฟล์ default_langauge.php)
- thai.xml (เปลี่ยนจากไฟล์ default_langauge.xml)
[-] images (folder)
- index.html
- nophoto.jpg
- pendphoto.jpg
- tnnophoto.jpg
- tnpendphoto.jpg
- index.html
ตัวอย่างในไฟล์ xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<cbinstall version="1.2" type="plugin" group="language">
<name>thai</name>
<author>Slotpro and JoomlaCorner</author>
<creationDate>06-Nov-2008</creationDate>
<copyright>(C) 2005 - 2008 joomlacorner.com</copyright>
<license>http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU/GPL version 2</license>
<authorEmail>ninekrit@gmail.com</authorEmail>
<authorUrl>www.joomlacorner.com</authorUrl>
<version>1.2 RC 3</version>
<description>Provides the Thai language for Community Builder core functions.</description>
<files>
<filename plugin="thai">thai.php</filename>
<filename>index.html</filename>
<filename>calendar-locals.js</filename>
<filename>images/index.html</filename>
<filename>images/nophoto.jpg</filename>
<filename>images/pendphoto.jpg</filename>
<filename>images/tnnophoto.jpg</filename>
<filename>images/tnpendphoto.jpg</filename>
</files>
<params>
</params>
<database>
</database>
</cbinstall>
จุดสำคัญในไฟล์นี้ คือ ตรง element <version>
1.2 RC 3</version> ต้องใส่ให้ตรงกับ เวอร์ชั่นของ CB ที่ใช้อยู่ครับ ถ้าไม่ตรงก็จะติดตั้งไม่ผ่าน
calendar-locals.js
Code:
// ** I18N
// Calendar TH language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Encoding: any
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("อาทิตย์",
"จันทร์",
"อังคาร",
"พุธ",
"พฤหัสบดี",
"ศุกร์",
"เสาร์",
"อาทิตย์");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
Calendar._SDN = new Array
("อา.",
"จ.",
"อ.",
"พ.",
"พฤ.",
"ศ.",
"ส.",
"อา.");
// First day of the week. "0" means display Sunday first, "1" means display
// Monday first, etc. //BB calendar week number is ok only when Monday is FDoW:
Calendar._FD = 1;
// full month names
Calendar._MN = new Array
("มกราคม",
"กุมภาพันธ์",
"มีนาคม",
"เมษายน",
"พฤษภาคม",
"มิถุนายน",
"กรกฎาคม",
"สิงหาคม",
"กันยายน",
"ตุลาคม",
"พฤศจิกายน",
"ธันวาคม");
// short month names
Calendar._SMN = new Array
("ม.ค.",
"ก.พ.",
"มี.ค.",
"เม.ย.",
"พ.ค.",
"มิ.ย.",
"ก.ค.",
"ส.ค.",
"ก.ย.",
"ต.ค.",
"พ.ย.",
"ธ.ค.");
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "เกี่ยวกับปฏิทิน";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Date selection:\n" +
"- Use the \xab, \xbb buttons to select year\n" +
"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
"- Hold mouse button on any of the above buttons for faster selection.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Time selection:\n" +
"- Click on any of the time parts to increase it\n" +
"- or Shift-click to decrease it\n" +
"- or click and drag for faster selection.";
Calendar._TT["PREV_YEAR"] = "ปีที่แล้ว (hold for menu)";
Calendar._TT["PREV_MONTH"] = "เดือนที่แล้ว (hold for menu)";
Calendar._TT["GO_TODAY"] = "ไปยังวันปัจจุบัน";
Calendar._TT["NEXT_MONTH"] = "เดือนถัดไป (hold for menu)";
Calendar._TT["NEXT_YEAR"] = "ปีถัดไป (hold for menu)";
Calendar._TT["SEL_DATE"] = "เลือกวันที่";
Calendar._TT["DRAG_TO_MOVE"] = "ลากเพื่อย้าย";
Calendar._TT["PART_TODAY"] = " (วันนี้)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "แสดง %s ก่อน";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "ปิด";
Calendar._TT["TODAY"] = "วันนี้";
Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
Calendar._TT["WK"] = "wk";
Calendar._TT["TIME"] = "เวลา:";
ลองทำกันดูนะครับ
_________________
***** Manual signatures are NOT allowed *****
Akarawuth Tamrareang / joomlacorner ·
http://www.joomlacorner.com · GMT +7
บริษัท มาร์เวลิค เอ็นจิ้น จำกัด
http://www.marvelic.co.th ---------------------------------
Joomla! Bug Squad