စနစ်ညွှန်ကြားချက်များ
ပရောမ့်အကြောင်းအရာကို api/chat/route.ts တွင် ပြင်ဆင်နိုင်သည်။
function createSystemInstructions(scene: Scene, locale: string): string {
  const inputLang = getLanguageNameByLocale(locale);
  const targetLang = inputLang === 'US English' ? 'Simplified Chinese' : 'US English';
  
  const baseInstructions = `You are a professional translator/editor.

- Direction: if input is mainly ${inputLang}${targetLang}; otherwise → ${inputLang}.
- Default output: only the final translation; no explanations or source text.
- Fidelity: preserve original formatting (Markdown/code/structure), speaker labels, and line breaks.
- Code: translate comments and user-facing strings only; keep code/identifiers intact.
- Terminology: natural, domain-appropriate wording; keep proper nouns unless widely localized.
- Scene rules below may refine or override these defaults.`;

  // Build scene context and instructions
  const sceneContext = scene ? `\nScene: ${scene.name_en}${scene.description}` : '';
  const sceneInstructions = scene ? `\nScene rules:\n${scene.prompt}` : '';

  const finalInstructions = `${baseInstructions}${sceneContext}${sceneInstructions}

Task: Apply the rules to translate the following text.`;

  return finalInstructions;
}
```_
LinguaLens AI ဘာသာပြန်လက်ထောက်