icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Rename private::Key and other::Key to Subtag or PrivateSubtag/OtherSubtag

Open sffc opened this issue 3 years ago • 2 comments
trafficstars

Feedback from @markusicu, which I very much agree with, is to rename icu::locid::extensions::private::Key and ::other::Key to Subtag instead of Key. Markus says that the spec does not make any statements on the structure of the content of these regions, so it would be a misnomer to call them "keys".

We should at least rename them to Subtag instead of Key. I hope this part is not controversial.

A larger change @markusicu suggested goes back to the suggestion in #2512 to give each type a more specific name. Instead of extensions::other::Subtag, it should be extensions::other::OtherSubtag or just extensions::OtherSubtag.

I am inclined to follow the recommendation from #2512 to keep the nested type names but improve our style guide and documentation around that.

@zbraniecki SGTY?

sffc avatar Sep 17 '22 01:09 sffc

I'm comfortable with the change to Subtag.

I don't think I agree with the OtherSubtag - I prefer other::Subtag - but it's an arbitrary DX preference either way, so won't block if the group prefers to rename. I'd prefer not to expose them directly on extensions::* - I think it works really clean that each type is inside extensions::*::*.

zbraniecki avatar Sep 17 '22 01:09 zbraniecki

I agree with Zibi, we already have extensions::Other which is the wrapper, OtherSubtags shouldn't be on the same level as that's not how Unicode and Transform work.

robertbastian avatar Sep 19 '22 17:09 robertbastian