I was rebuilding the settings screen of my wallpaper app one evening, and I sent Rork the same request twice: once in Japanese, once in English. I expected to compare colors and spacing.
That is not what caught my eye. The Japanese version had short labels like "保存" (save) typed straight into each screen's code. The English version had longer labels like "Save changes" squeezed into buttons with a fixed width.
What I'd like to share first is this: deciding where the text lives, how long it may grow, and how dates and numbers are written matters more than which language you prompt in. It is less about picking a language and more about taking back the parts I had quietly left to it.
Side by side, three places differed
After sending the same request in both languages a few times, these were the places where the results tended to drift for me. Each generation varies, so please read this as "tends to lean this way," not as a rule.
| What to look at | Prompted in Japanese | Prompted in English |
|---|---|---|
| Where text lives | Often hard-coded in each screen | Also hard-coded, and adding Japanese later is rarely planned for |
| Length assumptions | Widths sized for very short words | Sized for long words; Japanese leaves empty space |
| Dates and numbers | Formats like "11月14日" built by string concatenation | "Nov 14" assumed, even on a Japanese device |
Neither language won. The prompt language simply slips in as the app's "first language." That is natural enough. The trouble starts on the day you add a second one.
Length changes by several times across languages
Button labels show it most clearly. "保存" is 2 characters, "Save changes" is 12, and the German "Änderungen speichern" is 20. As an indie developer who keeps store listings in many languages, I run into this stretch and shrink every release.
A screen built from a Japanese prompt usually settles on a width for 2 characters, so English text gets cut off or wraps later. A screen built from English leaves Japanese buttons looking hollow. Either way, telling Rork not to hard-code widths in the first prompt saved me the most time.
I've written separately about Japanese line breaks and about bold Japanese text on Android (The Comma That Fell to the Start of a Line: Rork, Quote Cards, and Japanese Line Breaking, Japanese Headings Won't Turn Bold on Android: How to Trace and Fix a fontWeight That Does Nothing). Here I'll stay with the step before that: how the prompt is written.
At first I thought it was just how the model behaves
I'll admit I first assumed English prompts would return "cleaner" code, and I leaned on English for a while. It didn't go well. All it got me was a pile of English labels hard-coded across screens, waiting to be replaced by hand.
It clicked while I was fixing the same "Cancel" label in one file after another. This wasn't a quirk of generation. I had simply never asked for the text to live in one place.
Where the text lives is decided in the first prompt, not left to the prompt's language. That one line is now the first thing I check whenever I ask for a new screen.
Add three constraints to the prompt
Rork's own docs suggest pairing the experience you want with clear constraints (How to prompt successfully). For UI text, three lines were enough for me. Whether you write them in English or Japanese, the gap between the two results gets much smaller.
Build a settings screen. Calm mood, one main flow only.
For all UI text, follow these three rules:
1. Put every visible string in constants/strings.ts with both ja and en. Never hard-code text in components.
2. Do not give buttons or labels a fixed numeric width. The layout must survive text that is 3x longer.
3. Never build dates, numbers or prices by string concatenation. Format them with Intl for the device language.The first line follows the official advice about mood and scope. The rest is what I took away from the comparison.
Check that the returned code looks like this
When the prompt is followed, the text ends up roughly like this. The device language comes from getLocales() in expo-localization. The Expo docs note that languageCode can be null, and that on Android a user can change the language in Settings without the app restarting (Localization - Expo Documentation). So I keep the language check in one place and always leave a fallback to English.
// constants/strings.ts
import { getLocales } from "expo-localization";
const strings = {
ja: { save: "保存", cancel: "キャンセル", lastUpdated: "最終更新" },
en: { save: "Save changes", cancel: "Cancel", lastUpdated: "Last updated" },
} as const;
type Lang = keyof typeof strings;
type Key = keyof (typeof strings)["en"];
// languageCode can be null, so always fall back to en
export function currentLang(): Lang {
const code = getLocales()[0]?.languageCode ?? "en";
return code in strings ? (code as Lang) : "en";
}
export function t(key: Key): string {
return strings[currentLang()][key];
}
// Let each locale decide the date format instead of building strings
export function formatDate(date: Date): string {
const tag = getLocales()[0]?.languageTag ?? "en-US";
return new Intl.DateTimeFormat(tag, { year: "numeric", month: "short", day: "numeric" }).format(date);
}getLocales() is read on every call so that, after a language change on Android, the screen doesn't keep showing the old language. If that ever feels too frequent, re-reading it only when the app returns to the foreground is enough.
Count the hard-coded strings yourself
Even with the rule in the prompt, hard-coded text can creep back in over many edits. Run this from the root of an exported project to list strings written directly inside JSX. It needs only Node, no extra packages.
// scripts/find-hardcoded-strings.mjs
// Usage: node scripts/find-hardcoded-strings.mjs app components
import { readdirSync, readFileSync, statSync } from "node:fs";
import { join } from "node:path";
const roots = process.argv.slice(2).length ? process.argv.slice(2) : ["app", "components"];
// Catch >text< and strings passed directly to title= / placeholder= / label=
const patterns = [
/>\s*([^<>{}\s][^<>{}]*?)\s*</g,
/\b(?:title|placeholder|label|accessibilityLabel)=["']([^"']+)["']/g,
];
function walk(dir, out = []) {
let entries = [];
try { entries = readdirSync(dir); } catch { return out; }
for (const name of entries) {
if (name === "node_modules" || name.startsWith(".")) continue;
const p = join(dir, name);
if (statSync(p).isDirectory()) walk(p, out);
else if (/\.(tsx|jsx)$/.test(name)) out.push(p);
}
return out;
}
let total = 0;
for (const file of roots.flatMap((r) => walk(r))) {
const lines = readFileSync(file, "utf8").split("\n");
lines.forEach((line, i) => {
for (const re of patterns) {
for (const m of line.matchAll(re)) {
const text = m[1].trim();
// Skip symbols-only and numbers-only matches
if (!/[A-Za-z-ヿ一-鿿]/.test(text)) continue;
total++;
console.log(`${file}:${i + 1} ${text}`);
}
}
});
}
console.log(`\nHard-coded candidates: ${total}`);
process.exitCode = total > 0 ? 1 : 0;It's only regular expressions, so it will sometimes catch a type annotation by mistake. Still, watching the count fall toward 0 was a good enough way to track the cleanup. Paste the list into Rork and ask it to move those strings into constants/strings.ts; that goes far faster than editing by hand.
For catching missing translations as you add more languages, see Why Untranslated Strings Leak to Production Every Time You Add a Language — A Catalog and Gap-Detection Design for Rork (Expo) Apps.
So which language should you prompt in?
These days I write prompts in Japanese, the language I think in most easily, and always add the three lines above. When I'm describing mood and feel, my own strongest language keeps the intent from drifting.
If an app ships only to English-speaking stores, prompting in English does let you reuse the generated labels more often. What bridges the two, I think, is not the prompt language but the constraints you attach to it.
Next time you ask for a new screen, try adding just one line at the end: "Put all text in constants/strings.ts with ja and en." That alone removes one chore from the day you add a second language.