-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat(i18n): add eloqnt lint, and fix what it found
#9106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
568404d
b862d76
dcaba7f
a37d58a
7329aab
f67947d
6d81cb3
7576a58
db0b4db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@node-core/website-i18n': patch | ||
| --- | ||
|
|
||
| Remove unused and superfluous message keys from all locales, and restore | ||
| dropped ICU arguments in the Spanish EOL warning and the Traditional Chinese | ||
| package-manager notice, as reported by `eloqnt lint`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { defineConfig } from '@eloqnt/cli'; | ||
|
|
||
| import localeConfig from '../packages/i18n/src/config.json' with { type: 'json' }; | ||
|
|
||
| export default defineConfig({ | ||
| srcPath: ['./apps/site'], | ||
| messages: { | ||
| path: './packages/i18n/src/locales', | ||
| locales: localeConfig | ||
| .filter(locale => locale.enabled) | ||
| .map(locale => locale.code), | ||
| sourceLocale: 'en', | ||
| format: 'json', | ||
| }, | ||
| lint: { | ||
| overrides: [ | ||
| { | ||
| // These keys are built at runtime, so static analysis cannot | ||
| // see which ones are in use. | ||
| keys: [ | ||
| 'components.containers.footer.links.*', | ||
| 'components.containers.navBar.links.*', | ||
| 'components.navigation.about.links.*', | ||
| 'components.navigation.getInvolved.links.*', | ||
| 'layouts.download.codeBox.platformInfo.*', | ||
| 'layouts.blog.categories.*', | ||
| 'components.eolChip.severity.*', | ||
|
|
||
| // These namespaces also hold statically referenced keys, so the | ||
| // dynamic ones are listed individually. | ||
| 'components.metabar.author', | ||
| 'components.metabar.authors', | ||
| 'components.releaseModal.title', | ||
| 'components.releaseModal.titleWithoutCodename', | ||
| 'components.banner.default', | ||
| 'components.banner.warning', | ||
| 'components.banner.error', | ||
| ], | ||
| rules: { 'orphan-message': 'off' }, | ||
| }, | ||
| ], | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A few exceptions to avoid refactors to code (see also: |
||
| }, | ||
| }); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule: Dead-key removal (this file and every other locale file). 36 keys are deleted because they are referenced nowhere in the repository — verified with a repo-wide literal search excluding the locale catalogs, plus a hand-check of the dynamic call sites that could theoretically reach them. The same 36 keys are removed from Generated by Claude Code |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,9 +36,7 @@ | |
| "about": "حول", | ||
| "download": "تنزيل", | ||
| "docs": "التوثيق", | ||
| "guides": "الأدلة", | ||
| "learn": "تعلّم", | ||
| "security": "الأمان", | ||
|
Comment on lines
-39
to
-41
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule:
Generated by Claude Code |
||
| "certification": "الدورات", | ||
| "blog": "المدونة", | ||
| "contribute": "المساهمة" | ||
|
|
@@ -70,9 +68,7 @@ | |
| }, | ||
| "downloadReleasesTable": { | ||
| "version": "Node.js", | ||
| "nApiVersion": "N-API", | ||
| "codename": "الاسم الرمزي", | ||
| "releaseDate": "تاريخ الإصدار", | ||
| "firstReleased": "أول إصدار", | ||
| "lastUpdated": "آخر تحديث", | ||
| "status": "الحالة", | ||
|
|
@@ -86,10 +82,7 @@ | |
| "releaseModal": { | ||
| "title": "Node.js v{version} ({codename})", | ||
| "titleWithoutCodename": "Node.js v{version}", | ||
| "overview": "نظرة عامة", | ||
| "minorVersions": "الإصدارات الفرعية", | ||
| "releaseAnnouncement": "إعلان الإصدار", | ||
| "unsupportedVersionWarning": "هذا الإصدار خارج مرحلة الصيانة. يرجى استخدام إصدار مدعوم. <link>تعرّف على دعم EOL.</link>", | ||
|
Comment on lines
-89
to
-92
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule: The release modal only renders Deleting Generated by Claude Code |
||
| "ltsVersionFeaturesNotice": "هل تريد الميزات الجديدة في وقت أقرب؟ استخدم <link>أحدث إصدار من Node.js</link> بدلًا من ذلك وجرب أحدث التحسينات!" | ||
| }, | ||
| "eolAlert": { | ||
|
|
@@ -121,7 +114,6 @@ | |
| "eolTable": { | ||
| "version": "الإصدار", | ||
| "codename": "الاسم الرمزي", | ||
| "releaseDate": "تاريخ الإصدار", | ||
| "lastUpdated": "آخر تحديث", | ||
| "vulnerabilities": "الثغرات", | ||
| "details": "التفاصيل", | ||
|
|
@@ -134,7 +126,6 @@ | |
| "npmVersion": "إصدار npm", | ||
| "v8Version": "إصدار V8", | ||
| "actions": { | ||
| "release": "الإصدار", | ||
| "changelog": "سجل التغييرات", | ||
| "docs": "التوثيق" | ||
| } | ||
|
|
@@ -150,8 +141,7 @@ | |
| "common": { | ||
| "alertBox": { | ||
| "info": "معلومة", | ||
| "warning": "تحذير", | ||
| "danger": "خطر" | ||
| "warning": "تحذير" | ||
| }, | ||
| "breadcrumbs": { | ||
| "navigateToHome": "الانتقال إلى الصفحة الرئيسية" | ||
|
|
@@ -179,12 +169,10 @@ | |
| "metabar": { | ||
| "lastUpdated": "آخر تحديث", | ||
| "readingTime": "مدة القراءة", | ||
| "addedIn": "أضيف في", | ||
| "author": "المؤلف", | ||
| "authors": "المؤلفون", | ||
| "contribute": "المساهمة", | ||
| "contributeText": "عدّل هذه الصفحة", | ||
| "viewAs": "عرض كـ", | ||
|
Comment on lines
-182
to
-187
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule:
Generated by Claude Code |
||
| "tableOfContents": "جدول المحتويات", | ||
| "metadata": "بيانات المقال" | ||
| }, | ||
|
|
@@ -196,25 +184,7 @@ | |
| }, | ||
| "search": { | ||
| "searchPlaceholder": "ابدأ الكتابة...", | ||
| "chatPlaceholder": "اسألني عن أي شيء", | ||
| "noResultsFoundFor": "لم يتم العثور على نتائج لـ", | ||
| "suggestions": "اقتراحات", | ||
| "seeAll": "عرض الكل", | ||
| "addMore": "إضافة المزيد", | ||
| "clearChat": "مسح المحادثة", | ||
| "errorMessage": "حدث خطأ أثناء محاولة البحث. يرجى المحاولة مرة أخرى.", | ||
| "disclaimer": "قد تخطئ ملخصات AI. يرجى التحقق من المعلومات.", | ||
| "startYourSearch": "ابدأ البحث", | ||
| "initErrorSearch": "تعذّر تهيئة خدمة البحث", | ||
| "initErrorChat": "تعذّر تهيئة خدمة الدردشة", | ||
| "chatButtonLabel": "الحصول على ملخص AI", | ||
| "searchButtonLabel": "بحث", | ||
| "poweredBy": "مدعوم من", | ||
| "suggestionOne": "كيف أثبّت Node.js؟", | ||
| "suggestionTwo": "كيف أنشئ خادم HTTP؟", | ||
| "suggestionThree": "ترقية إصدار Node.js", | ||
| "scrollToBottom": "التمرير إلى الأسفل", | ||
| "closeChat": "إغلاق الدردشة", | ||
|
Comment on lines
-199
to
-217
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule: These 18 Generated by Claude Code |
||
| "keyboardShortcuts": { | ||
| "select": "للاختيار", | ||
| "navigate": "للتنقل", | ||
|
|
@@ -229,14 +199,6 @@ | |
| } | ||
| }, | ||
| "layouts": { | ||
| "blogPost": { | ||
| "author": { | ||
| "byLine": "{author, select, null {} other {بواسطة {author}، }}" | ||
| } | ||
| }, | ||
| "blogIndex": { | ||
| "categoryName": "{category, select, all {المدونة} other {منشورات مدونة {category}}}" | ||
| }, | ||
| "blog": { | ||
| "title": "المدونة", | ||
| "selectCategory": "التصنيفات", | ||
|
|
@@ -245,7 +207,6 @@ | |
| "announcements": "الإعلانات", | ||
| "release": "الإصدارات", | ||
| "vulnerability": "الثغرات", | ||
| "advisory-board": "المجلس الاستشاري", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule:
Generated by Claude Code |
||
| "community": "المجتمع", | ||
| "feature": "ميزة", | ||
| "module": "الوحدات", | ||
|
|
@@ -278,7 +239,6 @@ | |
| "platform": "المنصة", | ||
| "os": "نظام التشغيل", | ||
| "version": "الإصدار", | ||
| "installMethod": "طريقة التثبيت", | ||
| "packageManager": "مدير الحزم", | ||
| "unknown": "غير معروف", | ||
| "platformGroups": { | ||
|
|
@@ -288,7 +248,6 @@ | |
| }, | ||
| "codeBox": { | ||
| "unsupportedVersionWarning": "هذا الإصدار خارج مرحلة الصيانة. يرجى استخدام إصدار مدعوم حاليًا. <link>تعرّف على دعم EOL.</link>", | ||
| "ltsVersionFeaturesNotice": "هل تريد الميزات الجديدة في وقت أقرب؟ استخدم <link>أحدث إصدار من Node.js</link> بدلًا من ذلك وجرب أحدث التحسينات!", | ||
| "communityPlatformInfo": "طرق التثبيت التي تعتمد على برمجيات المجتمع تدعمها الفرق المسؤولة عن صيانة تلك البرمجيات.", | ||
| "externalSupportInfo": "إذا واجهت أي مشاكل، يرجى زيارة <link>موقع {platform}</link>", | ||
| "noScriptDetected": "تتطلب هذه الصفحة JavaScript. يمكنك تنزيل Node.js بدون JavaScript عبر زيارة <link>صفحة أرشيف التنزيلات</link> مباشرة.", | ||
|
|
@@ -300,8 +259,7 @@ | |
| "choco": "Chocolatey هو مدير حزم لـ Windows.", | ||
| "docker": "Docker هو منصة للحاويات.", | ||
| "n": "\"n\" هو مدير إصدارات Node.js متعدد المنصات.", | ||
| "asdf": "\"asdf\" هو مدير إصدارات يعمل على عدة أنظمة تشغيل ويدعم عدة لغات برمجية.", | ||
| "volta": "\"Volta\" هو مدير إصدارات Node.js متعدد المنصات." | ||
| "asdf": "\"asdf\" هو مدير إصدارات يعمل على عدة أنظمة تشغيل ويدعم عدة لغات برمجية." | ||
| } | ||
| } | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this consumes files both from
./apps/siteand./packages/i18n, I've added this as a monorepo dependency.