Skip to content

Fix zh-CN abbreviations for hectare and nautical mile - #1750

Open
HuzaifaChaudary wants to merge 1 commit into
angularsen:masterfrom
HuzaifaChaudary:fix/zh-cn-hectare-nautical-mile
Open

HuzaifaChaudary wants to merge 1 commit into
angularsen:masterfrom
HuzaifaChaudary:fix/zh-cn-hectare-nautical-mile

Conversation

@HuzaifaChaudary

@HuzaifaChaudary HuzaifaChaudary commented Oct 22, 2026 •

Copy link
Copy Markdown

two zh-CN abbreviations were the name of a different unit , which made them ambiguous , and the generated tests had that ambiguity written in as expected :

unit before after
Hectare 英亩 ( acre , same as Acre ) 公顷
NauticalMile 纳米 ( nanometer , same as the generated Nanometer ) 海里

so Length.Parse("1 纳米", zh-CN) threw AmbiguousUnitParseException between a nanometer and a nautical mile , and Area.Parse("1 英亩", zh-CN) between acre and hectare . the change is the two strings in Area.json and Length.json , the rest is generate-code output : the ParseWithAmbiguousAbbreviation cases for them are gone and the normal parse cases are generated instead . UnitsNet.Tests on net10.0 , macOS : 52574 passed , the 2 FeetInchesTests de-CH failures happen on master too .

found by listing every abbreviation that maps to two units of the same quantity in the generated .restext files . one more is left alone because I can't judge it : ru-RU NauticalMile is мил , the same as ru-RU Mil . a Russian speaker would know the usual short form .

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants