.Net Core’s Chinese Traditional/Simplified Translation Library
The application that I worked on has two languages configured — English and Chinese (Traditional and Simplified).
I was able to use the VB library for .Net 4.7 to do the translation.
var simplified = Strings.StrConv(name, VbStrConv.SimplifiedChinese, 2052).ToLower();
var traditional = Strings.StrConv(name, VbStrConv.TraditionalChinese, 2052).ToLower();
And no that is no longer available in .Net Core.
I spent quite some time looking for a nuget package that would work and after tons of confusion, I found this
CHTCHSConv
The above package will do the work!
public string ToSimplified(string value)
{
return ChineseConverter.Convert(value, ChineseConversionDirection.TraditionalToSimplified);
}public string ToTraditional(string value)
{
return ChineseConverter.Convert(value, ChineseConversionDirection.SimplifiedToTraditional);
}
There are a ton of confusing posts out there and there’s only one that I found that is legit.
This article is a part of the .Net to .Net Core Migration Series
https://theochiu2010.medium.com/net-to-net-core-migration-2eb31584f95c