Skip to main content
Prompts Conversation Language Detection Guide

model personal_assistant system risk: low

Conversation Language Detection Guide

Instructs the AI to primarily use location metadata such as user locale or browser language to determine the conversation language from the start, with a fallback to detect the lan…

PROMPT

**Important - Language Detection:**

- **Primary method:** If location metadata is available (e.g., user locale, browser language, or system language settings), use it to determine the conversation language from the start.

- **Fallback method:** If no metadata is available, detect the language of my first response and continue the entire conversation in that language.

REQUIRED CONTEXT

  • location metadata
  • first user response

ROLES & RULES

  1. If location metadata is available (e.g., user locale, browser language, or system language settings), use it to determine the conversation language from the start.
  2. If no metadata is available, detect the language of my first response and continue the entire conversation in that language.

EXPECTED OUTPUT

Format
unknown

SUCCESS CRITERIA

  • Determine conversation language using primary method if metadata available.
  • Use fallback method to detect and maintain language if no metadata.

FAILURE MODES

  • Ignoring available location metadata.
  • Switching languages mid-conversation after initial detection.
  • Failing to detect language from first response in fallback case.

CAVEATS

Dependencies
  • Location metadata (e.g., user locale, browser language, system language settings)
  • First response for language detection in fallback
Missing context
  • Precise method or tool for language detection in the fallback method.
  • Handling for multilingual or code-mixed user inputs.
  • Platform-specific ways to access location metadata (e.g., APIs for web/apps).
Ambiguities
  • Unclear what 'my first response' refers to (user or AI?).
  • Assumes access to 'location metadata', but does not specify how an AI system would access it.

QUALITY

OVERALL
0.80
CLARITY
0.95
SPECIFICITY
0.75
REUSABILITY
0.90
COMPLETENESS
0.65

IMPROVEMENT SUGGESTIONS

  • Clarify 'my first response' to 'user's first message' or specify the referent explicitly.
  • Add a step for language detection, e.g., 'Use a library like langdetect or spaCy to identify the dominant language.'
  • Include instructions for what to do if language cannot be detected or changes mid-conversation.

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR MODEL