Skip to content

Conversation

@Nico4devv
Copy link
Contributor

@Nico4devv Nico4devv commented Jan 2, 2026

Summary by CodeRabbit

  • Localization
    • Added multilingual support with English and German language files
    • All user-facing interface text including labels, notification titles, buttons, and messages are now localized and translatable
    • Plugin can now display in multiple languages for improved accessibility

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The pull request adds localization support to the minecraft-modrinth plugin by replacing hardcoded English UI strings with translation lookups throughout the codebase, and introducing English and German translation language files containing the corresponding localized strings.

Changes

Cohort / File(s) Summary
Localization Implementation
minecraft-modrinth/src/Enums/ModrinthProjectType.php, minecraft-modrinth/src/Filament/Server/Pages/MinecraftModrinthProjectPage.php, minecraft-modrinth/src/MinecraftModrinthPlugin.php
Replaces hardcoded UI labels, notification titles, field descriptions, and fallback values with trans() calls to translation keys. Affected areas include version descriptions, download notifications, folder action headers, field labels (Minecraft Version, Loader, Installed), and settings text. Control flow unchanged.
Translation Language Files
minecraft-modrinth/lang/en/strings.php, minecraft-modrinth/lang/de/strings.php
New nested translation arrays providing English and German localized strings for plugin name, categories, settings, page fields, table headers, version details, actions, and notifications.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through strings so bright,
Trans-lating text from day to night,
Deutsch und English, side by side,
Modrinth worlds now worldwide wide! 🌍✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding translation/localization support to the Minecraft Modrinth plugin.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b59451 and 1017a34.

📒 Files selected for processing (5)
  • minecraft-modrinth/lang/de/strings.php
  • minecraft-modrinth/lang/en/strings.php
  • minecraft-modrinth/src/Enums/ModrinthProjectType.php
  • minecraft-modrinth/src/Filament/Server/Pages/MinecraftModrinthProjectPage.php
  • minecraft-modrinth/src/MinecraftModrinthPlugin.php

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
minecraft-modrinth/src/Filament/Server/Pages/MinecraftModrinthProjectPage.php (3)

87-105: Incomplete localization: table columns remain hardcoded.

The table columns (title, author, downloads, date_modified) are using hardcoded identifiers instead of localized labels. Translation keys are already defined in the language files but not being used.

🔎 Proposed fix to localize table column labels
             ->columns([
                 ImageColumn::make('icon_url')
                     ->label(''),
                 TextColumn::make('title')
+                    ->label(__('minecraft-modrinth::main.table.columns.title'))
                     ->searchable()
                     ->description(fn (array $record) => (strlen($record['description']) > 120) ? substr($record['description'], 0, 120).'...' : $record['description']),
                 TextColumn::make('author')
+                    ->label(__('minecraft-modrinth::main.table.columns.author'))
                     ->url(fn ($state) => "https://modrinth.com/user/$state", true)
                     ->toggleable(),
                 TextColumn::make('downloads')
+                    ->label(__('minecraft-modrinth::main.table.columns.downloads'))
                     ->icon('tabler-download')
                     ->numeric()
                     ->toggleable(),
                 TextColumn::make('date_modified')
+                    ->label(__('minecraft-modrinth::main.table.columns.date_modified'))
                     ->icon('tabler-calendar')
                     ->formatStateUsing(fn ($state) => Carbon::parse($state, 'UTC')->diffForHumans())
                     ->tooltip(fn ($state) => Carbon::parse($state, 'UTC')->timezone(user()->timezone ?? 'UTC')->format($table->getDefaultDateTimeDisplayFormat()))
                     ->toggleable(),
             ])

108-178: Incomplete localization: version entries and actions remain hardcoded.

Multiple UI elements in the download modal use hardcoded identifiers instead of localized labels:

  • Line 108: Download action label
  • Line 135: Version "type" label
  • Line 139: "downloads" label
  • Line 142: "published" label
  • Line 146: "changelog" label
  • Line 152: Inner download action label

Translation keys for all these elements exist in the language files.

🔎 Proposed fix to localize version modal labels
             ->recordActions([
                 Action::make('download')
+                    ->label(__('minecraft-modrinth::main.actions.download'))
                     ->schema(function (array $record) {
                         $schema = [];
 
                         /** @var Server $server */
                         $server = Filament::getTenant();
 
                         $versions = array_slice(MinecraftModrinth::getModrinthVersions($record['project_id'], $server), 0, 10);
                         foreach ($versions as $versionData) {
                             $files = $versionData['files'] ?? [];
                             $primaryFile = null;
 
                             foreach ($files as $fileData) {
                                 if ($fileData['primary']) {
                                     $primaryFile = $fileData;
                                     break;
                                 }
                             }
 
                             $schema[] = Section::make($versionData['name'])
                                 ->description($versionData['version_number'] . ($primaryFile ? ' (' . convert_bytes_to_readable($primaryFile['size']) . ')' : ' (' . __('minecraft-modrinth::main.version.no_file_found') . ')'))
                                 ->collapsed(!$versionData['featured'])
                                 ->collapsible()
                                 ->icon($versionData['version_type'] === 'alpha' ? 'tabler-circle-letter-a' : ($versionData['version_type'] === 'beta' ? 'tabler-circle-letter-b' : 'tabler-circle-letter-r'))
                                 ->iconColor($versionData['version_type'] === 'alpha' ? 'danger' : ($versionData['version_type'] === 'beta' ? 'warning' : 'success'))
                                 ->columns(3)
                                 ->schema([
                                     TextEntry::make('type')
+                                        ->label(__('minecraft-modrinth::main.version.type'))
                                         ->badge()
                                         ->color($versionData['version_type'] === 'alpha' ? 'danger' : ($versionData['version_type'] === 'beta' ? 'warning' : 'success'))
                                         ->state($versionData['version_type']),
                                     TextEntry::make('downloads')
+                                        ->label(__('minecraft-modrinth::main.version.downloads'))
                                         ->badge()
                                         ->state($versionData['downloads']),
                                     TextEntry::make('published')
+                                        ->label(__('minecraft-modrinth::main.version.published'))
                                         ->badge()
                                         ->state(Carbon::parse($versionData['date_published'], 'UTC')->diffForHumans())
                                         ->tooltip(Carbon::parse($versionData['date_published'], 'UTC')->timezone(user()->timezone ?? 'UTC')->format('M j, Y H:i:s')),
                                     TextEntry::make('changelog')
+                                        ->label(__('minecraft-modrinth::main.version.changelog'))
                                         ->columnSpanFull()
                                         ->markdown()
                                         ->state($versionData['changelog']),
                                 ])
                                 ->headerActions([
                                     Action::make('download')
+                                        ->label(__('minecraft-modrinth::main.actions.download'))
                                         ->visible(!is_null($primaryFile))
                                         ->action(function (DaemonFileRepository $fileRepository) use ($server, $versionData, $primaryFile) {

204-229: Incomplete localization: TextEntry labels remain hardcoded.

The TextEntry components on lines 204 and 207 use hardcoded English labels ('Minecraft Version' and 'Loader') instead of the translation keys defined in the language files.

🔎 Proposed fix to localize TextEntry labels
                 Grid::make(3)
                     ->schema([
-                        TextEntry::make('Minecraft Version')
+                        TextEntry::make('minecraft_version')
+                            ->label(__('minecraft-modrinth::main.page.minecraft_version'))
                             ->state(fn () => MinecraftModrinth::getMinecraftVersion($server) ?? __('minecraft-modrinth::main.page.unknown'))
                             ->badge(),
-                        TextEntry::make('Loader')
+                        TextEntry::make('loader')
+                            ->label(__('minecraft-modrinth::main.page.loader'))
                             ->state(fn () => MinecraftLoader::fromServer($server)?->getLabel() ?? __('minecraft-modrinth::main.page.unknown'))
                             ->badge(),
                         TextEntry::make('installed')
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2ca0f6 and 1c6a1c9.

📒 Files selected for processing (5)
  • minecraft-modrinth/lang/de/main.php
  • minecraft-modrinth/lang/en/main.php
  • minecraft-modrinth/src/Enums/ModrinthProjectType.php
  • minecraft-modrinth/src/Filament/Server/Pages/MinecraftModrinthProjectPage.php
  • minecraft-modrinth/src/MinecraftModrinthPlugin.php
🧰 Additional context used
🧬 Code graph analysis (1)
minecraft-modrinth/src/Filament/Server/Pages/MinecraftModrinthProjectPage.php (1)
minecraft-modrinth/src/Enums/ModrinthProjectType.php (2)
  • fromServer (29-45)
  • getLabel (13-19)
🪛 GitHub Actions: Lint
minecraft-modrinth/lang/en/main.php

[error] 1-1: Pint style issues detected: no_whitespace_in_blank_line, single_blank_line. Laravel check failed. Process completed with exit code 1.

minecraft-modrinth/lang/de/main.php

[error] 1-1: Pint style issues detected: no_whitespace_in_blank_line, single_blank_line. Laravel check failed. Process completed with exit code 1.

🔇 Additional comments (8)
minecraft-modrinth/src/Enums/ModrinthProjectType.php (1)

16-17: LGTM!

The localization implementation is correct. Both translation keys are properly defined in the language files.

minecraft-modrinth/src/MinecraftModrinthPlugin.php (2)

34-34: LGTM!

The label is correctly localized using the translation key defined in the language files.


47-47: LGTM!

The notification title is correctly localized.

minecraft-modrinth/src/Filament/Server/Pages/MinecraftModrinthProjectPage.php (5)

128-128: LGTM!

The version description correctly uses the localized string for "no file found".


159-159: LGTM!

Download notification titles are properly localized.

Also applies to: 167-167


190-190: LGTM!

The folder link label is correctly localized with parameter substitution.


205-205: LGTM!

The "unknown" fallback values are properly localized.

Also applies to: 208-208, 226-226


211-211: LGTM!

The installed count label is correctly localized with parameter substitution.

Copy link
Member

@Boy132 Boy132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use trans() instead of __()

@Nico4devv Nico4devv requested a review from Boy132 January 2, 2026 18:00
@Nico4devv
Copy link
Contributor Author

okay weit

Copy link
Member

@Boy132 Boy132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

For future reference, please create a separate branch for pull requests and don't use main. :)

@Boy132 Boy132 merged commit 65ab4a9 into pelican-dev:main Jan 3, 2026
3 of 4 checks passed
@Boy132 Boy132 linked an issue Jan 3, 2026 that may be closed by this pull request
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.

[Minecraft Modrinth] Add translations

2 participants