frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Jta – AI-powered JSON translator with agentic reflection for 3x better quality

1•Ronanxyz•3mo ago
I've been frustrated with AI translation tools that produce inconsistent terminology and unnatural phrasing. So I built Jta, a CLI tool where the AI doesn't just translate—it critiques and improves its own work through "agentic reflection."

Instead of one-shot translation, Jta implements a 3-step cycle: 1. Translate 2. AI evaluates its own work (accuracy, fluency, style, terminology) 3. AI applies its own suggestions to improve

The trade-off: 3x API calls, but significantly better quality. For our production i18n files, this eliminated ~90% of manual fixes we used to do.

GitHub: https://github.com/hikanner/jta

Comments

Ronanxyz•3mo ago
## The Key Innovation: Agentic Reflection

Traditional translation: Source → LLM → Done Jta's approach: Source → LLM → LLM self-critique → LLM improvement

Here's a real example:

*Step 1: Initial Translation* ``` Source: "Welcome to {app_name}" Translation: "欢迎使用 {app_name}" ```

*Step 2: AI Self-Critique* The AI analyzes its own work as an expert reviewer: ``` "The translation '欢迎使用' is accurate but could be more natural. Consider '欢迎来到' which conveys a warmer, more inviting tone that better matches the welcoming nature of 'Welcome to'." ```

*Step 3: AI Self-Improvement* ``` Improved: "欢迎来到 {app_name}" ```

This isn't post-processing with static rules—it's the AI acting as its own expert reviewer. The same model that translated understands the context, nuances, and challenges, making it uniquely qualified to critique and improve its own work.

*Why it works:* - *Context awareness*: The AI knows what it was trying to achieve - *Dynamic analysis*: Identifies issues specific to each translation's context - *Actionable feedback*: Generates specific improvements, not generic fixes - *Iterative quality*: Every translation gets a complete review-and-refine cycle ```

## Automatic Terminology Detection

One of the biggest pain points in i18n: inconsistent terminology. Jta solves this by using the LLM to analyze your source file and automatically identify:

*Preserve Terms* (never translate): - Brand names: "GitHub", "OAuth", "MyApp" - Technical terms: "API", "JSON", "HTTP"

*Consistent Terms* (always translate the same way): - Domain terms: "workspace" → "工作空间" (always) - Feature names: "credits" → "积分" (consistent across all strings)

The AI saves these to `.jta/terminology.json`:

```json { "version": "1.0", "sourceLanguage": "en", "preserveTerms": ["GitHub", "API", "OAuth"], "consistentTerms": ["repository", "commit", "pull request"] } ```

Then creates language-specific translation files:

```json // .jta/terminology.zh.json { "translations": { "repository": "仓库", "commit": "提交", "pull request": "拉取请求" } } ```

All future translations automatically use this dictionary. You can manually refine it, and the AI will respect your choices. This ensures 100% consistency across thousands of strings.

## Incremental Translation (80-90% Cost Savings)

Real-world i18n workflow: 1. Release 1.0: Translate 500 strings 2. Update 1.1: Add 10 new strings, modify 5 strings 3. Problem: Most tools re-translate all 500 strings

Jta's incremental mode: - Detects new keys (10 strings) - Identifies modified content (5 strings) - Preserves unchanged translations (485 strings) - Only translates 15 strings

*Result: 80-90% API cost reduction on updates*

Usage is dead simple:

```bash # First time: Full translation jta en.json --to zh

# After updates: Incremental (saves cost) jta en.json --to zh --incremental

# Re-translate everything if needed (quality refresh) jta en.json --to zh ```

The tool intelligently diffs the source file against existing translations, maintaining a perfect sync while minimizing API calls.

*Best practices:* - Development: Use `--incremental` for frequent updates - Production release: Use full translation for maximum quality - CI/CD: Use `--incremental -y` for automated updates

This makes Jta practical for continuous i18n workflows where you're updating translations multiple times per day.

Ronanxyz•3mo ago
## Technical Details

*Why Go?* I chose Go over Python for several reasons: - *Performance*: Concurrent batch processing with goroutines - *Reliability*: Static typing catches errors at compile time - *Distribution*: Single binary, no runtime dependencies - *Production-ready*: Built-in error handling, testing, and logging

*Architecture* Clean architecture with domain-driven design: - *Presentation Layer*: CLI (Cobra) + Terminal UI (Lipgloss) - *Application Layer*: Workflow orchestration - *Domain Layer*: Translation engine, reflection engine, terminology manager - *Infrastructure Layer*: AI provider adapters, JSON repository

*Reflection Implementation* The agentic reflection adds overhead (3x API calls per batch): - Batch size: 20 keys (configurable) - Example: 100 keys = 5 batches = 15 API calls (5 translate + 5 reflect + 5 improve) - Trade-off: 3x cost for significantly higher quality

You can adjust `--batch-size` based on your needs: - Smaller batches (10): More reliable, better quality, higher cost - Larger batches (50): More efficient, lower cost, slightly lower quality

*Supported AI Providers* - *OpenAI*: GPT-5, GPT-5 mini, GPT-5 nano, GPT-4o, etc. - *Anthropic*: Claude Sonnet 4.5, Claude Haiku 4.5, Claude Opus 4.1, etc. - *Gemini*: Gemini 2.5 Flash, Gemini 2.5 Pro, etc.

You can use any model from these providers. Generally: - Larger models → better reflection insights → higher quality - Faster models → quicker processing → lower cost - Balance: GPT-4o, Claude 3.5 Sonnet, Gemini 1.5 Pro

*Format Protection* Regex-based preservation of: - Placeholders: `{var}`, `{{var}}`, `%s`, `%(name)d` - HTML tags: `<b>`, `<span class="highlight">` - URLs: `https://example.com` - Markdown: `*bold*`, `italic`, `[link](url)`

*RTL Support* Proper bidirectional text handling for Arabic, Hebrew, Persian, Urdu: - Automatic direction markers for LTR content in RTL context - Smart punctuation conversion for Arabic-script languages - Supports 27 languages total

*Testing* - 51.9% test coverage (actively improving) - Integration tests with mock AI providers - Format protection validation - Incremental diff logic tests

Autism Incidence in Girls and Boys May Be Nearly Equal, Study Suggests

https://www.medpagetoday.com/neurology/autism/119747
1•paulpauper•43s ago•0 comments

Wellness Hotels Discovery Application

https://aurio.place/
1•cherrylinedev•1m ago•1 comments

NASA delays moon rocket launch by a month after fuel leaks during test

https://www.theguardian.com/science/2026/feb/03/nasa-delays-moon-rocket-launch-month-fuel-leaks-a...
1•mooreds•2m ago•0 comments

Sebastian Galiani on the Marginal Revolution

https://marginalrevolution.com/marginalrevolution/2026/02/sebastian-galiani-on-the-marginal-revol...
1•paulpauper•5m ago•0 comments

Ask HN: Are we at the point where software can improve itself?

1•ManuelKiessling•5m ago•0 comments

Binance Gives Trump Family's Crypto Firm a Leg Up

https://www.nytimes.com/2026/02/07/business/binance-trump-crypto.html
1•paulpauper•5m ago•0 comments

Reverse engineering Chinese 'shit-program' for absolute glory: R/ClaudeCode

https://old.reddit.com/r/ClaudeCode/comments/1qy5l0n/reverse_engineering_chinese_shitprogram_for/
1•edward•5m ago•0 comments

Indian Culture

https://indianculture.gov.in/
1•saikatsg•8m ago•0 comments

Show HN: Maravel-Framework 10.61 prevents circular dependency

https://marius-ciclistu.medium.com/maravel-framework-10-61-0-prevents-circular-dependency-cdb5d25...
1•marius-ciclistu•8m ago•0 comments

The age of a treacherous, falling dollar

https://www.economist.com/leaders/2026/02/05/the-age-of-a-treacherous-falling-dollar
2•stopbulying•9m ago•0 comments

Ask HN: AI Generated Diagrams

1•voidhorse•11m ago•0 comments

Microsoft Account bugs locked me out of Notepad – are Thin Clients ruining PCs?

https://www.windowscentral.com/microsoft/windows-11/windows-locked-me-out-of-notepad-is-the-thin-...
2•josephcsible•12m ago•0 comments

Show HN: A delightful Mac app to vibe code beautiful iOS apps

https://milq.ai/hacker-news
3•jdjuwadi•15m ago•1 comments

Show HN: Gemini Station – A local Chrome extension to organize AI chats

https://github.com/rajeshkumarblr/gemini_station
1•rajeshkumar_dev•15m ago•0 comments

Welfare states build financial markets through social policy design

https://theloop.ecpr.eu/its-not-finance-its-your-pensions/
2•kome•18m ago•0 comments

Market orientation and national homicide rates

https://onlinelibrary.wiley.com/doi/10.1111/1745-9125.70023
4•PaulHoule•19m ago•0 comments

California urges people avoid wild mushrooms after 4 deaths, 3 liver transplants

https://www.cbsnews.com/news/california-death-cap-mushrooms-poisonings-liver-transplants/
1•rolph•19m ago•0 comments

Matthew Shulman, co-creator of Intellisense, died 2019 March 22

https://www.capenews.net/falmouth/obituaries/matthew-a-shulman/article_33af6330-4f52-5f69-a9ff-58...
3•canucker2016•20m ago•1 comments

Show HN: SuperLocalMemory – AI memory that stays on your machine, forever free

https://github.com/varun369/SuperLocalMemoryV2
1•varunpratap369•21m ago•0 comments

Show HN: Pyrig – One command to set up a production-ready Python project

https://github.com/Winipedia/pyrig
1•Winipedia•24m ago•0 comments

Fast Response or Silence: Conversation Persistence in an AI-Agent Social Network [pdf]

https://github.com/AysajanE/moltbook-persistence/blob/main/paper/main.pdf
1•EagleEdge•24m ago•0 comments

C and C++ dependencies: don't dream it, be it

https://nibblestew.blogspot.com/2026/02/c-and-c-dependencies-dont-dream-it-be-it.html
1•ingve•24m ago•0 comments

Show HN: Vbuckets – Infinite virtual S3 buckets

https://github.com/danthegoodman1/vbuckets
1•dangoodmanUT•24m ago•0 comments

Open Molten Claw: Post-Eval as a Service

https://idiallo.com/blog/open-molten-claw
1•watchful_moose•25m ago•0 comments

New York Budget Bill Mandates File Scans for 3D Printers

https://reclaimthenet.org/new-york-3d-printer-law-mandates-firearm-file-blocking
2•bilsbie•26m ago•1 comments

The End of Software as a Business?

https://www.thatwastheweek.com/p/ai-is-growing-up-its-ceos-arent
1•kteare•27m ago•0 comments

Exploring 1,400 reusable skills for AI coding tools

https://ai-devkit.com/skills/
1•hoangnnguyen•28m ago•0 comments

Show HN: A unique twist on Tetris and block puzzle

https://playdropstack.com/
1•lastodyssey•31m ago•1 comments

The logs I never read

https://pydantic.dev/articles/the-logs-i-never-read
1•nojito•32m ago•0 comments

How to use AI with expressive writing without generating AI slop

https://idratherbewriting.com/blog/bakhtin-collapse-ai-expressive-writing
1•cnunciato•33m ago•0 comments