Skip to content

Commit 01dbb17

Browse files
committed
Split Chinese to Simplified/Traditional for DeepL + ChatGPT (and more)
Working on #9299
1 parent 3ae571c commit 01dbb17

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/libse/AutoTranslate/ChatGptTranslate.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static string RemovePreamble(string original, string input)
3939
var indexOfStartThink = translation.IndexOf("<think>");
4040
var indexOfEndThink = translation.IndexOf("</think>");
4141
if (indexOfStartThink >= 0 && indexOfEndThink > indexOfStartThink)
42-
{
42+
{
4343
translation = translation.Remove(indexOfStartThink, indexOfEndThink - indexOfStartThink + 8).Trim();
4444
}
4545

@@ -145,7 +145,8 @@ public static List<TranslationPair> ListLanguages()
145145
MakePair("Cantonese","zh"),
146146
MakePair("Catalan","ca"),
147147
MakePair("Chhattisgarhi",""),
148-
MakePair("Chinese","zh"),
148+
MakePair("Chinese (Simplified)", "zho_Hans"),
149+
MakePair("Chinese (Traditional)","zh-Hant"),
149150
MakePair("Croatian","hr"),
150151
MakePair("Czech","cs"),
151152
MakePair("Danish","da"),

src/libse/AutoTranslate/DeepLTranslate.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ public List<TranslationPair> GetSupportedTargetLanguages()
8686
{
8787
MakeTranslationPair("Arabic", "ar"),
8888
MakeTranslationPair("Bulgarian", "bg"),
89-
MakeTranslationPair("Chinese", "zh"),
89+
MakeTranslationPair("Chinese (simplified)", "zh-hans"),
90+
MakeTranslationPair("Chinese (traditional)", "zh-hant"),
9091
MakeTranslationPair("Czech", "cs"),
9192
MakeTranslationPair("Danish", "da"),
9293
MakeTranslationPair("Dutch", "nl", true),

0 commit comments

Comments
 (0)