Skip to content

Commit 51b637a

Browse files
committed
Add visible indicator for the default language
1 parent f4f720c commit 51b637a

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

wcfsetup/install/files/lib/system/gridView/admin/LanguageGridView.class.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,25 @@ public function __construct()
5050
->label('wcf.global.name')
5151
->filter(new TextFilter())
5252
->titleColumn()
53-
->sortable(),
53+
->sortable()
54+
->renderer([
55+
new class extends DefaultColumnRenderer {
56+
#[\Override]
57+
public function render(mixed $value, DatabaseObject $row): string
58+
{
59+
\assert($row instanceof Language);
60+
61+
if ($row->isDefault) {
62+
$value .= \sprintf(
63+
' <span class="badge">%s</span>',
64+
WCF::getLanguage()->get('wcf.global.defaultValue')
65+
);
66+
}
67+
68+
return $value;
69+
}
70+
},
71+
]),
5472
GridViewColumn::for('languageCode')
5573
->label('wcf.acp.language.code')
5674
->filter(new TextFilter())

0 commit comments

Comments
 (0)