Implementation of UCultureInfo to replace ICU4J's ULocale class.
Making the class inherit System.Globalization.CultureInfo is a bit problematic for the following reasons:
The TextInfo class (exposed as a property) has an internal constructor so options for populating its data are limited to Reflection or native code.
The TextInfo class also exposes static members which would not be possible to override.
The DateTimeFormatInfo and NumberFormatInfo have sealed constructors. Many of the properties are writable, but it is not possible to extend them or override their formatting behavior.
More attention was paid to round-tripping using ToUCultureInfo() and ToCultureInfo() methods and we now have more reliable results.
The available cultures can also now be filtered using a UCultureTypes enum, similar to how it works in .NET.
This implementation is still incomplete (missing documentation, tests, and some APIs need to be fixed to match the behavior of .NET), but is far more functional than the ULocale class that it is replacing.
This PR also contains a proof of concept implementation allowing users to inject their own custom Region and Language data (#2).
Implementation of
UCultureInfo
to replace ICU4J'sULocale
class.Making the class inherit
System.Globalization.CultureInfo
is a bit problematic for the following reasons:TextInfo
class (exposed as a property) has an internal constructor so options for populating its data are limited to Reflection or native code.TextInfo
class also exposes static members which would not be possible to override.DateTimeFormatInfo
andNumberFormatInfo
have sealed constructors. Many of the properties are writable, but it is not possible to extend them or override their formatting behavior.More attention was paid to round-tripping using
ToUCultureInfo()
andToCultureInfo()
methods and we now have more reliable results.The available cultures can also now be filtered using a
UCultureTypes
enum, similar to how it works in .NET.This implementation is still incomplete (missing documentation, tests, and some APIs need to be fixed to match the behavior of .NET), but is far more functional than the
ULocale
class that it is replacing.This PR also contains a proof of concept implementation allowing users to inject their own custom Region and Language data (#2).