55 online 3 members  + Join RP Base  +
FreeScript

LocaleForge

by HastH8  ·  version 2026.10.08  ·  updated 3 days ago

No reviews yet

Downloads
0
Reviews
0
Size
3.2 MB
Code check
Clean
Licence
MIT
Released
Nov 2026

AI-assisted localization for Lua, JSON, JavaScript, and TypeScript—without breaking code structure.

LocaleForge
LocaleForge
Translate the words. Never break the code.

AI-assisted localization for Lua, JSON, JavaScript, and TypeScript files—without accounts, dashboards, or damaged placeholders.

Live app · Open translator · Report an issue

Overview
LocaleForge is a focused localization workspace for developers. Upload or paste a localization file, choose as many as 12 target languages, review each generated file in a syntax-aware editor, and download one file or a complete ZIP archive.

The server asks Gemini to translate only human-readable strings. It instructs the model to preserve keys, nesting, delimiters, comments, quote style, and common runtime placeholders, then checks the returned result before presenting it to the user.
Highlights
  • No account required — open the translator and start immediately.
  • Developer-native formats — Lua, JSON, JavaScript, and TypeScript.
  • Broad language catalog — searchable target-language picker with native names and country flags.
  • Structure-aware prompts — keys, identifiers, paths, commands, and framework names stay untouched.
  • Placeholder validation — protects patterns including %{name}, {{count}}, ${value}, %s, %d, [E], ~r~, and ^1.
  • Syntax-aware review — Monaco for editable source and translated files, plus Shiki-powered code presentation.
  • Batch translation — up to 12 target languages per request, processed in small concurrent batches.
  • Flexible export — download an individual translation or every result as a ZIP.
  • Light and dark themes — system-aware with a manual toggle.
  • Privacy-minded architecture — no user database and no saved translation history in the application.
  • Production discovery — canonical URLs, Open Graph and X/Twitter cards, JSON-LD, robots.txt, sitemap.xml, a web manifest, and a custom 404 page.
How it works
Upload or paste → Choose languages → Translate → Validate → Review → Download

  1. The browser sends the source file, format, source language, and selected target codes to POST /api/translate.
  2. The server validates request size, target count, and supported language codes.
  3. The Gemini Interactions API translates targets in batches of three with minimal thinking for lower latency.
  4. LocaleForge strips accidental Markdown fences and compares placeholder and key counts.
  5. The browser opens every result in an editable code view and enables individual or ZIP downloads.
Supported files and limits
Capability, Current limit

File formats, .lua, .json, .js, .ts
Target languages, 1–12 per run
Source length, 100,000 characters
Anonymous requests, 20 per IP per hour per warm server instance
Model request timeout, 35 seconds
Server route duration, 60 seconds

The in-memory rate limiter is intentionally simple. For a high-traffic production service, replace it with a durable store such as Vercel KV, Upstash Redis, or another shared rate-limit backend.
Tech stack
Layer, Technology

Framework, Next.js 16 App Router, React 19, TypeScript
Styling, Tailwind CSS 4, shadcn/ui, Base UI
Motion and icons, Motion, Lucide React
Code editing, Monaco Editor
Highlighting, Shiki and Code Blocks components
Flags, country-flag-icons
Translation, Google Gen AI SDK and Gemini Interactions API
Analytics, Vercel Web Analytics, loaded after visitor consent
Archive export, JSZip
Deployment, Vercel
Local developmentRequirements Setup
git clone https://github.com/HastH8/LocaleForge.git
cd LocaleForge
npm install
cp .env.example .env.local

Add your key to .env.local:

GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-3.1-flash-lite

Start the development server:

npm run dev

Open http://localhost:3000. The marketing page is at /, and the full translation workspace is at /translate.
Environment variables
Variable, Required, Purpose

GEMINI_API_KEY, Yes, Server-only credential used by the translation route.
GEMINI_MODEL, No, Gemini model alias. Defaults to gemini-3.1-flash-lite.
NEXT_PUBLIC_SITE_URL, Recommended in production, Canonical site origin used by metadata, JSON-LD, robots, and the sitemap.

Never prefix the Gemini key with NEXT_PUBLIC_. LocaleForge reads it only inside the server route, and .env* files are ignored by Git.
Available scripts
npm run dev        # Start the development server
npm run build      # Create a production build
npm run start      # Serve the production build
npm run lint       # Run ESLint
npm run typecheck  # Run TypeScript without emitting files
npm run format     # Format TypeScript and TSX files with Prettier

Before opening a pull request or deploying, run:

npm run typecheck
npm run lint
npm run build

API reference**POST /api/translate**
Request body:

{
  "source": "{\"welcome\": \"Welcome, %{name}!\"}",
  "sourceLanguage": "English",
  "targets": ["fr-FR", "de"],
  "fileName": "locales.json",
  "format": "json"
}

Successful response:

{
  "results": [
    {
      "code": "fr-FR",
      "name": "French (France)",
      "nativeName": "Français",
      "flag": "🇫🇷",
      "content": "{\"welcome\": \"Bienvenue, %{name} !\"}",
      "validation": {
        "placeholderSafe": true,
        "keyCount": 1,
        "keyCountMatches": true
      }
    }
  ],
  "model": "gemini-3.1-flash-lite"
}

Errors use a JSON body with a human-readable error property and an appropriate HTTP status. Common cases include invalid input (400), rate limiting (429), oversized input (413), missing configuration (503), and upstream translation failure (502).
Project structure
```text
app/
├── api/translate/route.ts #

…