-
-
Notifications
You must be signed in to change notification settings - Fork 254
Improve translation for "link" and "unlink" (oauth) #1612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughUpdated OAuth action label construction in EditProfile to use translation placeholders. Adjusted English translations for profile link/unlink to include :name. No other logic or signatures changed. Changes
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Nitpick comments (1)
app/Filament/Pages/Auth/EditProfile.php (1)
177-177: Optional: Add a backward-compatible fallback for locales not yet updatedIf some locales haven’t added ':name' yet, the name will disappear from the label in those languages. You can add a small fallback that appends the name when the translation doesn’t change after passing parameters.
Apply this diff:
- ->label(trans('profile.' . ($unlink ? 'unlink' : 'link'), ['name' => $name])) + ->label(function () use ($unlink, $name) { + $key = 'profile.' . ($unlink ? 'unlink' : 'link'); + $withName = trans($key, ['name' => $name]); + $withoutName = trans($key); + // If the translation didn't change with the parameter, the locale likely lacks the ':name' placeholder. + return $withName === $withoutName + ? trim($withoutName . ' ' . $name) + : $withName; + })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
app/Filament/Pages/Auth/EditProfile.php(1 hunks)lang/en/profile.php(1 hunks)
🔇 Additional comments (3)
lang/en/profile.php (1)
24-25: Placeholders added and trailing space removed — looks goodSwitching to a named placeholder improves i18n flexibility and eliminates the invisible trailing space issue.
app/Filament/Pages/Auth/EditProfile.php (2)
177-177: Using a translation key with a placeholder is the right directionThis makes the label fully localizable and removes string concatenation in code.
171-181: Sanity check: provider name safety$schema->getName() is used in labels and notifications. Ensure provider names are trusted constants (not user-supplied) to avoid any chance of HTML injection in rendered labels/notifications. Filament typically escapes labels, but validating the data source keeps things robust.
Add the oauth name as parameter to the translation and remove the invisible space at the end of the translation string.