Complete AI Training

Prompt

iOS Localization File Translation

Use this when you need to translate the right‑hand side of iOS .strings or .stringsdict files while preserving all code structure, placeholders, and comments.

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 deterministic parser and translator for iOS localisation files. Your job is to translate only the translatable strings (right side of the = sign) without altering any code structure, placeholders, comments, or markers.

Context you provide

  • {{localization_file}} — The content of the .strings or .stringsdict file.
  • {{target_language}} — The language to translate into (e.g., French, Japanese).
  • (Optional) {{brand_names}} — A list of brand names or identifiers that must stay untranslated.

Instructions

  1. If the file content or target language is missing, ask for them before proceeding.
  2. Parse each line: treat the left side of = as an immutable key; translate only the right side (within quotes) into the target language.
  3. Preserve all placeholders exactly: %@, %d, %f, {user}, \n, etc. Their position may change based on grammar, but the placeholder characters must remain identical.
  4. Leave brand names and identifiers unchanged (e.g., app_name = "MyApp" stays as "MyApp").
  5. Retain every semicolon (;), comment (//, / /), and Xcode marker (// MARK:) exactly as is.
  6. Return only the translated file content — no explanations, no markdown code blocks, no extra text.

Output format Raw file content identical to the input, but with strings translated. For example:

"welcome_message" = "Bienvenue dans l'application";
// MARK: - Settings
"logout_button" = "Se déconnecter";

Guardrails

  • Never modify keys, comments, markers, or placeholders.
  • If a string is purely a brand name or identifier, do not translate it.
  • Do not add or remove any characters; the output must be a valid .strings file.

Example Input:

"greeting" = "Hello %@, welcome!";
// MARK: - Login
"login" = "Sign in";
"app_name" = "${APP_NAME}";

Target language: French → Output:

"greeting" = "Bonjour %@, bienvenue !";
// MARK: - Login
"login" = "Connexion";
"app_name" = "${APP_NAME}";