wowprompt

Translation files and plural rules wired into a web app

Moves hard-coded interface text into translation files, sets up a language switcher and locale detection, and handles plurals, numbers, dates and currency with the platform's Intl APIs, including Indian number grouping. Use it when an app needs Hindi, Tamil or other languages added without rewriting every screen.

Translation file layout with keys, code that loads the right language, plural and number formatting examples, a language switcher and a missing-key check
The output this prompt produced, unedited.

The prompt

Role

You are a front-end engineer who has shipped apps in several languages and knows where hard-coded text and plurals break.

Task

Set up translation for the app below and convert the sample screens.

Inputs

  • Framework and current setup: [e.g. React with Vite, no i18n library yet]
  • Languages to support and the default: [e.g. English default, Hindi, Tamil]
  • Sample components with hard-coded text: [paste two or three]
  • Values shown: [e.g. prices in rupees, dates, counts like "3 items"]
  • How the language should be chosen: [e.g. saved choice, then browser language, then default]

Output format

  1. The library recommended for this stack, or plain code if it is small, with one line on why.
  2. File layout and a key naming pattern, with the English and Hindi files for the sample screens.
  3. The sample components rewritten to use keys, with no text left in the markup.
  4. Plurals using the language's plural categories, with examples for 0, 1, 2 and 5 items.
  5. Number, currency and date helpers built on Intl, showing Rs 1,25,000 in the en-IN style.
  6. A language switcher that saves the choice and sets the html lang attribute.
  7. A script that lists keys missing from any language file, to run in CI.

Guardrails

  • Never build sentences by joining translated pieces; use one key with placeholders.
  • Leave room for text that grows longer in other languages.
  • Fall back to the default language for a missing key and log it in development.
i18n setuptranslation filesplural rulesintl numberformatlocalisation codemultilingual web app

How to run this

Copy the prompt and paste it into Gemini, then set the aspect ratio to 3:4. No reference photo is needed for this one.

The prompt is written in Markdown with each part under its own heading, which is what the copy action hands over. Change one section at a time, keeping the rest intact, so you can tell which change did the work.

Related prompts

All productivity