Choose a local translation model for app strings by checking that it keeps every software placeholder intact and preserves the meaning a reader needs to act on. On a Mac, run the same strings through each candidate, compare the placeholders automatically, and ask a person who knows the target language to review the wording.

This guide uses short messages for a fictional inventory app. It covers English into Spanish and Japanese, with enough detail to run the same comparison on either language. You need a local app such as Ollama, one or two downloaded instruction models, and a way to review the target language. Python 3 is optional for the placeholder check. If your task is simply to translate a selected passage on your Mac, start with the built-in workflow. Translate selected text offline on Mac.

Decide which parts of the text must survive

A placeholder such as the crate identifier supplies a value when the app displays the message. The translated sentence can put the placeholder earlier or later as the target grammar requires. Keep its spelling, braces, case, and occurrence count intact. A translated word inside the braces may look natural and still break the substitution or leave the raw placeholder on screen. Repeated placeholders can also carry meaning. A bin number might appear first in an instruction and again in a label.

Record whatever else the app needs preserved. In the examples below, Bay North is the name printed on a sign and River Mint is a product name. The temperature, time, and per-pack quantity use the same spelling and units in every language because the example app expects those forms. For your own strings, decide whether the product uses local number formatting. Both a permitted formatting change and a wrong numerical value can look like changed characters in an automated check. Review the actual rule applicable to each field.

Give the model one sentence about where the text appears. A message on a screen that a warehouse worker reads calls for a direct instruction. A short button label has different space and tone constraints. If a phrase could refer to two objects, name the intended object in the translation context, then check whether the resulting sentence still points to it. Keep that context identical for all candidates.

Give every source string a stable name in your test notes, such as move crate or timer wait. Keep the name outside the text sent for translation unless the location is useful context. If your app uses the same English word in two places, make those separate examples. A word such as “open” can be a command on a button or a description of a crate’s state. Score each result against the meaning in that location. This also lets a reviewer find the right result quickly when you revise only one source string.

Shortlist models for each language direction

Start with an instruction model whose publisher documents multilingual support. Qwen’s Qwen2.5-7B-Instruct card names English, Spanish, and Japanese. Google’s Gemma 3 card describes multilingual support and publishes separate multilingual evaluations. Ollama lists local Qwen2.5 7B and Gemma 3 4B tags. These are possible test candidates. The publisher documentation helps narrow the search, and the strings below test whether a candidate meets your own localization rules. Qwen2.5-7B-Instruct model card · Gemma 3 model card · Qwen2.5 7B in Ollama · Gemma 3 4B in Ollama.

Pick a build that fits your Mac and record its exact tag and runtime version. Download the model and its prerequisites while connected. Compare candidates one at a time on the same Mac. If you need results offline, use local tags and later repeat a fresh test with Wi-Fi and any Ethernet connection disconnected. A new string with a new placeholder makes the result easier to check after reconnecting. Set up a local model in Ollama · Verify that a local AI workflow runs offline.

Run the same three strings per language

Send one string at a time in a fresh chat. Use the same instruction wording and change only the target language for the second round. Give each candidate the same source and the same expected names. Ask for only the translated string so you can copy it into a test resource file without separating it from commentary.

Translate one inventory app message into Spanish.
Copy each single-brace placeholder character for character.
Keep Bay North, River Mint, and written quantities with their
units exactly as shown. Preserve the order of actions and any
waiting condition. Return only the translated message.

Move {crate_id} to Bay North. Keep at 4 °C.
Ask {owner} before opening.

Send the same template again with each of these source strings. Then repeat all three with Japanese as the target language.

Bin {bin_id} holds {qty} packs of River Mint.
Limit each pack to 250 g. Keep {bin_id} on the label.

Do not print {label_code} until the 15 min timer ends.
Use station {station_id}.

For the first string, the crate moves to Bay North, the temperature stays at 4 °C, and the worker must ask the person represented by the owner token before opening. For the second, the quantity applies to packs of River Mint, the limit is 250 g for each pack, and the bin token occurs twice. For the third, printing must wait until the 15 min timer ends, and the station token still identifies the place to do it. Those are the expected facts, regardless of how the language expresses them politely.

For instance, a reviewer can use the following first-string references as a starting point. Other wording can pass if it keeps both placeholders, the fixed forms, and the order of the actions.

Spanish:
Lleva {crate_id} a Bay North. Mantén la caja a 4 °C.
Consulta a {owner} antes de abrirla.

Japanese:
{crate_id} を Bay North に移動してください。
4 °C で保管してください。開ける前に {owner} に確認してください。

Catch altered placeholders before reviewing language

If you have Python 3, save the source text and the candidate translation for one case as UTF-8 plain text named source.txt and translation.txt. Run this command in the folder containing both files. It compares the counts of single-brace tokens. Use a fresh pair of files for each case or put each pair in a separate test folder.

python3 - <<'PY'
from collections import Counter
from pathlib import Path
import re

def tokens(filename):
    text = Path(filename).read_text(encoding="utf-8")
    return Counter(re.findall(r"\{[^{}\r\n]*\}", text))

source = tokens("source.txt")
result = tokens("translation.txt")
print("Missing or changed:", dict(source - result))
print("Extra or changed:", dict(result - source))
raise SystemExit(source != result)
PY

A pass prints two empty dictionaries. For the second string, delete one occurrence of the bin token in a temporary test copy and check that the first dictionary reports one missing occurrence. Then restore the actual candidate output. This negative check confirms that the comparison is counting repeated tokens. If you run it by hand, copy the tokens from each string into two lists and count each occurrence, including repeated ones.

The script covers the single-brace convention in these samples. For a product that uses plural syntax, numbered placeholders, or escaped braces, use the parser or validation step already used for its resource files. Test a preview of the case if the word order moves a placeholder. Filling it with a harmless value makes it possible to see whether the space, punctuation, and surrounding grammar still make sense after substitution. Python’s Counter documentation · Python’s regular expression documentation.

A token pass is one part of the review. Read the translated instruction alongside the original. Underline the quantity and what it modifies, and circle the phrase that controls whether someone can print now. A model could leave every token untouched and still tell a reader to print during the wait. Have a bilingual reviewer mark the string usable, needing a wording edit, or having a changed instruction. If you cannot review a language, keep its results as an unreviewed draft.

Use two substitutions in the app preview for a string that contains a repeated placeholder. Put the harmless value B-17 in both locations for the first preview, then substitute N-204. Inspect where each instance appears and whether the screen still reads correctly. If the token survives the check but the preview leaves the braces on screen, inspect the app’s parsing rules and the exported resource. This separates a translation problem from a failure when the app inserts values. Check the same preview for clipped labels if the string is intended for a short control.

Save the model’s whole first response before copying out the translation. It may wrap a usable string in quotation marks or add a note about the wording. Mark that as extra output when you asked for a ready-to-copy resource. If you want to try a revised instruction, ask every candidate for the same string without an outer quote, heading, or explanation. Score the new results separately from the original response. When the text appears inside the right UI element, check again that wrapping and line breaks match what a reader should see.

Pick a model for the workflow that passed

Keep separate notes for Spanish and Japanese. For each candidate and each string, record token status, the preserved facts, wording changes needed, and time to an accepted translation. Time to an accepted result includes the review or corrections you would normally have to make. A fast draft with a changed wait instruction costs another review pass. If both candidates meet your requirements, compare how often you can accept the first complete answer and how much review their wording usually needs.

If every candidate changes the same brand or unit, make a small glossary or add the intended rendering to the common prompt. Rerun those cases for every model. If it is one repeated placeholder that disappears, test the revised phrasing alongside a second string that repeats a different token. A setting only works for your intended job when it survives more than one example. If formatting fails in Japanese alone, check the Japanese preview and keep that result separate from Spanish.

Before using the model on your own app strings, add one short message that resembles the screen you want to ship, with a target-language reviewer and fixed expectations. Test the translation in the app with sample values. Save the accepted model tag, complete prompt, language direction, and examples so that a model update or glossary change can be checked with the same cases. Published tests for individual models can help identify a candidate whose hardware setup resembles yours. See a short translation test for Qwen2.5 7B on an 8 GB Mac.