Skip to content

Conversation

@danialshirali16
Copy link

@danialshirali16 danialshirali16 commented Jan 7, 2026

Description

This PR adds Persian (Farsi) language support to ComfyUI.

Changes

  • Added fa to output locales in .i18nrc.cjs with Persian-specific translation guidelines
  • Added Persian loaders for all translation files (main, nodeDefs, commands, settings) in src/i18n.ts
  • Added Persian (فارسی) option to language settings dropdown in src/platform/settings/constants/coreSettings.ts
  • Created empty Persian locale files in src/locales/fa/ directory (will be populated by the CI translation system)

Translation Guidelines

The Persian translation will follow these guidelines:

  • Use formal Persian (فارسی رسمی) for professional tone throughout the UI
  • Keep commonly used technical terms in English when they are standard in Persian software (e.g., node, workflow)
  • Use Arabic-Indic numerals (۰-۹) for numbers where appropriate
  • Maintain consistency with terminology used in Persian software and design applications

Testing

The configuration has been tested to ensure:

  • TypeScript compilation succeeds
  • All four translation files are properly referenced
  • Language option appears correctly in settings

Notes

Following the contribution guidelines in src/locales/CONTRIBUTING.md, the empty translation files will be automatically populated by the CI system using OpenAI. Persian-speaking contributors can review and refine these translations after the automated generation.


Special names to keep untranslated: flux, photomaker, clip, vae, cfg, stable audio, stable cascade, stable zero, controlnet, lora, HiDream, Civitai, Hugging Face

┆Issue is synchronized with this Notion page by Unito

…s in .i18nrc.cjs\n- Added Persian loaders for all translation files in src/i18n.ts\n- Added Persian option to language settings in coreSettings.ts\n- Created empty Persian locale files (will be populated by CI)\n- Added Persian-specific translation guidelines
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 7, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

This PR adds support for the Persian (fa) locale by registering it in the i18n configuration, creating locale-specific JSON files for translation content, adding dynamic loaders for Persian resources, and including Persian as a language option in core settings.

Changes

Cohort / File(s) Summary
i18n Configuration
.i18nrc.cjs, src/i18n.ts
Extended outputLocales to include 'fa' and added Persian translation guidelines. Added dynamic loaders for Persian locale across localeLoaders, nodeDefsLoaders, commandsLoaders, and settingsLoaders, mapping to corresponding fa/*.json files.
Persian Locale Files
src/locales/fa/*
Created four new locale resource files (commands.json, main.json, nodeDefs.json, settings.json), all initialized as empty JSON objects to serve as containers for future Persian translations.
Language Settings
src/platform/settings/constants/coreSettings.ts
Added Persian (fa) as a new language option in the Comfy.Locale language selector within CORE_SETTINGS, positioned after Portuguese (BR).

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11f8cdb and 34ab942.

📒 Files selected for processing (7)
  • .i18nrc.cjs
  • src/i18n.ts
  • src/locales/fa/commands.json
  • src/locales/fa/main.json
  • src/locales/fa/nodeDefs.json
  • src/locales/fa/settings.json
  • src/platform/settings/constants/coreSettings.ts
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx,vue,js,jsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width

Files:

  • src/locales/fa/nodeDefs.json
  • src/locales/fa/main.json
  • src/i18n.ts
  • src/locales/fa/settings.json
  • src/locales/fa/commands.json
  • src/platform/settings/constants/coreSettings.ts
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

Files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

Files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not use any type or as any type assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code

Files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Minimize the surface area (exported values) of each module and composable

Files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
🧠 Learnings (12)
📓 Common learnings
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/locales/en/main.json:774-780
Timestamp: 2025-12-09T04:35:43.971Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, locale files other than `src/locales/en/main.json` are generated automatically on every release. Developers only need to add English (en) key/values in `src/locales/en/main.json` when making PRs; manual updates to other locale files (fr, ja, ko, ru, zh, zh-TW, es, ar, tr, etc.) are not required and should not be suggested in reviews.
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`
📚 Learning: 2025-12-09T04:35:43.971Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/locales/en/main.json:774-780
Timestamp: 2025-12-09T04:35:43.971Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, locale files other than `src/locales/en/main.json` are generated automatically on every release. Developers only need to add English (en) key/values in `src/locales/en/main.json` when making PRs; manual updates to other locale files (fr, ja, ko, ru, zh, zh-TW, es, ar, tr, etc.) are not required and should not be suggested in reviews.

Applied to files:

  • src/locales/fa/nodeDefs.json
  • src/locales/fa/main.json
  • src/i18n.ts
  • src/locales/fa/settings.json
  • src/locales/fa/commands.json
  • .i18nrc.cjs
  • src/platform/settings/constants/coreSettings.ts
📚 Learning: 2025-12-08T01:21:41.368Z
Learnt from: jtydhr88
Repo: Comfy-Org/ComfyUI_frontend PR: 7214
File: src/i18n.ts:97-98
Timestamp: 2025-12-08T01:21:41.368Z
Learning: In src/i18n.ts and related i18n code, use `Record<string, unknown>` for locale data structures (including custom nodes i18n data) to maintain consistency with existing patterns used in localeLoaders, nodeDefsLoaders, commandsLoaders, and settingsLoaders.

Applied to files:

  • src/i18n.ts
  • .i18nrc.cjs
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`

Applied to files:

  • src/i18n.ts
  • .i18nrc.cjs
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.{vue,ts} : Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Applied to files:

  • src/i18n.ts
  • .i18nrc.cjs
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.vue : Use `vue-i18n` in composition API for string literals; place new translation entries in `src/locales/en/main.json`

Applied to files:

  • src/i18n.ts
  • .i18nrc.cjs
📚 Learning: 2025-12-09T03:39:54.501Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.

Applied to files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
📚 Learning: 2025-12-13T11:03:11.264Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:11.264Z
Learning: In the ComfyUI_frontend repository, lint rules require keeping 'import type' statements separate from non-type imports, even if importing from the same module. Do not suggest consolidating them into a single import statement. Ensure type imports remain on their own line (import type { ... } from 'module') and regular imports stay on separate lines.

Applied to files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
📚 Learning: 2025-12-17T00:40:09.635Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.stories.ts:45-55
Timestamp: 2025-12-17T00:40:09.635Z
Learning: Prefer pure function declarations over function expressions (e.g., use function foo() { ... } instead of const foo = () => { ... }) for pure functions in the repository. Function declarations are more functional-leaning, offer better hoisting clarity, and can improve readability and tooling consistency. Apply this guideline across TypeScript files in Comfy-Org/ComfyUI_frontend, including story and UI component code, except where a function expression is semantically required (e.g., callbacks, higher-order functions with closures).

Applied to files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
📚 Learning: 2025-12-30T22:22:33.836Z
Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().

Applied to files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
📚 Learning: 2025-12-11T12:25:15.470Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7358
File: src/components/dialog/content/signin/SignUpForm.vue:45-54
Timestamp: 2025-12-11T12:25:15.470Z
Learning: This repository uses CI automation to format code (pnpm format). Do not include manual formatting suggestions in code reviews for Comfy-Org/ComfyUI_frontend. If formatting issues are detected, rely on the CI formatter or re-run pnpm format. Focus reviews on correctness, readability, performance, accessibility, and maintainability rather than style formatting.

Applied to files:

  • src/i18n.ts
  • src/platform/settings/constants/coreSettings.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use vue-i18n for ALL UI strings

Applied to files:

  • .i18nrc.cjs
🔇 Additional comments (8)
src/locales/fa/nodeDefs.json (1)

1-1: Placeholder structure is correct.

The empty JSON object follows the established pattern for placeholder locale files. Based on learnings, locale files other than src/locales/en/main.json are auto-generated on every release, so CI will populate this file automatically.

src/locales/fa/commands.json (1)

1-1: Placeholder structure is correct.

The empty JSON object follows the established pattern for placeholder locale files. CI will auto-populate this file as part of the release process.

src/locales/fa/settings.json (1)

1-1: Placeholder structure is correct.

The empty JSON object follows the established pattern for placeholder locale files. CI will auto-populate this file as part of the release process.

src/locales/fa/main.json (1)

1-1: LGTM! Empty locale file is correct.

The empty JSON object is expected. Per the repository pattern, locale files are auto-generated by CI during releases, so an empty file serves as the initial placeholder for Persian translations.

Based on learnings, developers only need to maintain English translations in src/locales/en/main.json.

src/platform/settings/constants/coreSettings.ts (1)

413-414: LGTM! Persian language option added correctly.

The Persian (فارسی) language option is properly added to the locale selector with the correct ISO code ('fa') and native language name. The placement after Portuguese (BR) maintains the existing ordering pattern.

.i18nrc.cjs (2)

12-12: LGTM! Persian locale added to output configuration.

The 'fa' locale is correctly added to the outputLocales array, enabling the CI translation system to generate Persian translations.


22-26: LGTM! Persian translation guidelines are comprehensive.

The Persian translation guidelines are well-defined and cover important aspects:

  • Formal tone (فارسی رسمی) for professional UI
  • Keeping technical terms in English where standard
  • Using Arabic-Indic numerals (۰-۹) appropriately
  • Maintaining consistency with Persian software terminology

These guidelines align with the PR objectives and will help ensure high-quality translations.

src/i18n.ts (1)

33-33: Persian locale loaders added correctly. All four required Persian (fa) locale files exist (main.json, commands.json, nodeDefs.json, settings.json) as placeholders and follow the established pattern. The implementation is consistent with other locales.


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.

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

🎨 Storybook Build Status

loading Build is starting...

⏰ Started at: 01/07/2026, 08:41:51 AM UTC

🚀 Building Storybook

  • 📦 Installing dependencies...
  • 🔧 Building Storybook components...
  • 🌐 Preparing deployment to Cloudflare Pages...

⏱️ Please wait while the Storybook build is in progress...

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

🎭 Playwright Test Results

loading Tests are starting...

⏰ Started at: 01/07/2026, 08:41:54 AM UTC

🚀 Running Tests

  • 🧪 chromium: Running tests...
  • 🧪 chromium-0.5x: Running tests...
  • 🧪 chromium-2x: Running tests...
  • 🧪 mobile-chrome: Running tests...

⏱️ Please wait while tests are running...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant