Skip to content

Commit

Permalink
Merge pull request #79 from Shopify/sar_china_rename_2024-01-31
Browse files Browse the repository at this point in the history
Prefer "SAR" over "SAR China"
  • Loading branch information
cejaekl authored Jan 31, 2024
2 parents aa9b912 + 295f33f commit 70e6dee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

- Prefer "SAR" over "SAR China" in Chinese-language names for regions `HK` and `MO`. [#79](https://github.com/Shopify/worldwide/pull/79).
- Add Worldwide::Field.valid_key? method. [#80](https://github.com/Shopify/worldwide/pull/80)

---
Expand Down
4 changes: 2 additions & 2 deletions data/cldr/locales/zh/territories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ zh:
GU: 关岛
GW: 几内亚比绍
GY: 圭亚那
HK: 中国香港特别行政区
HK: 香港特别行政区
HM: 赫德岛和麦克唐纳群岛
HN: 洪都拉斯
HR: 克罗地亚
Expand Down Expand Up @@ -186,7 +186,7 @@ zh:
ML: 马里
MM: 缅甸
MN: 蒙古
MO: 中国澳门特别行政区
MO: 澳门特别行政区
MP: 北马里亚纳群岛
MQ: 马提尼克
MR: 毛里塔尼亚
Expand Down
6 changes: 6 additions & 0 deletions rake/cldr/patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,12 @@ def perform
[:CI, "Côte d’Ivoire", "आयव्हरी कोस्ट"],
])

# Prefer the phrasing "Hong Kong SAR" and "Macau SAR"
patch_territories(:zh, [
[:HK, "中国香港特别行政区", "香港特别行政区"],
[:MO, "中国澳门特别行政区", "澳门特别行政区"],
])

# Should use capitalized letters for territories in UI list context, by default.
# https://github.com/Shopify/shopify-i18n/issues/1551
patch_file(:root, "context_transforms.yml", [:context_transforms, :territory, :ui_list_or_menu], nil, "titlecase_first_word", allow_file_creation: true)
Expand Down
2 changes: 1 addition & 1 deletion test/worldwide/address_formatting_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ class AddressFormattingTest < ActiveSupport::TestCase
zip: "999077", # this code is assigned by China Post for all of HK; it's not recognized by HK Post
}

expected = "中国香港特别行政区九龙马里兰法院"
expected = "香港特别行政区九龙马里兰法院"
I18n.with_locale(:"zh-CN") do
actual = Worldwide.address(**address).single_line

Expand Down

0 comments on commit 70e6dee

Please sign in to comment.