Skip to content

Commit e1b9166

Browse files
committed
fix: extract hardcoded strings validateAndFixFmIndex
1 parent dac50c1 commit e1b9166

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/lang/en.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,6 +1692,9 @@ export const languageEnglish = {
16921692
convertToModule: "Convert to Module",
16931693
skipSavingAssetsOnWebSync: "Skip Saving Assets on Web Sync",
16941694
applyAdditionalParamsToAll: "Apply Additional Parameters to All Models",
1695+
validateAndFixFmIndexDesc: (fmIndex: number, altCount: number) => `The first message (index ${fmIndex}) selected for this chat does not exist.\nThis character only has ${altCount} alternate greeting(s).\n\nThe chat will automatically fall back to the default first message,\nwhich may not be what you intended.\n\nHow would you like to fix this?`,
1696+
validateAndFixFmIndexUseDefault: "Use the default first message",
1697+
validateAndFixFmIndexUseEmpty: "Use an empty first message",
16951698
} satisfies I18nTranslation;
16961699

16971700
type I18nTranslationFunction = (...args: any[]) => string;

src/lang/ko.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,4 +1510,7 @@ export const languageKorean = {
15101510
nanoGPTSelectFromList: "목록에서 선택",
15111511
nanoGPTManualInput: "수동 입력",
15121512
nanoGPTManualModelSelect: "수동 모델 선택",
1513+
validateAndFixFmIndexDesc: (fmIndex: number, altCount: number) => `이 채팅에 선택된 첫 메시지(인덱스 ${fmIndex})가 존재하지 않습니다.\n이 캐릭터는 ${altCount}개의 대체 첫 메시지를 가지고 있습니다.\n\n채팅이 기본 첫 메시지로 자동 전환되며,\n원하지 않는 결과일 수 있습니다.\n\n어떻게 수정하시겠습니까?`,
1514+
validateAndFixFmIndexUseDefault: "기본 첫 메시지 사용",
1515+
validateAndFixFmIndexUseEmpty: "비어 있는 첫 메시지 사용",
15131516
} satisfies DeepPartial<typeof import('./en').languageEnglish>

src/ts/characters.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,11 +917,11 @@ export async function validateAndFixFmIndex(charIndex: number, chatIndex: number
917917
}
918918

919919
const altCount = cha.alternateGreetings?.length ?? 0
920-
const display = `The first message (index ${fmIndex}) selected for this chat does not exist.\nThis character only has ${altCount} alternate greeting(s).\n\nThe chat will automatically fall back to the default first message,\nwhich may not be what you intended.\n\nHow would you like to fix this?`
920+
const display = language.validateAndFixFmIndexDesc(fmIndex, altCount)
921921

922922
const choice = await alertSelect([
923-
'Use the default first message ',
924-
'Use an empty first message',
923+
language.validateAndFixFmIndexUseDefault,
924+
language.validateAndFixFmIndexUseEmpty,
925925
], display)
926926

927927
if (choice === '0') {

0 commit comments

Comments
 (0)