mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-12-01 01:05:10 +08:00
fix(settings): map unknown UI locales to en-US for commit prompts
Portuguese and other interface languages have no commit prompt catalog; sending pt-BR made settings fail to deserialize. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
c0d5f9a815
commit
127cf8b883
5 files changed
+56
-12
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { api, pluginText, type CommitSettingsView } from "../../shared/api";
|
||||
import { commitPromptLocale } from "../../i18n/runtime";
|
||||
import { useI18n } from "../../i18n/store";
|
||||
import { useAppStore } from "../../shared/store/appStore";
|
||||
import { Button } from "../../shared/ui/Button";
|
||||
@@ -33,11 +34,12 @@ export function CommitSettingsCard() {
|
||||
void (async () => {
|
||||
try {
|
||||
let loaded = await api.commitSettings(locale);
|
||||
if (!loaded.prompt.trim() && loaded.prompt_locale !== locale) {
|
||||
const promptLocale = commitPromptLocale(locale);
|
||||
if (!loaded.prompt.trim() && loaded.prompt_locale !== promptLocale) {
|
||||
loaded = await api.setCommitSettings({
|
||||
model_id: loaded.model_id,
|
||||
prompt: "",
|
||||
prompt_locale: locale,
|
||||
prompt_locale: promptLocale,
|
||||
});
|
||||
}
|
||||
if (active) {
|
||||
@@ -97,7 +99,7 @@ export function CommitSettingsCard() {
|
||||
return api.setCommitSettings({
|
||||
model_id: modelId,
|
||||
prompt: normalizedPrompt,
|
||||
prompt_locale: locale,
|
||||
prompt_locale: commitPromptLocale(locale),
|
||||
});
|
||||
},
|
||||
[view, locale],
|
||||
|
||||
Reference in new issue
Block a user