Skip to content

fix(i18n): translate hardcoded interface strings - #2471

Open
kazaminosuke wants to merge 11 commits into
pelican-dev:mainfrom
kazaminosuke:fix/hardcoded-i18n-strings
Open

fix(i18n): translate hardcoded interface strings#2471
kazaminosuke wants to merge 11 commits into
pelican-dev:mainfrom
kazaminosuke:fix/hardcoded-i18n-strings

Conversation

@kazaminosuke

Copy link
Copy Markdown
Contributor

Summary

This fixes a structural i18n gap where user-facing Filament and Livewire strings were passed directly to label(), tooltip(), Tab::make(), and related presentation methods instead of translation helpers.

  • Translate the Node connectivity status tooltips, including WebSocket failure and no-server states.
  • Translate webhook scope labels and use complete translated tab titles for Global and Server webhooks.
  • Translate the admin user 2FA method tooltip values.
  • Replace additional hardcoded management UI strings and common Captcha/OAuth settings labels with existing or new English translation keys.

Root cause

Several components bypassed the trans() convention even though their strings are rendered directly in the user interface. This left non-English locales with English-only labels, tooltips, and tab titles.

Validation

  • php -l for all 24 changed PHP and translation files
  • git diff --check

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d1cac97f-9e54-4735-8d1c-032582f4eb29

📥 Commits

Reviewing files that changed from the base of the PR and between c09ec3f and 6bc2def.

📒 Files selected for processing (1)
  • lang/en/admin/node.php
💤 Files with no reviewable changes (1)
  • lang/en/admin/node.php

📝 Walkthrough

Walkthrough

This PR replaces hardcoded administrative UI text with translation lookups across extension forms, server and node resources, webhooks, plugins, MFA indicators, alerts, and connectivity tooltips. English translation entries are added for the new keys, and tooltip content is JSON-encoded with HTML disabled.

Changes

Administrative UI localization

Layer / File(s) Summary
Extension and server form translations
app/Extensions/..., app/Filament/Admin/Resources/Eggs/..., app/Filament/Admin/Resources/Servers/..., lang/en/admin/server.php
CAPTCHA, OAuth, egg, and server form labels, placeholders, tooltips, and helper text now use translation keys.
Admin resource label translations
app/Filament/Admin/Resources/Nodes/..., app/Filament/Admin/Resources/Plugins/..., app/Filament/Admin/Resources/Servers/Pages/ListServers.php, app/Filament/Admin/Resources/Users/UserResource.php, lang/en/admin/node.php, lang/en/admin/plugin.php, lang/en/profile.php
Node, server, plugin, and MFA labels use localized values with supporting English entries.
Webhook scope and resource translations
app/Enums/WebhookScope.php, app/Filament/Admin/Resources/Webhooks/..., lang/en/admin/webhook.php
Webhook scope labels, tabs, columns, and filters use dedicated translation keys.
Connectivity and alert translations
app/Livewire/NodeClientConnectivity.php, app/Filament/Server/Pages/Console.php, lang/en/admin/node.php
Connectivity states and server conflict alert titles use translations; tooltip content is JSON-encoded with HTML disabled.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: translating hardcoded interface strings to i18n keys.
Description check ✅ Passed The description matches the changeset, covering translated tooltips, tab labels, settings labels, and validation.
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.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 `@app/Livewire/NodeClientConnectivity.php`:
- Around line 67-71: Update the icon tooltip construction in makeIcon and its
loadingIcon, offlineIcon, onlineIcon, warningIcon, and onlineNoWsIcon callers to
JSON/JavaScript-encode translated text before embedding it in the x-tooltip
expression. Preserve the tooltip behavior while ensuring quotes and newlines
cannot break the generated markup, and retain allowHTML: true only if the
translated content is explicitly trusted.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 971fc58a-6bd0-46a5-b106-33594608fc65

📥 Commits

Reviewing files that changed from the base of the PR and between f68b895 and 6cd7980.

📒 Files selected for processing (24)
  • app/Enums/WebhookScope.php
  • app/Extensions/Captcha/Schemas/BaseSchema.php
  • app/Extensions/OAuth/Schemas/DiscordSchema.php
  • app/Extensions/OAuth/Schemas/GithubSchema.php
  • app/Extensions/OAuth/Schemas/OAuthSchema.php
  • app/Extensions/OAuth/Schemas/SteamSchema.php
  • app/Filament/Admin/Resources/Eggs/Pages/EditEgg.php
  • app/Filament/Admin/Resources/Nodes/Pages/EditNode.php
  • app/Filament/Admin/Resources/Nodes/Pages/ListNodes.php
  • app/Filament/Admin/Resources/Nodes/RelationManagers/AllocationsRelationManager.php
  • app/Filament/Admin/Resources/Plugins/PluginResource.php
  • app/Filament/Admin/Resources/Servers/Pages/CreateServer.php
  • app/Filament/Admin/Resources/Servers/Pages/EditServer.php
  • app/Filament/Admin/Resources/Servers/Pages/ListServers.php
  • app/Filament/Admin/Resources/Users/UserResource.php
  • app/Filament/Admin/Resources/Webhooks/Pages/ListWebhookConfigurations.php
  • app/Filament/Admin/Resources/Webhooks/WebhookResource.php
  • app/Filament/Server/Pages/Console.php
  • app/Livewire/NodeClientConnectivity.php
  • lang/en/admin/node.php
  • lang/en/admin/plugin.php
  • lang/en/admin/server.php
  • lang/en/admin/webhook.php
  • lang/en/profile.php

Comment thread app/Livewire/NodeClientConnectivity.php
@kazaminosuke

Copy link
Copy Markdown
Contributor Author

CodeRabbit review follow-up: addressed the one actionable inline finding in c09ec3f. Node connectivity tooltip text is now JSON-encoded before interpolation into the x-tooltip expression, and allowHTML is disabled because translation strings are plain text. Validation: php -l app/Livewire/NodeClientConnectivity.php and git diff --check passed. No other actionable inline or top-level review comments were present.

@kazaminosuke

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment thread app/Filament/Admin/Resources/Nodes/Pages/EditNode.php Outdated
@kazaminosuke
kazaminosuke requested a review from Boy132 July 23, 2026 07:55
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