Skip to content

feat: Add Urdu locale support #175

Description

@O2sa

Urdu is spoken by over 230 million people worldwide and is the official language of Pakistan. Adding Urdu locale support will make the application accessible to a significant community of Urdu-speaking developers across Pakistan, India, and the diaspora.

Overview

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

Tasks

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

Translation Keys

All translation keys from the existing English locale must be translated to Urdu. 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.
  • Ensure proper handling of Urdu-specific text rendering and character combinations.

Testing

  • Language switcher displays "اردو" correctly.
  • All pages render without errors when Urdu is selected.
  • RTL layout is applied properly across all components.
  • Urdu characters display correctly without encoding issues.
  • 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