diff --git a/frontend/editor-poc.html b/frontend/editor-poc.html index 3295000..18d7e53 100644 --- a/frontend/editor-poc.html +++ b/frontend/editor-poc.html @@ -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', { diff --git a/frontend/index.html b/frontend/index.html index 64a7792..6b4d7fe 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1348,6 +1348,11 @@ >๐ค IA +
+ Preferences personnelles pour personnaliser + l'experience ObsiGate. +
+