i18n-sharpen is a static analysis tool (static analysis linter) based on the AST platform, designed to protect your multilingual system (i18n) from code rot – especially when you use AI to assist in writing code.
Problem: AI is silently ruining i18n When you let AI agents (like Claude, Copilot, Cursor) write code, they code very quickly but often leave behind "trash" in the i18n system:
Hardcode string: Directly inserting text into the UI (e.g.: placeholder="Submit") instead of using the i18n translation function.
Dead keys: Deleting a component but forgetting to remove the corresponding key in the locale file.
Missing keys & Hallucinations: Forgetting to declare a key, adding a key with missing language, or making up non-existent namespaces.
Old tools using regex/grep are often "blind" to dynamic keys or the specific syntax of frameworks, leading to false positives.
Solution: i18n-sharpen Instead of scanning plain text, i18n-sharpen reads your code like a real compiler using AST (Abstract Syntax Tree). It smoothly supports: TypeScript, JavaScript, React (JSX/TSX), Vue, Svelte, and Astro.
Highlighted features:
Understanding Dynamic Keys: Accurately analyzes dynamic keys like tauth.${action}) instead of giving false error reports.
Catching Hardcoded Text: Marks untranslated text snippets scattered throughout components, preventing the faulty code from being pushed to production.
Automatic Pruning & Extraction: Automatically synchronizes new keys across all language files and safely cleans up dead keys.
Lightweight: Super lightweight (~720kB), applying lazy-load to only load the relevant AST compiler that your project uses.
Build a more "AI-Friendly Codebase," just integrate i18n-sharpen into your CI pipeline or pre-commit hook, and you have established a robust guardrail. Whenever AI accidentally hardcodes a string or leaves an orphan key, the pipeline will immediately fail and report the error. Both you and the AI agent can code at maximum speed without worrying about accumulating tech debt.
Open source on GitHub: https://github.com/Schalkez/i18n-sharpen
Read the detailed analysis article: https://hiennguyen.io/blog/post/why-i-built-i18n-sharpen/
No reviews yet
Cách bạn định nghĩa vấn đề với i18n và AI agents rất thuyết phục, đặc biệt là cách liệt kê các loại lỗi cụ thể mà AI thường tạo ra. Việc sử dụng AST thay vì regex để xử lý dynamic keys là một lựa chọn kỹ thuật thông minh. Một gợi ý là bạn nên thêm một vài ví dụ thực tế về cách thiết lập i18n-sharpen với các framework phổ biến (Next.js, React, Vue) trong documentation. Điều này sẽ giúp các nhà phát triển mới nhanh chóng bắt đầu mà không phải tìm kiếm thêm. Cộng đồng dev rất quan tâm đến các công cụ giúp làm việc với AI hiệu quả hơn, vì vậy nếu bạn chia sẻ thêm các câu chuyện về cách các dự án sử dụng i18n-sharpen thành công thì sẽ rất hữu ích.

Linter i18n using AST: Automatically detects hardcoded errors and cleans up dead keys.
Auto-translated ·
Advanced debugging and performance optimization tool for React App

Linux OS cho người Việt phát triển bởi cộng đồng

Bộ công cụ tạo AI Skill từ ý tưởng — Dành cho Antigravity, Claude Code

Công cụ quản lý ngữ cảnh và tác nhân tự động cho Antigravity

Graph Your Code, Empower Your AI

Lớp bộ nhớ dành cho phát triển ứng dụng AI
No talks yet
Create the first talk
Reviews & comments