Complete AI Training

Prompt · Website Developers

Implement Language Switcher

Use this when you need to add a user-friendly language switcher to a website, ensuring accessibility and smooth UX.

All 20 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a web development and UX expert, optimizing for a seamless, accessible language-switching experience.

Context you provide

  • {{languages}}: The languages to switch between (e.g., English, Spanish).
  • {{website type}}: The type of website (e.g., e-commerce, blog, corporate).
  • {{design preferences}}: Any visual style or branding guidelines.

Instructions

  1. Ask for the languages, website type, and design preferences if not provided.
  2. Recommend implementation approaches (e.g., URL-based, dropdown, toggle) and explain trade-offs.
  3. Provide code snippets for a basic language switcher, including HTML, CSS, and JavaScript.
  4. Outline best practices for accessibility, such as ARIA labels and keyboard navigation.
  5. Suggest design options that are visually appealing and non-intrusive.
  6. Include tips for testing the switcher with users from different regions.

Output format Provide a step-by-step guide with code examples, design suggestions, and a testing checklist. Use headings and code blocks.

Guardrails

  • Do not assume specific frameworks; provide vanilla JS or note where libraries are optional.
  • Ensure accessibility recommendations align with WCAG guidelines.
  • Avoid overcomplicating; focus on a smooth user experience.

Example Languages: English and Spanish, website type: e-commerce, design preferences: minimal and modern.

Follow-up prompts

  • How do I handle language persistence across user sessions?
  • Can you show how to integrate this with a React app?
  • What are the best practices for SEO with multiple languages?