From 0a0cecf178cf6c6b1f3e0d54ad7287160a50cde8 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Tue, 16 Jun 2026 12:14:05 -0400 Subject: [PATCH] feat: section Profil (langue) + ghost text lie a la langue - 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 --- frontend/editor-poc.html | 13 +++++++++---- frontend/index.html | 35 +++++++++++++++++++++++++++++++++++ frontend/js/config.js | 29 +++++++++++++++++++++++++++++ frontend/style.css | 13 +++++++++++++ 4 files changed, 86 insertions(+), 4 deletions(-) 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 +
  • + ๐Ÿ‘ค Profil +
  • ๐Ÿ“ฆ A propos + +
    +

    ๐Ÿ‘ค Profil utilisateur

    +

    + Preferences personnelles pour personnaliser + l'experience ObsiGate. +

    +
    +
    + + + Utilisee par l'autocompletion et le ghost text. +
    +
    + + +
    + + +
    +
    +