diff --git a/src/lib/agents/lead.ts b/src/lib/agents/lead.ts index 8595abc..518811c 100644 --- a/src/lib/agents/lead.ts +++ b/src/lib/agents/lead.ts @@ -218,7 +218,7 @@ export class LeadAgent { ] .map((m) => `- ${m}`) .join('\n'), - formOfAddress: formOfAddress(input.language) + formOfAddress: formOfAddress(input.language, input.surveyLanguage) }, signal ); diff --git a/src/lib/agents/repair_agent.ts b/src/lib/agents/repair_agent.ts index 4f60b6a..d58cf54 100644 --- a/src/lib/agents/repair_agent.ts +++ b/src/lib/agents/repair_agent.ts @@ -5,7 +5,7 @@ import { numberResearchQuestions, type Question } from './types.js'; import { extractQuestions } from './question_parser.js'; const SIGNATURE = - 'researchQuestions:string "numbered", previousQuestions:json, validationFeedback:string, formOfAddress:string "du or Sie; keep it" -> generatedQuestions:json'; + 'researchQuestions:string "numbered", previousQuestions:json, validationFeedback:string, formOfAddress:string "du, Sie (German) or you (English); keep it" -> generatedQuestions:json'; /** Built from the registry, so the repair prompt can never drift from what the * validator accepts. */ diff --git a/src/lib/agents/survey_generator.ts b/src/lib/agents/survey_generator.ts index b182600..39cbf5a 100644 --- a/src/lib/agents/survey_generator.ts +++ b/src/lib/agents/survey_generator.ts @@ -8,10 +8,15 @@ import generateInstructions from '../../../skills/xlsform/generate-instructions. // runs "language: informal" still produced "Sie", and "demographics: age" // made the model write its own age question. const SIGNATURE = - 'researchQuestions:string "numbered; cover every one and tag each question with the numbers it serves", targetGroup?:string, useOfResults?:string, furtherNotes?:string "free-form guidance from the user: things to keep short, terms to avoid, topics to focus on", formOfAddress:string "du or Sie: how every question addresses respondents", surveyLanguage:string "de or en: language of every question, label, hint, title and reasoning", demographicsAddedSeparately?:string "already in the questionnaire; do not ask about these", questionBank?:string "qwac bank questions that matched a keyword search, one per line: id | study | concept | question | answer type" -> title:string "short questionnaire title in the language of the questions", reasoning:string, generatedQuestions:json'; + 'researchQuestions:string "numbered; cover every one and tag each question with the numbers it serves", targetGroup?:string, useOfResults?:string, furtherNotes?:string "free-form guidance from the user: things to keep short, terms to avoid, topics to focus on", formOfAddress:string "du, Sie (German) or you (English): how every question addresses respondents", surveyLanguage:string "de or en: language of every question, label, hint, title and reasoning", demographicsAddedSeparately?:string "already in the questionnaire; do not ask about these", questionBank?:string "qwac bank questions that matched a keyword search, one per line: id | study | concept | question | answer type" -> title:string "short questionnaire title in the language of the questions", reasoning:string, generatedQuestions:json'; -/** "du" or "Sie", as the prompt and the model expect it. */ -export function formOfAddress(language: AgentInput['language']): string { +/** "du" or "Sie" for German, "you" for English (no formal/informal split in + * English), as the prompt and the model expect it. */ +export function formOfAddress( + language: AgentInput['language'], + surveyLanguage: AgentInput['surveyLanguage'] = 'de' +): string { + if (surveyLanguage === 'en') return 'you'; return language === 'informal' ? 'du' : 'Sie'; } @@ -45,7 +50,7 @@ export class SurveyGeneratorAgent { targetGroup: input.targetGroup, useOfResults: input.useOfResults, furtherNotes: input.furtherNotes, - formOfAddress: formOfAddress(input.language), + formOfAddress: formOfAddress(input.language, input.surveyLanguage), surveyLanguage: input.surveyLanguage, demographicsAddedSeparately: input.selectedDemographics.join(', ') || undefined, questionBank: bankHits.length ? renderBankHits(bankHits) : undefined diff --git a/src/lib/i18n.ts b/src/lib/i18n.ts index 43b8a81..e36d77a 100644 --- a/src/lib/i18n.ts +++ b/src/lib/i18n.ts @@ -70,6 +70,7 @@ const translations: Record> = { 'wizard.languageLabel': 'Language & Tone', 'wizard.formal': 'Formal (Sie)', 'wizard.informal': 'Informal (Du)', + 'wizard.formHintEnglish': 'Form of address only applies to German.', 'wizard.surveyLanguageLabel': 'Survey language', 'wizard.surveyLanguageGerman': 'German', 'wizard.surveyLanguageEnglish': 'English', @@ -231,6 +232,7 @@ const translations: Record> = { 'wizard.languageLabel': 'Sprache & Tonalität', 'wizard.formal': 'Förmlich (Sie)', 'wizard.informal': 'Informell (Du)', + 'wizard.formHintEnglish': 'Die Anrede gilt nur für deutsche Umfragen.', 'wizard.surveyLanguageLabel': 'Sprache der Umfrage', 'wizard.surveyLanguageGerman': 'Deutsch', 'wizard.surveyLanguageEnglish': 'Englisch', diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index f7d37f8..8e7b0c8 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -352,10 +352,14 @@
{$t('wizard.languageLabel')} + {#if surveyLanguage === 'en'} +

{$t('wizard.formHintEnglish')}

+ {/if}