feat(i18n): add Persian (Farsi) localization#9198
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds 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. ChangesRTL-Ready PDF Rendering System
Persian Language Support Infrastructure and Translations
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
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
cebfd1a to
b6be06d
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (34)
apps/live/src/lib/pdf/node-renderers.tsxapps/live/src/lib/pdf/plane-pdf-exporter.tsxapps/web/core/components/editor/pdf/document.tsxapps/web/core/constants/editor.tspackages/i18n/src/constants/language.tspackages/i18n/src/locales/fa/accessibility.jsonpackages/i18n/src/locales/fa/auth.jsonpackages/i18n/src/locales/fa/automation.jsonpackages/i18n/src/locales/fa/common.jsonpackages/i18n/src/locales/fa/cycle.jsonpackages/i18n/src/locales/fa/editor.jsonpackages/i18n/src/locales/fa/empty-state.jsonpackages/i18n/src/locales/fa/home.jsonpackages/i18n/src/locales/fa/inbox.jsonpackages/i18n/src/locales/fa/integration.jsonpackages/i18n/src/locales/fa/module.jsonpackages/i18n/src/locales/fa/navigation.jsonpackages/i18n/src/locales/fa/notification.jsonpackages/i18n/src/locales/fa/page.jsonpackages/i18n/src/locales/fa/power-k.jsonpackages/i18n/src/locales/fa/project-settings.jsonpackages/i18n/src/locales/fa/project.jsonpackages/i18n/src/locales/fa/settings.jsonpackages/i18n/src/locales/fa/stickies.jsonpackages/i18n/src/locales/fa/template.jsonpackages/i18n/src/locales/fa/tour.jsonpackages/i18n/src/locales/fa/update.jsonpackages/i18n/src/locales/fa/wiki.jsonpackages/i18n/src/locales/fa/work-item-type.jsonpackages/i18n/src/locales/fa/work-item.jsonpackages/i18n/src/locales/fa/workflow.jsonpackages/i18n/src/locales/fa/workspace-settings.jsonpackages/i18n/src/locales/fa/workspace.jsonpackages/i18n/src/types/language.ts
…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.
Summary
fa) localization to the@plane/i18npackagefainTLanguagetype andSUPPORTED_LANGUAGESconstant (shown as فارسی in the language picker)Translation details
All keys are fully translated with no missing entries. Terminology is consistent throughout:
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 filespackages/i18n/src/types/language.ts— added"fa"toTLanguageunionpackages/i18n/src/constants/language.ts— added{ label: "فارسی", value: "fa" }toSUPPORTED_LANGUAGESTest plan
Summary by CodeRabbit