Fix outdated administrative districts in zh_TW provider - #1063
Open
cscolabear wants to merge 2 commits into
Open
Fix outdated administrative districts in zh_TW provider#1063cscolabear wants to merge 2 commits into
cscolabear wants to merge 2 commits into
Conversation
bram-pkg
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the reason for this PR?
The
zh_TWaddress provider contains four outdated or incorrect Taiwanese administrative district entries.Applications that match generated addresses against current postal-code or government datasets can fail when Faker returns these obsolete values. This was observed in a downstream test suite where an obsolete district name could not be mapped to a current postal code.
This is a locale data correction only. It does not change any public formatter, API, or address format.
Author's checklist
Summary of changes
Replace
苗栗縣頭份鎮with苗栗縣頭份市.Replace
彰化縣員林鎮with彰化縣員林市.Replace the former Tainan
中區and西區entries with中西區.Replace the duplicate Kaohsiung
三民區entry representing the former Sanmin Township with那瑪夏區.Add deterministic regression tests that:
Official references
Toufen Township → Toufen City, effective October 5, 2015
https://www.yuanli.gov.tw/News_Content.aspx?n=7490&s=363591
Yuanlin Township → Yuanlin City, effective August 8, 2015
https://www.chcg.gov.tw/TSO/yuanlin/07other/main.aspx?main_id=30945
Tainan Central District and West District → West Central District, effective January 1, 2004
https://www.tainan.gov.tw/cp.aspx?n=13293
Sanmin Township → Namasia Township / Namasia District
https://namasia.kcg.gov.tw/cp.aspx?n=4EB440357F53E6F1
Validation
The following commands completed successfully:
make csmake testRegression coverage was added in:
test/Provider/zh_TW/AddressTest.phpThe tests verify both the expected replacements and the absence of duplicate administrative districts.
Compatibility impact
This PR intentionally changes four values that may be generated by the
zh_TWprovider.Applications, snapshots, or seeded fixtures that explicitly expect the obsolete district names may observe different generated values. However, the replacements reflect the current official administrative divisions and improve compatibility with current postal-code and government datasets.
No formatter, API, address structure, or random-generation behavior is changed.
Review focus
The functional change is limited to:
src/Provider/zh_TW/Address.phptest/Provider/zh_TW/AddressTest.phpThe main review points are:
2.0branch.Backport
The same obsolete data exists in the
1.24branch and affects projects usingfakerphp/fakerv1.24.1.Review checklist
CHANGELOG.md