Skip to content

feat(i18n): add Persian (Farsi) localization#9198

Open
danialshirali16 wants to merge 21 commits into
makeplane:previewfrom
danialshirali16:claude/eloquent-wozniak-YWDUc
Open

feat(i18n): add Persian (Farsi) localization#9198
danialshirali16 wants to merge 21 commits into
makeplane:previewfrom
danialshirali16:claude/eloquent-wozniak-YWDUc

Conversation

@danialshirali16
Copy link
Copy Markdown

@danialshirali16 danialshirali16 commented Jun 3, 2026

Summary

  • Adds complete Persian (Farsi / fa) localization to the @plane/i18n package
  • Translates all 28 namespace JSON files (~5,181 translation keys) into professional product-marketing Persian
  • Registers fa in TLanguage type and SUPPORTED_LANGUAGES constant (shown as فارسی in the language picker)

Translation details

All keys are fully translated with no missing entries. Terminology is consistent throughout:

Concept Persian term
Work item / issue تسک
Cycle / sprint اسپرینت
Workspace فضای کاری
Module ماژول
Epic اپیک

ICU plural format ({count, plural, one{...} other{...}}) and all interpolation variables ({name}, {count}, etc.) are preserved exactly.

Files changed

  • packages/i18n/src/locales/fa/ — 28 new JSON locale files
  • packages/i18n/src/types/language.ts — added "fa" to TLanguage union
  • packages/i18n/src/constants/language.ts — added { label: "فارسی", value: "fa" } to SUPPORTED_LANGUAGES

Test plan

  • Switch language to فارسی in workspace settings — UI renders in Persian
  • Verify RTL layout is applied correctly
  • Check plural forms (single vs. multiple تسک / اسپرینت)
  • Confirm no keys fall back to English

Summary by CodeRabbit

  • New Features
    • Added Persian (فارسی) language with comprehensive UI translations across the app.
    • Added right-to-left (RTL) support for editor content and PDF text alignment.
    • Added Persian-capable font for improved PDF/document rendering of Persian text.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 3, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6ac23c4f-a2b8-4fb4-8c71-8b89439971e3

📥 Commits

Reviewing files that changed from the base of the PR and between b6be06d and eb20dda.

📒 Files selected for processing (1)
  • apps/live/src/lib/pdf/plane-pdf-exporter.tsx

📝 Walkthrough

Walkthrough

Adds Persian (fa) locale files across the app, registers the Vazirmatn font for PDFs, and updates PDF node renderers and stylesheet rules to apply Vazirmatn and default right alignment when content direction is RTL.

Changes

RTL-Ready PDF Rendering System

Layer / File(s) Summary
RTL detection and paragraph/heading styling
apps/live/src/lib/pdf/node-renderers.tsx
Adds getRtlStyle, updates paragraph and heading renderers to read dir, compute isRtl and an effective textAlign (default right for RTL), and include rtlStyle in Text styles.
Vazirmatn font registration and document styling
apps/live/src/lib/pdf/plane-pdf-exporter.tsx, apps/web/core/components/editor/pdf/document.tsx, apps/web/core/constants/editor.ts
Registers Vazirmatn (regular/bold) for react-pdf usage, imports/registers Vazirmatn in the web PDF document, and adds a [dir='rtl'] stylesheet rule that sets fontFamily: "Vazirmatn" and textAlign: "right".

Persian Language Support Infrastructure and Translations

Layer / File(s) Summary
Persian language registration and type definitions
packages/i18n/src/constants/language.ts, packages/i18n/src/types/language.ts
Adds Persian ({ label: "فارسی", value: "fa" }) to SUPPORTED_LANGUAGES and includes "fa" in the TLanguage union.
Authentication and core UI translations
packages/i18n/src/locales/fa/accessibility.json, packages/i18n/src/locales/fa/auth.json, packages/i18n/src/locales/fa/common.json
Provides Persian translations for accessibility ARIA labels, SSO/auth flows, password/session flows, and the shared common UI string catalog.
Feature-specific Persian translations
packages/i18n/src/locales/fa/*.json (many files)
Adds complete Persian localization for automations, editor, empty states, home, inbox, integrations, modules, navigation, notifications, page, power-k, project-settings, project, settings, stickies, templates, tour, updates, wiki, work-item-types, work-items, workflow, workspace, and other product areas.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibble fonts with careful paws,

Vazirmatn threads through RTL laws,
فارسی whispers, right-aligned and neat,
PDFs hum softly, direction complete,
A rabbit hops—translations and fonts meet.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change: adding Persian (Farsi) localization with the language code 'fa' to the i18n package.
Description check ✅ Passed The description provides a detailed summary, translation details with terminology table, files changed, and a comprehensive test plan. It exceeds the template requirements by including specific Persian terms and plural format preservation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@danialshirali16
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Register Vazirmatn as a second font family for RTL content.
In the backend node renderers, read the TipTap `dir` attribute on
paragraph and heading nodes; when `dir === "rtl"`, apply
fontFamily "Vazirmatn" and default textAlign to "right" so that
Persian/Arabic characters are shaped correctly and flow right-to-left.
Mirror the same Vazirmatn Font.register and a `[dir='rtl']` stylesheet
rule in the frontend HTML-based export path.

LTR (Inter) behaviour is completely unchanged.

https://claude.ai/code/session_01BxEgURqex1hukdwboM3XF6
Begins the full Persian localization of Plane. Translates all 814 keys
in common.json into professional product-marketing Persian, following
the project terminology conventions (تسک for work item, اسپرینت for
cycle, فضای کاری for workspace). All JSON keys, ICU placeholders, and
HTML syntax are preserved unchanged.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates all workspace settings UI strings including general settings,
members, billing, exports, webhooks, API tokens, integrations, group
syncing, identity, applications (OAuth/consent flows), and Plane AI.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates project settings including general, members, states, labels,
estimates, automations, workflows, work item types, features (cycles,
modules, views, pages, intake, time tracking, milestones), and
auto-schedule cycle configuration.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates work item type settings including property types, attributes,
formula builder, hierarchy configuration, enable/disable flows, and
all validation/toast messages.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates all integration UI strings: GitHub, GitLab, GitLab Enterprise,
Slack, Sentry, Bitbucket DC, OAuth Bridge, GitHub Enterprise, Silo
error messages, and import status labels.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates work item CRUD, comments/replies, layouts, states, relations,
archive/restore, bulk operations, recurring work items, and epics.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates project cycles, views, issues, modules, pages, disabled-project
states, module statuses/layouts, member fields, and CSV import flows.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates workspace creation, dashboard, analytics, projects, views,
draft issues, pages, cycles, and CSV member import flows.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates SSO domain management, SAML/OIDC providers, sign-in/sign-up,
password management, forgot/reset password, and LDAP auth flows.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates project/work-item/page template settings, publish to marketplace
form fields, empty states, toasts, and delete/unpublish confirmations.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates automation settings, triggers, conditions, actions, schedules,
cron expressions, table columns, toasts, empty states, and global automations.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates common, project, workspace, and settings empty state messages
covering work items, cycles, modules, views, pages, epics, analytics, and more.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates command palette actions: contextual, creation, navigation, account,
miscellaneous, preferences, help actions, placeholders, and group titles.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates product tour steps for work items, cycles, modules, pages,
intake, MCP connectors, navigation modal, get-started checklist and sections.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates account settings (profile, preferences, notifications, security,
API tokens, activity, connections), profile stats/tabs/empty-states, themes.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates wiki collections (predefined, create/edit/delete modals, menus,
list columns, toasts) and wiki upgrade flow with nested pages banner.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates page navigation pane (outline/info/assets/comments tabs, sticky
toasts) and page actions (move page, remove from collection).

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Translates workflow (69), inbox (64), home (59), update (48), notification
(46), editor (46), stickies (43), accessibility (29), navigation (28),
cycle (25), module (4) namespace files.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
Adds 'fa' to TLanguage union type and SUPPORTED_LANGUAGES list
so Persian appears in the language selector UI.

https://claude.ai/code/session_01M7gF1AE6awDVuqXRZmPiTL
@danialshirali16 danialshirali16 force-pushed the claude/eloquent-wozniak-YWDUc branch from cebfd1a to b6be06d Compare June 3, 2026 08:47
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/live/src/lib/pdf/plane-pdf-exporter.tsx`:
- Around line 56-70: The font directory resolution uses process.cwd() which is
not deterministic; update the vazirmatnFontDir calculation to resolve relative
to the module using import.meta.url (same pattern used for Inter) so
Font.register gets a stable path. Locate vazirmatnFontDir and replace the
process.cwd() + path.resolve usage with a module-relative resolution (e.g.,
using new URL or path.dirname(import.meta.url) to compute the fonts/vazirmatn
directory) so the src paths passed into Font.register are deterministic
regardless of launch directory.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 12bb12ee-8486-4aa6-a3de-7f0a64a87113

📥 Commits

Reviewing files that changed from the base of the PR and between b1c78fe and cebfd1a.

📒 Files selected for processing (34)
  • apps/live/src/lib/pdf/node-renderers.tsx
  • apps/live/src/lib/pdf/plane-pdf-exporter.tsx
  • apps/web/core/components/editor/pdf/document.tsx
  • apps/web/core/constants/editor.ts
  • packages/i18n/src/constants/language.ts
  • packages/i18n/src/locales/fa/accessibility.json
  • packages/i18n/src/locales/fa/auth.json
  • packages/i18n/src/locales/fa/automation.json
  • packages/i18n/src/locales/fa/common.json
  • packages/i18n/src/locales/fa/cycle.json
  • packages/i18n/src/locales/fa/editor.json
  • packages/i18n/src/locales/fa/empty-state.json
  • packages/i18n/src/locales/fa/home.json
  • packages/i18n/src/locales/fa/inbox.json
  • packages/i18n/src/locales/fa/integration.json
  • packages/i18n/src/locales/fa/module.json
  • packages/i18n/src/locales/fa/navigation.json
  • packages/i18n/src/locales/fa/notification.json
  • packages/i18n/src/locales/fa/page.json
  • packages/i18n/src/locales/fa/power-k.json
  • packages/i18n/src/locales/fa/project-settings.json
  • packages/i18n/src/locales/fa/project.json
  • packages/i18n/src/locales/fa/settings.json
  • packages/i18n/src/locales/fa/stickies.json
  • packages/i18n/src/locales/fa/template.json
  • packages/i18n/src/locales/fa/tour.json
  • packages/i18n/src/locales/fa/update.json
  • packages/i18n/src/locales/fa/wiki.json
  • packages/i18n/src/locales/fa/work-item-type.json
  • packages/i18n/src/locales/fa/work-item.json
  • packages/i18n/src/locales/fa/workflow.json
  • packages/i18n/src/locales/fa/workspace-settings.json
  • packages/i18n/src/locales/fa/workspace.json
  • packages/i18n/src/types/language.ts

Comment thread apps/live/src/lib/pdf/plane-pdf-exporter.tsx Outdated
…esolution

Replaces process.cwd()-based font path with a module-relative path using
import.meta.url so the font directory resolves correctly regardless of the
server's launch directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants