.cursor/skills/nazim-i18n/SKILL.md
Internationalization and RTL for Nazim. Use when adding UI text or layout that depends on language. Covers useLanguage (t, isRTL, language), translation file structure, adding keys, RTL layout and conditional classes.
npx skillsauth add AHMADJAN-New/nazim-web nazim-i18nInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Supported languages: English (en), Pashto (ps), Farsi/Dari (fa), Arabic (ar). RTL: Arabic, Pashto, Farsi. Use useLanguage for all translated text and direction.
frontend/src/lib/translations/types.ts — TranslationKeys interfaceen.ts, ps.ts, fa.ts, ar.ts in same directoryfrontend/src/lib/i18n.ts (t, isRTL, getDirection, etc.)useLanguage() from @/hooks/useLanguage → { t, isRTL, language }import { useLanguage } from '@/hooks/useLanguage';
function MyComponent() {
const { t, isRTL, language } = useLanguage();
return (
<>
<h1>{t('students.title')}</h1>
<p>{t('students.searchPlaceholder')}</p>
<div className={isRTL ? 'mr-4 border-r' : 'ml-4 border-l'}>
{/* RTL-aware layout */}
</div>
</>
);
}
types.ts (correct category)t('category.key')Key structure: category.key (e.g. students.title, nav.dashboard, common.save, forms.required).
document.documentElement.dir is set by the app (rtl/ltr)side={isRTL ? "right" : "left"}isRTL for margins, borders, alignment (e.g. isRTL ? 'mr-4 border-r' : 'ml-4 border-l')index.css under [dir="rtl"]; .text-left / .ml-auto etc. reverse automaticallyNavigation items use titleKey for translation:
{ title: "All Students", titleKey: "allStudents", url: "/students", icon: Users }
Dari uses the fa locale. For Dari-specific workflow and terminology use the rule: .cursor/rules/dari-translations-workflow.mdc and DARI_MANIFEST.md.
tools
Toast notifications for Nazim. Use when showing success/error/info messages. ALWAYS use showToast from @/lib/toast with translation keys; never toast from sonner directly. RTL positioning is automatic.
tools
Enforces status badge patterns for Nazim UI. Use when displaying status in tables, cards, or dialogs. Covers Badge variants, semantic colors, statusBadgeVariant, statusOptions with color.
development
Enforces mobile-first responsive patterns for Nazim UI. Use when building pages, tables, forms, charts, or buttons. Covers page container, FilterPanel, tabs, grids, tables, charts, cards, buttons.
development
PDF and Excel report generation for Nazim. Use when adding or changing reports. Backend uses ReportService and ReportConfig; frontend uses useServerReport. Covers branding, DateConversionService, RTL, acceptance criteria.