Conversation
|
@essinn is attempting to deploy a commit to the Zero Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis PR introduces updates to the mail application's internationalization. The Changes
Possibly related PRs
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
apps/mail/locales/fa.json (2)
3-41: Partially translated actions section with mixed language content.The common actions section has some translated items (logout, back, create) but many remain in English. Consider prioritizing the translation of frequently used actions for a more cohesive user experience.
I recommend completing translations for at least these high-frequency actions:
- Lines 15-24: Loading, moving, and archiving actions
- Lines 32-38: Image display and sender trust actions
47-101: Command palette and search bar sections need translation.These important navigation components are almost entirely in English. Consider prioritizing these sections in the next round of translations to improve the overall user experience for Farsi-speaking users.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/mail/i18n/config.ts(1 hunks)apps/mail/locales/fa.json(1 hunks)
🔇 Additional comments (6)
apps/mail/i18n/config.ts (4)
2-16: Quote style consistency update looks good.The change from double quotes to single quotes for language names ensures a consistent style throughout the configuration file.
16-16: Successfully added Farsi language support.The addition of the Farsi language entry aligns perfectly with the PR objectives and follows the established pattern for language definitions.
23-23: Consistent quote style for defaultLocale.The update to use single quotes for the defaultLocale value maintains consistency with the other string literals in the file.
27-29: Arrow function formatting improved.The addition of parentheses around the parameter in the arrow function follows TypeScript best practices for consistency.
apps/mail/locales/fa.json (2)
42-46: Well-translated UI theme and color sections.These sections have been fully translated to Farsi, providing a good user experience for these fundamental UI elements.
Also applies to: 207-215
1-432:Details
❓ Verification inconclusive
Good start on Farsi translations with some sections still in English.
The file provides a solid foundation for Farsi language support. As noted in the PR description, the translations are not complete, with many sections still in English (e.g., command palette, search bar, mail actions). This is acceptable for an initial implementation, with the expectation that translations will be completed incrementally.
To ensure the Farsi translations follow proper RTL (Right-to-Left) display requirements, please verify that the application has appropriate RTL support enabled:
🏁 Script executed:
#!/bin/bash # Check if the project has RTL support configuration echo "Checking for RTL support in the codebase..." rg -i "rtl|right-to-left|direction" --type ts --type tsx --type cssLength of output: 194
Action: Verify and Ensure RTL Support Configuration for Farsi Locale
The Farsi translations are a promising start for language support, even though several sections (e.g., command palette, search bar, mail actions) remain in English. However, our automated check for RTL support encountered an issue due to file-type recognition (error with tsx). This means we haven’t conclusively verified whether the application’s configuration enables proper RTL display.
Next Steps:
Update the RTL search command to include tsx files by adding an appropriate file-type definition. For example:
#!/bin/bash echo "Checking for RTL support in the codebase..." rg --type-add="tsx:*.tsx" -i "rtl|right-to-left|direction" --type ts --type tsx --type cssManually verify that:
- CSS or component files correctly set the
direction(e.g., usingdir="rtl", CSS rules for RTL layouts, or RTL-specific configuration).- The UI correctly applies RTL styling in Farsi-context views.
Once these aspects are ensured, the incremental improvements in translation can continue with confidence.
apps/mail/locales/fa.json
Outdated
| "attachmentCount": "{count, plural, =0 {attachments} one {attachment} other {attachments}}", | ||
| "fileCount": "{count, plural, =0 {files} one {file} other {files}}", |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify plural rules for Farsi language.
Farsi has different pluralization rules compared to English. The current implementation uses the standard plural format, but you may need to adjust these rules to properly handle Farsi grammar for quantities.
Also applies to: 182-182, 232-235
🌐 Web query:
What are the pluralization rules for Persian/Farsi language?
💡 Result:
In Persian (Farsi), pluralization primarily involves suffixation, with contextual rules for formality, etymology, and grammatical agreement. Here are the key rules and patterns:
Plural Suffixes
1. ها (hā)
- Most common and versatile suffix, applicable to all nouns (animate/inanimate, Persian/Arabic origin) [1][3][8].
- Written separately in formal contexts (کتابها ketābhā = "books") but may attach colloquially (کتابها) [1][2].
- Spoken Persian often drops the h sound, pronouncing it as -ā (کتابا ketābā) [1][8].
2. ان (ān)
- Used for animate nouns (e.g., humans, animals) in formal writing:
- مرد → مردان (mard → mardān = "men") [2][8].
- Exceptions: Some nouns ending in long vowels (آ/او/ای) require ی before ان:
آقا → آقایان (āqā → āqāyān = "gentlemen") [2].
- Less common in casual speech, where ها is preferred [3][4][8].
3. Arabic-derived plurals
- ات (āt): For Arabic loanwords (e.g., احساس → احساسات ehsās → ehsāsāt = "feelings") [3][4][8].
- Broken plurals: Internal vowel changes (e.g., کتاب → کُتُب ketāb → kotob = "books") [4][8].
- These forms are optional; ها is widely accepted even for Arabic nouns [3][4].
Special Cases
- After numbers: Plural suffixes are omitted (دو کتاب do ketāb = "two books") [7][10].
- Inanimate subjects: Use singular verbs (میزها بزرگ است mizhā bozorg ast = "the tables are big") [9].
- Possessive suffixes: Attach directly to plural nouns (کتابهایم ketābhāyam = "my books") [10].
Colloquial vs. Formal
| Feature | Formal | Colloquial |
|---|---|---|
| Plural suffix | ان for animates, ها for others | ها for all nouns [1][8] |
| Pronunciation | ها (hā) | ـا (ā) after consonants [1][8] |
| Verb agreement | Plural for animates | Singular for inanimates [9] |
Examples
- Formal: پرندگان (parandegān = "birds") [8].
- Colloquial: پرندهها (parandehā) [8].
- Arabic plural: مکاتب (makāteb = "schools") vs. مدرسهها (madāresehā) [4][8].
Persian pluralization is flexible, with ها serving as the default choice in most contexts, while ان and Arabic forms persist in formal or literary usage.
Citations:
- 1: https://www.youtube.com/watch?v=92pwZv1Q0k4
- 2: https://openbooks.lib.msu.edu/persian/chapter/2-9-plurals/
- 3: https://www.youtube.com/watch?v=i7PPYb5Qkik
- 4: https://www.youtube.com/watch?v=tDSwzKgrTb4
- 5: https://mylanguages.org/farsi_plural.php
- 6: https://en.wikipedia.org/wiki/Persian_nouns
- 7: https://en.wikibooks.org/wiki/Persian/Lesson_9
- 8: https://en.wikipedia.org/wiki/Persian_grammar
- 9: https://sites.la.utexas.edu/persian_online_resources/verbs/sgl-verb-for-pl-inanimate/
- 10: https://www.easypersian.com/farsi/lesson-20/
Update Farsi Pluralization Handling
Please adjust the ICU message syntax for Farsi so that it reflects the language’s pluralization rules. In Farsi, the grammar distinguishes only between the singular (when the count is exactly 1) and the plural (for all other counts), meaning that an explicit =0 case isn’t necessary. Consider removing the separate zero case and using just one and other for these entries.
- Files/Lines Affected:
apps/mail/locales/fa.json: Lines 123–124, as well as similar patterns at lines 182 and 232–235.
For example, change from:
"attachmentCount": "{count, plural, =0 {attachments} one {attachment} other {attachments}}",
"fileCount": "{count, plural, =0 {files} one {file} other {files}}",to something like:
"attachmentCount": "{count, plural, one {پیوست} other {پیوستها}}",
"fileCount": "{count, plural, one {فایل} other {فایلها}}",This update will align the pluralization with Farsi grammar rules where only the singular (for 1) and the plural (for all other numbers) are needed.
|
Thank you! We recently migrated to use Lingo.dv, to add a new language with Lingo you should:
|
|
Thanks for the feedback, I have updated the fa.json file to use empty strings and added 'fa' to the i18n.json file as requested. |
Added new file (fa.json) in apps/mail/locale and updated i18n config file to include Farsi. The translations are not complete but I have tried my best to translate some parts. I have made a start and expect others to finish.
Summary by CodeRabbit