Indytheme Support
ถาม - ตอบ => GO Variety => ข้อความที่เริ่มโดย: variety103 ที่ 14/04/17 เวลา 14:27 น.
-
(https://www.img.in.th/images/ea07c8e8bf533f94ceea0a51110af0b9.png)
ตามรูปครับ แสดงเวลาเป็น อังกฤษ พึ่งสังเกต เลยมาดูใน DEMO แสดงเป็นภาษาไทย
แก้ตรงไหนครับ
-
สำหรับคนที่เป็นเหมือนผม หรือ ไม่เป็น ก้ทำไวเพื่อคนไม่เข้าใจ ;D
เข้าไปที่ไฟล์ wp-includes\class-wp-locale.php
หา
// The Months
$this->month['01'] = /* translators: month name */ __( 'January' );
$this->month['02'] = /* translators: month name */ __( 'February' );
$this->month['03'] = /* translators: month name */ __( 'March' );
$this->month['04'] = /* translators: month name */ __( 'April' );
$this->month['05'] = /* translators: month name */ __( 'May' );
$this->month['06'] = /* translators: month name */ __( 'June' );
$this->month['07'] = /* translators: month name */ __( 'July' );
$this->month['08'] = /* translators: month name */ __( 'August' );
$this->month['09'] = /* translators: month name */ __( 'September' );
$this->month['10'] = /* translators: month name */ __( 'October' );
$this->month['11'] = /* translators: month name */ __( 'November' );
$this->month['12'] = /* translators: month name */ __( 'December' );
แก้เป็น
// The Months
$this->month['01'] = /* translators: month name */ __( ' มกราคม' );
$this->month['02'] = /* translators: month name */ __( 'กุมภาพันธ์' );
$this->month['03'] = /* translators: month name */ __( 'มีนาคม' );
$this->month['04'] = /* translators: month name */ __( 'เมษายน' );
$this->month['05'] = /* translators: month name */ __( 'พฤษภาคม' );
$this->month['06'] = /* translators: month name */ __( 'มิถุนายน' );
$this->month['07'] = /* translators: month name */ __( 'กรกฎาคม' );
$this->month['08'] = /* translators: month name */ __( 'สิงหาคม' );
$this->month['09'] = /* translators: month name */ __( 'กันยายน' );
$this->month['10'] = /* translators: month name */ __( 'ตุลาคม' );
$this->month['11'] = /* translators: month name */ __( 'พฤศจิกายน' );
$this->month['12'] = /* translators: month name */ __( 'ธันวาคม' );
-
วิธีช้างต้นก็ใช้ได้ครับ แต่มันจะเป็นการ hard code เกินไป คือ อาจจะเปลี่ยนไปมาระหว่างไทย-อังกฤษได้ลำบาก
วิธีก็คือให้ลูกค้าลงภาษาไทยเพิ่มลงใน wordpress ซึ่งผมคิดว่า ตอนนี้ลูกค้าน่าจะใช้เป็น version อังกฤษอยู่ครับ