Instruction file imported from salamaashoush/tanstack-template (
.cursor/rules/i18n.mdc). Copyright stays with the author.
Localisation
Every user-visible string is a message. There are no hardcoded strings.
import * as m from "~/i18n/messages";
m.membersTitle(); // yes
<h1>Members</h1> // no
Adding a message
Add the key to both messages/en.json and messages/ar.json. bun run lint
fails if they drift — scripts/check-i18n.ts enforces parity, because inlang removed
its own lint command with no replacement.
Interpolation uses {name}: m.membersSelectRow({ name }).
Do not touch
src/i18n/** is generated by Paraglide from the message catalogues. Edit the
catalogues, never the output.
RTL
Arabic is a first-class locale. Anything with direction must use logical
properties: ps-*/pe-*, ms-*/me-*, start-*/end-*, text-start. Physical
ones (pl-*, ml-*, left-*, text-left) do not flip and will visibly break the
Arabic layout.
Direction comes from getTextDirection(); do not hand-roll locale === "ar" checks.