LanguageInfo has a property for getting the Secondary info, but no way to get just the primary info. So far, the best way to get the primary info (without mutating the original) is as follows:
Copy the combined LanguageInfo using LanguageInfo.Parse(lang.Tag)
Set Secondary to null on the copy
While this works, it's super clunky, and the lack of a copy constructor exacerbates the issue by requiring the LanguageInfo to be parsed again.
Proposal
Add the following to LanguageInfo:
public LanguageInfo(string language, string? region, string? variant, LanguageInfo? secondary = null);
public LanguageInfo GetPrimary();
LanguageInfo
has a property for getting theSecondary
info, but no way to get just the primary info. So far, the best way to get the primary info (without mutating the original) is as follows:LanguageInfo
usingLanguageInfo.Parse(lang.Tag)
Secondary
tonull
on the copyWhile this works, it's super clunky, and the lack of a copy constructor exacerbates the issue by requiring the
LanguageInfo
to be parsed again.Proposal
Add the following to
LanguageInfo
: