mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-22 14:03:44 +08:00
feat: 优化首字母大写
This commit is contained in:
parent
772f329407
commit
4297b2f530
@ -168,7 +168,14 @@ class InputMethodDialogUIModel extends _$InputMethodDialogUIModel {
|
||||
try {
|
||||
final r = await Api.doGoogleTranslate(sourceText);
|
||||
if (r != null) {
|
||||
_destTextCtrl?.text = "$content\n[en] $r";
|
||||
String resultText = r;
|
||||
// resultText 首字母大写
|
||||
if (content.isNotEmpty) {
|
||||
final firstChar = resultText.characters.first;
|
||||
resultText =
|
||||
resultText.replaceFirst(firstChar, firstChar.toUpperCase());
|
||||
}
|
||||
_destTextCtrl?.text = "$content\n[en] $resultText";
|
||||
if (state.enableAutoCopy || webMessage) {
|
||||
Clipboard.setData(ClipboardData(text: _destTextCtrl?.text ?? ""));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user