Skip to content
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): improve persons and locations for zh_CN #2318

Merged
merged 14 commits into from
Aug 26, 2023

Conversation

CoolPlayLin
Copy link
Contributor

@CoolPlayLin CoolPlayLin commented Aug 14, 2023

Works

  • add two email addresses
  • fix the name of China states
  • add a lot of names, first name and last names

@CoolPlayLin CoolPlayLin requested a review from a team as a code owner August 14, 2023 13:05
@CoolPlayLin CoolPlayLin changed the title feat:(locale) Fully Improve zh_CN Locale feat(locale): Fully Improve zh_CN Locale Aug 14, 2023
@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Merging #2318 (20f66bf) into next (466b804) will increase coverage by 0.00%.
Report is 1 commits behind head on next.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff            @@
##             next    #2318    +/-   ##
========================================
  Coverage   99.60%   99.60%            
========================================
  Files        2735     2735            
  Lines      248991   249961   +970     
  Branches     1078     1082     +4     
========================================
+ Hits       247998   248985   +987     
+ Misses        966      949    -17     
  Partials       27       27            
Files Changed Coverage Δ
src/locales/zh_CN/internet/free_email.ts 100.00% <100.00%> (ø)
src/locales/zh_CN/location/state.ts 100.00% <100.00%> (ø)
src/locales/zh_CN/location/state_abbr.ts 100.00% <100.00%> (ø)
src/locales/zh_CN/person/female_first_name.ts 100.00% <100.00%> (ø)
src/locales/zh_CN/person/first_name.ts 100.00% <100.00%> (ø)
src/locales/zh_CN/person/last_name.ts 100.00% <100.00%> (ø)
src/locales/zh_CN/person/male_first_name.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@CoolPlayLin
Copy link
Contributor Author

@matthewmayer

src/locales/zh_CN/location/state.ts Outdated Show resolved Hide resolved
@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: locale Permutes locale definitions m: location Something is referring to the location module m: person Something is referring to the person module labels Aug 14, 2023
@CoolPlayLin
Copy link
Contributor Author

@ST-DDT

@CoolPlayLin
Copy link
Contributor Author

image

@CoolPlayLin CoolPlayLin removed their assignment Aug 14, 2023
src/locales/zh_TW/location/default_country.ts Outdated Show resolved Hide resolved
@CoolPlayLin
Copy link
Contributor Author

@matthewmayer

@CoolPlayLin CoolPlayLin changed the title feat(locale): Fully Improve zh_CN Locale feat(locale): Fully Improve zh_CN Aug 15, 2023
@ST-DDT ST-DDT added the s: needs decision Needs team/maintainer decision label Aug 15, 2023
@ST-DDT
Copy link
Member

ST-DDT commented Aug 15, 2023

@import-brain @matthewmayer Could you please summarize what needs to be discussed here exactly?
Otherwise it is very hard to find in the resolved review comments.

@import-brain
Copy link
Member

@import-brain @matthewmayer Could you please summarize what needs to be discussed here exactly? Otherwise it is very hard to find in the resolved review comments.

For province names in Chinese, there are multiple ways to write them--- 广西壮族自治区 (full formal name) or 广西 (commonly used name) or 桂 (one character abbreviation). I wanted to discuss how we should allocate these names between state and stateAbbr in the Chinese locale. The full formal name isn't commonly used, so I was thinking we could have the commonly used names in state and the one character abbreviations in stateAbbr, what do you think?

@CoolPlayLin
Copy link
Contributor Author

CoolPlayLin commented Aug 16, 2023

@import-brain The full name of province is really common in address. In address, it should more detailed. But I think we the 广西 is better than 桂. The abbr with two character is more known in China. This is because some of province even have more than one official abbr with one character. For instance, 云南省(Yunnan Province) could call abbr with one character as 云 or 滇. If we use such abbr, it would cause more issue and trouble need to resolve.
All in all, I recommand not use abbr with one character or come up with a way to resolve it.
CC@matthewmayer @ST-DDT

@matthewmayer
Copy link
Contributor

Right

Option A is "formal name in state, common name in stateAbbr"

Option B is "common name in state, one character name in stateAbbr"

Option C would be modifying the methods to allow for three different possible values.

@CoolPlayLin
Copy link
Contributor Author

CoolPlayLin commented Aug 16, 2023

IMO, If it would use for generate address , it must use full name of province

CC @matthewmayer @ST-DDT @import-brain

@ST-DDT
Copy link
Member

ST-DDT commented Aug 17, 2023

Team notice

We are currently internally investigating the possibilities.

@ST-DDT
Copy link
Member

ST-DDT commented Aug 24, 2023

Team decision

Short term (now):

We will use the full name for state and the common name for state_abbr

Long term (v9):

We will change the state method to return a complex object: { fullName, commonName, abbreviation } and let the user take one of those or whatever is there.

@ST-DDT ST-DDT removed the s: needs decision Needs team/maintainer decision label Aug 24, 2023
@matthewmayer
Copy link
Contributor

@CoolPlayLin please modify the state and state_abbr definitions so state returns the official name e.g. '广西壮族自治区', and state_abbr returns the short name '广西'. The one-character abbrevations like 桂 will no longer be used.

@matthewmayer matthewmayer changed the title feat(locale): Fully Improve zh_CN feat(locale): Improve person names, states, email domains for zh_CN Aug 26, 2023
@ST-DDT ST-DDT changed the title feat(locale): Improve person names, states, email domains for zh_CN feat(locale): improve persons and locations for zh_CN Aug 26, 2023
@ST-DDT ST-DDT enabled auto-merge (squash) August 26, 2023 13:12
@ST-DDT ST-DDT merged commit 87d3423 into faker-js:next Aug 26, 2023
@CoolPlayLin CoolPlayLin deleted the feat_locale_zh_CN branch August 28, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: locale Permutes locale definitions m: location Something is referring to the location module m: person Something is referring to the person module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants