feat: section Profil (langue) + ghost text lie a la langue
CI / lint (push) Failing after 10s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Failing after -4s

- Section Profil dans Configuration: langue (fr/en/es/de), nom
- Persistance localStorage (obsigate-lang, obsigate-name)
- Ghost text adapte le prompt a la langue du profil
- CSS profile-form, config-select stylise
This commit is contained in:
2026-06-16 12:14:05 -04:00
parent 2d03586ae0
commit 0a0cecf178
4 changed files with 86 additions and 4 deletions
+9 -4
View File
@@ -1822,19 +1822,24 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
var lastChar = fullText.slice(-1);
var midWord = /[a-zA-Z0-9\u00C0-\u024F]$/.test(lastChar);
// Get user's preferred language
var lang = 'fr';
try { lang = localStorage.getItem('obsigate-lang') || 'fr'; } catch(e) {}
var langNames = { fr: 'French', en: 'English', es: 'Spanish', de: 'German' };
var langName = langNames[lang] || 'French';
var prompt, inputText;
if (midWord) {
var wordMatch = fullText.match(/([\w\u00C0-\u024F]+)$/);
var partialWord = wordMatch ? wordMatch[1] : fullText;
inputText = partialWord;
// Provide surrounding context so the model can guess the word
var context = fullText.slice(0, -partialWord.length).trim();
prompt = 'Complete this French word. The word is: "' + partialWord +
prompt = 'Complete this ' + langName + ' word. The word is: "' + partialWord +
'". Context: "' + (context || '(start of line)') +
'". Return ONLY the remaining letters of the word. Example: if word is "famil" return "ial" for "familial". Do NOT add spaces.';
'". Return ONLY the remaining letters. Do NOT add spaces. Example: "famil" → "ial" for "familial".';
} else {
inputText = fullText;
prompt = 'Continue this text. Return ONLY the new text (do NOT repeat what is already written):\n' + fullText;
prompt = 'Continue this ' + langName + ' text naturally. Return ONLY the new text (do NOT repeat):\n' + fullText;
}
fetch('/api/ai/inline-complete', {