Skip to content

Commit

Permalink
Merge pull request #1 from bbompk/i18n-th
Browse files Browse the repository at this point in the history
Added Thai language
  • Loading branch information
bbompk committed Jun 7, 2023
2 parents 15fe2b0 + aaf5347 commit 49def2c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/common/src/schema.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint dot-notation: "off"*/
import { z } from 'zod';

const langs = ['en', 'ja', 'ar'] as const;
const langs = ['en', 'ja', 'ar', 'th'] as const;
export const Lang = z.enum(langs);

export const Size = z.object({ height: z.number(), width: z.number() });
Expand Down
25 changes: 25 additions & 0 deletions packages/ui/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,33 @@ const dictAr: { [key in keyof DictEn]: string } = {
bulkUpdateFieldName: 'تغيير الأسماء',
};

const dictTh: { [key in keyof DictEn]: string } = {
cancel: 'ยกเลิก',
field: 'ฟิลด์',
fieldName: 'ชื่อฟิลด์',
require: 'จำเป็น',
uniq: 'ต้องไม่ซ้ำกัน',
inputExample: 'ตัวอย่าง',
edit: 'แก้ไข',
plsInputName: 'กรุณาใส่ชื่อ',
fieldMustUniq: 'ชื่อฟิลด์ต้องไม่ซ้ำกัน',
notUniq: '(ชื่อฟิลด์ซ้ำกัน)',
noKeyName: 'ไม่มีชื่อ',
fieldsList: 'รายการฟิลด์ทั้งหมด',
addNewField: 'เพิ่มฟิลด์ใหม่',
editField: 'แก้ไขฟิลด์',
type: 'ประเภท',
errorOccurred: 'เกิดข้อผิดพลาด',
errorBulkUpdateFieldName: 'ไม่สามารถยืนยันการแก้ไขได้เนื่องจากจำนวนรายการมีการเปลี่ยนแปลง',
commitBulkUpdateFieldName: 'ยืนยันการแก้ไข',
bulkUpdateFieldName: 'แก้ไขชื่อฟิลด์เป็นชุด',
};

const i18n = (lang: Lang, key: keyof DictEn) => {
switch (lang) {
case 'th':
return dictTh[key];

case 'ar':
return dictAr[key];

Expand Down

0 comments on commit 49def2c

Please sign in to comment.