日本語→英語変換の結果は頭文字を必ず小文字にする

This commit is contained in:
4thCafe
2026-07-17 06:22:34 +09:00
parent 89758a3997
commit 85d51e8aaa
+2 -1
View File
@@ -150,8 +150,9 @@ export class TagEditor {
if (hasJapanese(tok.text)) {
// 日本語タグ → 英語に変換してテキスト欄へ反映(置換)
const res = await translateTags([tok.text], "ja", "en");
const v = res && res[0] ? res[0] : null;
let v = res && res[0] ? res[0] : null;
if (v) {
v = v.charAt(0).toLowerCase() + v.slice(1); // 頭文字は必ず小文字
setTokenText(tok, v); // タグ本体を英語へ置換
tok.__trans = undefined; // 訳表示はクリア
this._emitAndRender(); // textareaへ同期 + 再描画