-
-
Notifications
You must be signed in to change notification settings - Fork 946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(locale): add locale TH #1921
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## next #1921 +/- ##
==========================================
+ Coverage 99.62% 99.63% +0.01%
==========================================
Files 2357 2384 +27
Lines 236564 238369 +1805
Branches 1192 1198 +6
==========================================
+ Hits 235675 237507 +1832
+ Misses 867 840 -27
Partials 22 22
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ขอบคุณ!
Left a few comments
docs/guide/localization.md
Outdated
@@ -118,6 +118,7 @@ export const customFaker = new Faker({ | |||
| `ru` | Russian | `fakerRU` | | |||
| `sk` | Slovakian | `fakerSK` | | |||
| `sv` | Swedish | `fakerSV` | | |||
| `th` | TODO: Insert Title for th | `fakerTH` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to "Thai".
src/locales/th/index.ts
Outdated
import person from './person'; | ||
|
||
const th: LocaleDefinition = { | ||
title: 'TODO: Insert Title for th', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to Thai
src/locales/th/person/last_name.ts
Outdated
@@ -0,0 +1,172 @@ | |||
export default [ | |||
'คมคาย', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that there aren't really any common Thai surnames, so how did you select these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are mostly generated from chatGPT. I took time to filter out the unnatural ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that might be problematic, because we need data to be MIT licensed and the output of ChatGPT could contain copyrighted material https://github.com/faker-js/faker/blob/next/CONTRIBUTING.md#sourcing-data-for-definitions
An alternative might be to make some fake Thai surnames by taking syllables which commonly appear in Thai names and joining them together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will try it out!
import male_first_name from './male_first_name'; | ||
|
||
const person: PersonDefinitions = { | ||
female_first_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should also add a src/locales/th/person/name.ts to give the correct name order for Thai, ie
export default [
{ value: '{{person.firstName}} {{person.lastName}}', weight: 1 },
];
src/locales/th/cell_phone/formats.ts
Outdated
@@ -0,0 +1 @@ | |||
export default ['06 #### ####', '08 #### ####', '09 #### ####']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file is deprecated, you can also add src/locales/th/phone_number/formats.ts as well
Oops i renamed the branch and didn't think it would close the PR. Should i make a new PR? |
If it is easier for you, then yes. But please make sure to fix all comments posted here. |
No description provided.