From cb0ec990ab6a38cf3a2dbfe360b8a72a52639363 Mon Sep 17 00:00:00 2001 From: "DESKTOP-3BO4HSG\\ksat" Date: Sat, 24 Dec 2022 11:41:52 +0800 Subject: [PATCH] fix: repair of small humps --- STranslate/ViewModel/MainVM.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/STranslate/ViewModel/MainVM.cs b/STranslate/ViewModel/MainVM.cs index 9f663f9..363bf67 100644 --- a/STranslate/ViewModel/MainVM.cs +++ b/STranslate/ViewModel/MainVM.cs @@ -109,6 +109,9 @@ namespace STranslate.ViewModel } OutputTxt = translateResp; + //如果不是英文则不进行转换 + if (LanguageEnumDict[OutputComboSelected] != LanguageEnum.EN) return; + var splitList = OutputTxt.Split(' ').ToList(); if (splitList.Count > 1) { @@ -116,6 +119,7 @@ namespace STranslate.ViewModel SmallHumpRet = GenHumpString(splitList, true); //小驼峰 LargeHumpRet = GenHumpString(splitList, false); //大驼峰 } + //System.Diagnostics.Debug.Print(SnakeRet + "\n" + SmallHumpRet + "\n" + LargeHumpRet); } catch (Exception ex) { @@ -153,7 +157,7 @@ namespace STranslate.ViewModel { char[] chars = array[j].ToCharArray(); if (j == 0 && isSmallHump) chars[0] = char.ToLower(chars[0]); - chars[0] = char.ToUpper(chars[0]); + else chars[0] = char.ToUpper(chars[0]); for (int i = 1; i < chars.Length; i++) { chars[i] = char.ToLower(chars[i]);