Skip to content

feat: Add Persian (Farsi) locale support #157

@O2sa

Description

@O2sa

Persian (Farsi) is spoken by millions of users worldwide. Adding Persian locale support will make the application accessible to Persian-speaking developers and enhance the platform's global reach.

Overview

Persian (Farsi) will be added as a new supported locale with the language code fa. Like Arabic, Persian is written right-to-left (RTL), so proper RTL support must be ensured throughout the application.

Tasks

  • Create a new locale file locales/fa.json with all translation keys from locales/en.json translated to Persian.
  • Update lib/i18n-core.ts to add fa to the supportedLocales array.
  • Add Persian entry to the localeMeta object in lib/i18n-core.ts with the following configuration:
    fa: { dir: "rtl", label: "فارسی" }
  • Test the language switcher to ensure Persian appears in the dropdown menu.
  • Verify RTL layout is applied correctly across all components (using the existing dir property mechanism).
  • Test the application with Persian locale selected to ensure all UI elements display correctly.
  • Update CONTRIBUTING.md with instructions for translating content to Persian (if not already documented in the localization guide).

Translation Keys

All translation keys from the existing English locale must be translated. The keys include:

  • Application titles and subtitles
  • Error messages
  • UI labels and buttons
  • Explanations and descriptions
  • Comparison metrics
  • Community contribution labels
  • And more (reference locales/en.json for the complete list)

RTL Considerations

  • Ensure the application respects the dir: "rtl" setting for proper layout direction.
  • Test that text alignment, spacing, and component positioning work correctly in RTL mode.
  • Verify that language-sensitive components (like tables, charts, and forms) display correctly in RTL.

Testing

  • Language switcher displays "فارسی" correctly.
  • All pages render without errors when Persian is selected.
  • RTL layout is applied properly across all components.
  • No layout shifts or broken styling in RTL mode.

Tip

🚀 Want to contribute?
Comment assign me to be automatically assigned to this issue via our GitHub Actions bot. Happy coding! ✨

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions