diff --git a/src/language.ts b/src/language.ts index c1080430..37abc65c 100644 --- a/src/language.ts +++ b/src/language.ts @@ -21,6 +21,7 @@ const code = { ja: /\p{scx=Hira}|\p{scx=Kana}|[,;:]/u, ko: /\p{scx=Hangul}/u, zh: /\p{scx=Han}/u, + km: /\p{scx=Khmer}/u, th: /\p{scx=Thai}/u, bn: /\p{scx=Bengali}/u, ar: /\p{scx=Arabic}/u, diff --git a/test/language.test.tsx b/test/language.test.tsx index d450b666..8e2417c0 100644 --- a/test/language.test.tsx +++ b/test/language.test.tsx @@ -28,7 +28,11 @@ describe('detectLanguageCode', () => { it('should detect traditional chinese', async () => { expect(detectLanguageCode('我知道怎麼說中文')).toBe('zh') }) - + + it('should detect khmer', async () => { + expect(detectLanguageCode('សួស្តី')).toBe('km') + }) + it('should detect thai', async () => { expect(detectLanguageCode('สวัสดี')).toBe('th') })