i18n वैलिडेटर
गायब कुंजियों, खराब प्लेसहोल्डर और बहुवचन की विसंगतियों के लिए अनुवाद फ़ाइलों को लिंट करें। एक कमांड। 9 जाँचें। 32 फ़ॉर्मैट। किसी कॉन्फ़िगरेशन की ज़रूरत नहीं।
समस्या
अनुवाद से जुड़ी समस्याएँ तब तक दिखाई नहीं देतीं, जब तक यूज़र उनका सामना न करें। कोई कुंजी गायब होने पर वास्तविक टेक्स्ट के बजाय "settings.billing.title" जैसा मूल पाथ दिखाई देता है। कोई खराब प्लेसहोल्डर "$9.99" के बजाय "{price}" को हूबहू टेक्स्ट के रूप में दिखाता है। गलत तरीके से बना बहुवचन, संख्या शून्य होने पर क्रैश का कारण बनता है। ये बग कोड रिव्यू में पकड़ में नहीं आते, क्योंकि कोई भी 15 लोकेल फ़ाइलों के अंतर की मैन्युअल रूप से जाँच नहीं करता।
Missing keys
Blank text or key paths shown to users
Broken placeholders
{price} displays as literal text instead of $9.99
Orphaned files
Outdated translations confuse the build system
Malformed files
Runtime crashes when users switch languages
समाधान
i18n-validate एक ही बार में आपकी सभी अनुवाद फ़ाइलों को स्कैन करता है। यह आपकी डायरेक्टरी संरचना और फ़ाइल फ़ॉर्मैट का अपने-आप पता लगाता है, हर भाषा की संदर्भ भाषा से तुलना करता है और बताता है कि समस्या ठीक कहाँ और क्या है। किसी प्लगइन, कॉन्फ़िगरेशन या कस्टम टेस्ट कोड की ज़रूरत नहीं होती।
| Check | Severity | What it catches |
|---|---|---|
| missing-keys | error | Key exists in reference but is absent in a translation |
| extra-keys | error | Key exists in translation but not in the reference |
| placeholders | error | {price}, {{name}}, %s differ between languages |
| plural-structure | error | Plural forms are malformed or missing required categories |
| missing-languages | error | Expected language has no files or directory |
| orphaned-languages | error | Language files exist but are not in the expected list |
| parse-errors | error | File fails to parse (broken JSON, XML, YAML, etc.) |
| empty-values | warning | Key is present but the translation is an empty string |
| untranslated | warning | Translation is identical to the reference language |
i18n-validate v0.1.0 — validating ./locales
Reference: en (2 files: translation.json, apiTester.json)
Languages: de, ja, fr, es, zh-Hans, pt-BR, ko (7 found, 7 expected)
Layout : directory (auto-detected)
Formats : i18next JSON (auto-detected)
────────────────────────────────────────────────
ERRORS (5)
✗ missing-keys │ translation.json
Key "settings.billing.title"
missing in: ja, ko
✗ placeholders │ translation.json
Key "pricing.total" — expected: {price}, {currency}
de: found {price} only — missing {currency}
────────────────────────────────────────────────
WARNINGS (2)
⚠ empty-values │ translation.json
Key "onboarding.step3.hint"
empty in: de, fr
────────────────────────────────────────────────
5 errors, 2 warnings across 7 languages
✗ Validation failedइंस्टॉलेशन
अपने पसंदीदा पैकेज मैनेजर का उपयोग करके इसे ग्लोबल CLI टूल के रूप में इंस्टॉल करें। npm पैकेज में नेटिव Rust बाइनरी शामिल है—किसी कंपाइलेशन या रनटाइम डिपेंडेंसी की ज़रूरत नहीं होती।
npm install -g @i18n-agent/i18n-validateउपयोग
टूल को अपनी locales डायरेक्टरी का पाथ दें। यह संदर्भ भाषा, डायरेक्टरी संरचना और फ़ाइल फ़ॉर्मैट का अपने-आप पता लगा लेता है। अधिकांश प्रोजेक्ट के लिए किसी कॉन्फ़िगरेशन की ज़रूरत नहीं होती।
# Zero-config validation
i18n-validate ./locales
# JSON output for scripting
i18n-validate ./locales --format json | jq '.summary'
# CI/CD with JUnit XML
i18n-validate ./locales --format junit -o i18n-report.xmlCI/CD इंटीग्रेशन
अपनी पुल रिक्वेस्ट पाइपलाइन में अनुवाद वैलिडेशन जोड़ें। टूल JUnit XML आउटपुट देता है, जो GitHub Actions टेस्ट रिपोर्टर, GitLab CI आर्टिफ़ैक्ट और JUnit को सपोर्ट करने वाले किसी भी CI सिस्टम के साथ इंटीग्रेट होता है।
name: Validate Translations
on:
pull_request:
paths: ['locales/**', 'public/locales/**']
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate translations
run: npx @i18n-agent/i18n-validate ./locales --format junit -o i18n-report.xml
- uses: dorny/test-reporter@v1
if: always()
with:
name: i18n validation
path: i18n-report.xml
reporter: java-junit--strict to also fail on warnings.सपोर्ट किए जाने वाले फ़ॉर्मैट
i18n-convert द्वारा संचालित यह वैलिडेटर बिना अतिरिक्त सेटअप के 32 i18n फ़ाइल फ़ॉर्मैट को सपोर्ट करता है। फ़ॉर्मैट के लिए अलग प्लगइन या कॉन्फ़िगरेशन की ज़रूरत नहीं होती—टूल फ़ाइल एक्सटेंशन और कॉन्टेंट से फ़ॉर्मैट का अपने-आप पता लगा लेता है।
Mobile & Desktop
Android XML, Xcode String Catalog, iOS Strings, iOS Stringsdict, Flutter ARB, Qt Linguist
Web & Frameworks
Structured JSON, i18next JSON, JSON5, HJSON, YAML (Rails), YAML (Plain), JavaScript, TypeScript, PHP/Laravel, NEON
Standards & Exchange
XLIFF 1.2, XLIFF 2.0, Gettext PO, TMX, .NET RESX, Java Properties
Data & Other
CSV, Excel (.xlsx), TOML, INI, SRT Subtitles, Markdown, Plain Text
कॉन्फ़िगरेशन
अधिकांश प्रोजेक्ट बिना किसी कॉन्फ़िगरेशन के काम करते हैं। जब आपको अधिक नियंत्रण चाहिए—जाँच की गंभीरता बदलनी हो, अपेक्षित भाषाएँ सेट करनी हों या WIP भाषाओं को बाहर रखना हो—तो अपने प्रोजेक्ट रूट में .i18n-validate.toml फ़ाइल बनाएँ।
# .i18n-validate.toml
ref = "en"
expect = ["de", "ja", "fr", "es", "zh-Hans", "pt-BR", "ko"]
[checks]
missing-keys = "error"
extra-keys = "error"
placeholders = "error"
empty-values = "warning"
untranslated = "warning"
[languages.ko]
missing-keys = "warning" # Korean is WIP
[languages.ar]
skip = true # Exclude from validationi18n Agent अभी आज़माएँ
अपनी अनुवाद फ़ाइल यहाँ छोड़ें
JSON, YAML, PO, XML, CSV, Markdown, Properties
या ब्राउज़ करने के लिए क्लिक करें
लक्षित भाषाएँ