i18n-and-generated-code

i18n-and-generated-code is a cursor rule for Cursor from BetterTyped/hype-stack. It costs 0 tokens per session (378 once invoked), scanned A, original, MIT.

A set of project rules requiring Paraglide for user-facing translations and defining how generated code should be handled. Paraglide is a localization system for managing application text in multiple languages.

In plain words
What is it for?
Implementing internationalized user interfaces and applying the project’s rules to generated code.
Why use it?
It keeps interface text translatable and separates generated files from code that developers should edit directly.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Implementing internationalized user interfaces and applying the project’s rules to generated code.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/bettertyped/hype-stack/i18n-and-generated-code
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/BetterTyped/hype-stack

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for i18n-and-generated-code

README.md
[![agentmods](https://agentmods.dev/badge/rules/bettertyped/hype-stack/i18n-and-generated-code/github.svg)](https://agentmods.dev/rules/bettertyped/hype-stack/i18n-and-generated-code)
Your own site
<a href="https://agentmods.dev/rules/bettertyped/hype-stack/i18n-and-generated-code"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/i18n-and-generated-code/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for i18n-and-generated-code

Your own site · 80×15
<a href="https://agentmods.dev/rules/bettertyped/hype-stack/i18n-and-generated-code"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/i18n-and-generated-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 378 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00378
Opus 5.5 $0.00000 $0.00151
Sonnet 5.5 $0.00000 $0.00076
Haiku 4.5 $0.00000 $0.00038

Measured 1mo ago against content hash 484c503cbebf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

i18n-and-generated-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/i18n-and-generated-code.mdc · 35 lines

What it actually says

i18n (Paraglide) and Generated Code

Never hardcode user-facing strings

Every app — backend included — translates user-facing text with Paraglide. Backend responses are locale-aware via paraglideMiddleware (locale cookie → Accept-Language → base locale), so m.*() calls in handlers resolve per request.

  • Add new strings to the app's messages/en.json (each app has its own project.inlang + messages/).
  • Run pnpm generate (or the app's generate script) to compile messages into src/paraglide/.
  • Use messages via the compiled module:
import { m } from "@/paraglide/messages.js";

m.app_title();
  • This covers UI labels, error messages returned to clients, email copy, and validation messages. Log messages and internal errors stay in English.
  • Message keys are snake_case and named by meaning (invitation_expired), not by location (login_page_error_2).

Generated code is read-only

Never hand-edit generated output — fix the source and regenerate:

  • src/paraglide/ — generated by paraglide-js compile from messages/*.json.
  • routeTree.gen.ts — generated by TanStack Router.
  • The Prisma client — generated by prisma generate from schema.prisma.

If a type error points into a generated file, the fix is in the source of truth (messages JSON, route files, Prisma schema) followed by pnpm generate — never in the generated file itself.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 35 lines · 0 tokens per session scan A 484c503cbebf

Subscribe to this mod's changes

i18n-and-generated-code is a cursor rule published in the GitHub repository BetterTyped/hype-stack (12 stars, last pushed 15d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 378 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.