Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 13 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ This focus helps guide our project decisions as a community and what we choose t
- [RTL Support](#rtl-support)
- [Localization (i18n)](#localization-i18n)
- [Approach](#approach)
- [i18n commands](#i18n-commands)
- [Adding a new locale](#adding-a-new-locale)
- [Update translation](#update-translation)
- [Adding translations](#adding-translations)
Expand Down Expand Up @@ -378,6 +379,17 @@ npmx.dev uses [@nuxtjs/i18n](https://i18n.nuxtjs.org/) for internationalization.
- We use the `no_prefix` strategy (no `/en-US/` or `/fr-FR/` in URLs)
- Locale preference is stored in cookies and respected on subsequent visits

### i18n commands

The following scripts help manage translation files. `en.json` is the reference locale.

| Command | Description |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pnpm i18n:check [locale]` | Compares `en.json` with other locale files. Shows missing and extra keys. Optionally filter output by locale (e.g. `pnpm i18n:check ja-JP`). |
| `pnpm i18n:check:fix [locale]` | Same as check, but adds missing keys to other locales with English placeholders. |
| `pnpm i18n:report` | Audits translation keys against code usage in `.vue` and `.ts` files. Reports missing keys (used in code but not in locale), unused keys (in locale but not in code), and dynamic keys. |
| `pnpm i18n:report:fix` | Removes unused keys from `en.json` and all other locale files. |

### Adding a new locale

We are using localization using country variants (ISO-6391) via [multiple translation files](https://i18n.nuxtjs.org/docs/guide/lazy-load-translations#multiple-files-lazy-loading) to avoid repeating every key per country.
Expand Down Expand Up @@ -421,25 +433,7 @@ Check [Pluralization rule callback](https://vue-i18n.intlify.dev/guide/essential
We track the current progress of translations with [Lunaria](https://lunaria.dev/) on this site: https://i18n.npmx.dev/
If you see any outdated translations in your language, feel free to update the keys to match the English version.

In order to make sure you have everything up-to-date, you can run:

```bash
pnpm i18n:check <country-code>
```

For example to check if all Japanese translation keys are up-to-date, run:

```bash
pnpm i18n:check ja-JP
```

To automatically add missing keys with English placeholders, use `--fix`:

```bash
pnpm i18n:check:fix fr-FR
```

This will add missing keys with `"EN TEXT TO REPLACE: {english text}"` as placeholder values, making it easier to see what needs translation.
Use `pnpm i18n:check` and `pnpm i18n:check:fix` to verify and fix your locale (see [i18n commands](#i18n-commands) above for details).

#### Country variants (advanced)

Expand Down
100 changes: 6 additions & 94 deletions i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"description": "متصفح أفضل لسجل npm. ابحث عن الحزم واستعرضها واستكشفها عبر واجهة حديثة."
}
},
"version": "الإصدار",
"built_at": "تم البناء {0}",
"alt_logo": "شعار npmx",
"tagline": "متصفح أفضل لسجل npm",
Expand All @@ -22,7 +21,6 @@
"label": "ابحث عن حزم npm",
"placeholder": "ابحث عن الحزم…",
"button": "بحث",
"clear": "مسح البحث",
"searching": "جارٍ البحث…",
"found_packages": "تم العثور على {count} حزمة | تم العثور على حزمة واحدة | تم العثور على حزمتين | تم العثور على {count} حزم | تم العثور على {count} حزمة | تم العثور على {count} حزمة",
"updating": "(جارٍ التحديث…)",
Expand All @@ -48,7 +46,6 @@
"nav": {
"main_navigation": "الصفحة الرئيسية",
"popular_packages": "الحزم الشائعة",
"search": "بحث",
"settings": "الإعدادات",
"compare": "مقارنة",
"back": "عودة",
Expand All @@ -68,7 +65,6 @@
"language": "اللغة"
},
"relative_dates": "تواريخ نسبية",
"relative_dates_description": "عرض التواريخ مثل \"منذ 3 أيام\" بدلًا من التاريخ كاملًا.",
"include_types": "تضمين {'@'}types في التثبيت",
"include_types_description": "إضافة حزمة {'@'}types إلى أوامر التثبيت للحزم غير المرفقة بأنواع TypeScript.",
"hide_platform_packages": "إخفاء الحزم الخاصة بالمنصة في البحث",
Expand Down Expand Up @@ -103,8 +99,6 @@
"copy": "نسخ",
"copied": "تم النسخ!",
"skip_link": "تخطي إلى المحتوى الرئيسي",
"close_modal": "إغلاق النافذة",
"show_more": "عرض المزيد",
"warnings": "تحذيرات:",
"go_back_home": "العودة إلى الصفحة الرئيسية",
"view_on_npm": "عرض على npm",
Expand All @@ -121,7 +115,6 @@
"not_found": "لم يتم العثور على الحزمة",
"not_found_message": "تعذّر العثور على الحزمة.",
"no_description": "لا يوجد وصف",
"show_full_description": "عرض الوصف بالكامل",
"not_latest": "(ليست الأحدث)",
"verified_provenance": "مصدر موثّق",
"view_permalink": "عرض الرابط الدائم لهذا الإصدار",
Expand Down Expand Up @@ -151,7 +144,6 @@
"vulns": "الثغرات",
"published": "تاريخ النشر",
"published_tooltip": "تاريخ نشر {package}{'@'}{version}",
"skills": "المهارات",
"view_dependency_graph": "عرض مخطط التبعيات",
"inspect_dependency_tree": "فحص شجرة التبعيات",
"size_tooltip": {
Expand All @@ -162,7 +154,6 @@
"skills": {
"title": "مهارات العميل (Agent Skills)",
"skills_available": "{count} مهارة متاحة | مهارة واحدة متاحة | ترجمتان متاحتان | {count} مهارات متاحة | {count} مهارة متاحة | {count} مهارة متاحة",
"view": "عرض",
"compatible_with": "متوافق مع {tool}",
"install": "تثبيت",
"installation_method": "طريقة التثبيت",
Expand Down Expand Up @@ -335,25 +326,12 @@
"none": "لا شيء"
},
"vulnerabilities": {
"no_description": "لا يتوفر وصف",
"found": "تم العثور على {count} ثغرة | تم العثور على ثغرة واحدة | تم العثور على ثغرتين | تم العثور على {count} ثغرات | تم العثور على {count} ثغرة | تم العثور على {count} ثغرة",
"deps_found": "تم العثور على {count} ثغرة | تم العثور على ثغرة واحدة | تم العثور على ثغرتين | تم العثور على {count} ثغرات | تم العثور على {count} ثغرة | تم العثور على {count} ثغرة",
"deps_affected": "تأثرت {count} تبعية | تأثرت تبعية واحدة | تأثرت تبعيتان | تأثرت {count} تبعيات | تأثرت {count} تبعية | تأثرت {count} تبعية",
"tree_found": "{vulns} ثغرة في {packages}/{total} حزمة | ثغرة واحدة في {packages}/{total} حزمة | ثغرتان في {packages}/{total} حزمة | {vulns} ثغرات في {packages}/{total} حزمة | {vulns} ثغرة في {packages}/{total} حزمة | {vulns} ثغرة في {packages}/{total} حزمة",
"scanning_tree": "جارٍ فحص شجرة التبعيات…",
"show_all_packages": "عرض كل الحزم المتأثرة ({count})",
"no_summary": "لا يوجد ملخص",
"view_details": "عرض تفاصيل الثغرة",
"path": "المسار",
"more": "+{count} أخرى",
"packages_failed": "تعذر فحص {count} حزمة | تعذر فحص الحزمة | تعذر فحص الحزمتين | تعذر فحص {count} حزم | تعذر فحص {count} حزمة | تعذر فحص {count} حزمة",
"no_known": "لا توجد ثغرات معروفة في {count} حزمة | لا توجد ثغرات معروفة في الحزمة | لا توجد ثغرات معروفة في الحزمتين | لا توجد ثغرات معروفة في {count} حزم | لا توجد ثغرات معروفة في {count} حزمة | لا توجد ثغرات معروفة في {count} حزمة",
"scan_failed": "تعذر فحص الثغرات",
"depth": {
"root": "هذه الحزمة",
"direct": "تبعية مباشرة",
"transitive": "تبعية غير مباشرة"
},
"severity": {
"critical": "حرجة",
"high": "عالية",
Expand Down Expand Up @@ -395,13 +373,7 @@
},
"skeleton": {
"loading": "جارٍ تحميل تفاصيل الحزمة",
"license": "الترخيص",
"weekly": "أسبوعيًا",
"size": "الحجم",
"deps": "التبعيات",
"published": "تاريخ النشر",
"get_started": "ابدأ",
"readme": "README",
"maintainers": "المشرفون",
"keywords": "الكلمات المفتاحية",
"versions": "الإصدارات",
Expand All @@ -415,16 +387,6 @@
}
},
"connector": {
"status": {
"connecting": "جارٍ الاتصال…",
"connected_as": "متصل كـ ~{user}",
"connected": "متصل",
"connect_cli": "ربط واجهة سطر الأوامر المحلية",
"aria_connecting": "جارٍ الاتصال بالموصل المحلي",
"aria_connected": "تم الاتصال بالموصل المحلي",
"aria_click_to_connect": "انقر للاتصال بالموصل المحلي",
"avatar_alt": "صورة {user} الرمزية"
},
"modal": {
"title": "الموصل المحلي",
"contributor_badge": "للمساهمين فقط",
Expand Down Expand Up @@ -540,8 +502,7 @@
"failed_to_load": "فشل تحميل حزم المؤسسة",
"no_match": "لا توجد حزم تطابق \"{query}\"",
"not_found": "لم يتم العثور على المؤسسة",
"not_found_message": "المؤسسة \"{'@'}{name}\" غير موجودة على npm",
"filter_placeholder": "فلتر {count} حزمة…"
"not_found_message": "المؤسسة \"{'@'}{name}\" غير موجودة على npm"
}
},
"user": {
Expand Down Expand Up @@ -602,7 +563,6 @@
"code": {
"files_label": "الملفات",
"no_files": "لا توجد ملفات في هذا المجلد",
"select_version": "اختر إصدارًا",
"root": "الجذر",
"lines": "{count} سطر",
"toggle_tree": "إظهار/إخفاء شجرة الملفات",
Expand All @@ -612,7 +572,6 @@
"view_raw": "عرض الملف الخام (Raw)",
"file_too_large": "الملف كبير جدًا للمعاينة",
"file_size_warning": "{size} يتجاوز حد 500KB للتظليل النحوي (syntax highlighting)",
"load_anyway": "تحميل على أي حال",
"failed_to_load": "فشل تحميل الملف",
"unavailable_hint": "قد يكون الملف كبيرًا جدًا أو غير متاح",
"version_required": "الإصدار مطلوب لتصفح الكود",
Expand All @@ -634,12 +593,10 @@
"provenance": {
"verified": "موثّق",
"verified_title": "مصدر موثّق",
"verified_via": "موثّق: تم النشر عبر {provider}",
"view_more_details": "عرض المزيد من التفاصيل"
"verified_via": "موثّق: تم النشر عبر {provider}"
},
"jsr": {
"title": "متوفر أيضًا على JSR",
"label": "jsr"
"title": "متوفر أيضًا على JSR"
}
},
"filters": {
Expand All @@ -650,14 +607,6 @@
"search_placeholder_description": "فلترة حسب الوصف…",
"search_placeholder_keywords": "فلترة حسب الكلمات المفتاحية…",
"search_placeholder_all": "فلتر حسب الكل أو استخدم name: desc: kw:",
"scope_name": "الإسم",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick search reveals this key is actually used (but not in a statically analyzable way) in Panel.vue

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm. can we fix that?

"scope_name_description": "بحث في أسماء الحزم فقط",
"scope_description": "الوصف",
"scope_description_description": "بحث في الأوصاف فقط",
"scope_keywords": "الكلمات المفتاحية",
"scope_keywords_description": "بحث في الكلمات المفتاحية فقط",
"scope_all": "الكل",
"scope_all_description": "بحث في جميع الحقول، يدعم المحددات name: desc: kw:",
"weekly_downloads": "التنزيلات الأسبوعية",
"updated_within": "تم التحديث خلال",
"security": "الأمان",
Expand All @@ -672,42 +621,11 @@
"security": "الأمان",
"updated": "محدّث"
},
"download_range": {
"any": "أي",
"lt100": "< 100",
"100_1k": "100 - 1K",
"1k_10k": "1K - 10K",
"10k_100k": "10K - 100K",
"gt100k": "> 100K"
},
"updated": {
"any": "أي وقت",
"week": "الأسبوع الماضي",
"month": "الشهر الماضي",
"quarter": "آخر 3 أشهر",
"year": "السنة الماضية"
},
"security_options": {
"all": "جميع الحزم",
"secure": "بدون تحذيرات",
"insecure": "مع التحذيرات"
},
"sort": {
"label": "فرز الحزم",
"toggle_direction": "قلب اتجاه الفرز",
"ascending": "تصاعدي",
"descending": "تنازلي",
"relevance": "الصلة",
"downloads_week": "التنزيلات/الأسبوع",
"downloads_day": "التنزيلات/اليوم",
"downloads_month": "التنزيلات/الشهر",
"downloads_year": "التنزيلات/السنة",
"published": "آخر نشر",
"name": "الاسم",
"quality": "الجودة",
"popularity": "الشعبية",
"maintenance": "الصيانة",
"score": "التنقيط"
"descending": "تنازلي"
},
"columns": {
"title": "الأعمدة",
Expand Down Expand Up @@ -759,7 +677,6 @@
"title": "حول",
"heading": "حول",
"meta_description": "npmx هو متصفح سريع وحديث لسجل npm. تجربة مستخدم أفضل لاستكشاف حزم npm.",
"back_home": "العودة إلى الصفحة الرئيسية",
"what_we_are": {
"title": "ما هو npmx",
"better_ux_dx": "تجربة مستخدم/مطور أفضل",
Expand Down Expand Up @@ -819,8 +736,7 @@
"connect_npm_cli": "الاتصال بـ npm CLI",
"connect_atmosphere": "الاتصال بـ Atmosphere",
"connecting": "جارٍ الاتصال…",
"ops": "{count} عملية | عملية واحدة | عمليتان | {count} عمليات | {count} عملية | {count} عملية",
"disconnect": "قطع الاتصال"
"ops": "{count} عملية | عملية واحدة | عمليتان | {count} عمليات | {count} عملية | {count} عملية"
},
"auth": {
"modal": {
Expand All @@ -839,7 +755,6 @@
},
"header": {
"home": "الصفحة الرئيسية لـ npmx",
"github": "GitHub",
"packages": "الحزم",
"packages_dropdown": {
"title": "حزمك",
Expand Down Expand Up @@ -880,9 +795,7 @@
"searching": "جارٍ البحث…",
"remove_package": "إزالة {package}",
"packages_selected": "{count}/{max} حزمة محددة.",
"add_hint": "أضف حزمتين على الأقل للمقارنة.",
"loading_versions": "جارٍ تحميل الإصدارات…",
"select_version": "اختر إصدارًا"
"add_hint": "أضف حزمتين على الأقل للمقارنة."
},
"no_dependency": {
"label": "(بدون تبعية)",
Expand Down Expand Up @@ -977,7 +890,6 @@
"last_updated": "آخر تحديث: {date}",
"welcome": "مرحبًا بك في {app}. نحن ملتزمون بحماية خصوصيتك. تشرح هذه السياسة البيانات التي نجمعها، وكيف نستخدمها، وحقوقك المتعلقة بمعلوماتك.",
"cookies": {
"title": "ملفات تعريف الارتباط (Cookies)",
"what_are": {
"title": "ما هي ملفات تعريف الارتباط؟",
"p1": "ملفات تعريف الارتباط أو الكوكيز (Cookies) هي ملفات نصية صغيرة تُخزن على جهازك عند زيارة موقع ويب. الغرض منها هو تحسين تجربتك في التصفح من خلال تذكر بعض التفضيلات والإعدادات."
Expand Down
Loading
Loading