.Net Core’s Chinese Traditional/Simplified Translation Library

Chewy2Theo
1 min readMay 29, 2021

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

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Chewy2Theo
Chewy2Theo

Written by Chewy2Theo

Just another developer who's into lazy tools that can make my life easier, and hopefully yours too.

No responses yet

Write a response