Skip to content
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

chore: Implement short translation keys #162

Merged
merged 19 commits into from
Jan 2, 2025
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4691eda
chore: load translations from PHP file, remove JSON file
danjohnson95 Jan 2, 2025
671ecf7
chore: support interpolated translations on support block
danjohnson95 Jan 2, 2025
cbe1bea
chore: use namespaced translation key for enums
danjohnson95 Jan 2, 2025
32c20c7
chore: use namespaced translation keys for component groups
danjohnson95 Jan 2, 2025
7b49c22
chore: use namespaced translation keys for components
danjohnson95 Jan 2, 2025
ff98998
chore: use namespaced translation keys for incidents
danjohnson95 Jan 2, 2025
d47ef2f
chore: use namespaced translation keys for incident templates
danjohnson95 Jan 2, 2025
f2d2e42
chore: use namespaced translation keys for metrics
danjohnson95 Jan 2, 2025
5aff35d
chore: use namespaced translation keys for schedules
danjohnson95 Jan 2, 2025
78e46a5
chore: use namespaced translation keys for subscribers
danjohnson95 Jan 2, 2025
39431ec
chore: use namespaced translation keys on Overview
danjohnson95 Jan 2, 2025
6b31c05
chore: use namespaced translation keys for integrations
danjohnson95 Jan 2, 2025
31ba765
chore: update header to use filament translation strings
danjohnson95 Jan 2, 2025
69e9190
chore: update footer to use namespaced translation key
danjohnson95 Jan 2, 2025
7d31d1e
chore: use namespaced translation keys for other components
danjohnson95 Jan 2, 2025
cdbcade
chore: update settings pages to use namespaced translation keys
danjohnson95 Jan 2, 2025
53a08ca
chore: fix some typos in relation to translation strings
danjohnson95 Jan 2, 2025
46996dd
feat: add language files
danjohnson95 Jan 2, 2025
2eca7b3
Fix en_GB customisation
jbrooksuk Jan 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: use namespaced translation keys for components
danjohnson95 committed Jan 2, 2025
commit 7b49c2268ef0b671424ce5512fc00a6ff139d897
36 changes: 18 additions & 18 deletions src/Filament/Resources/ComponentResource.php
Original file line number Diff line number Diff line change
@@ -23,29 +23,29 @@ public static function form(Form $form): Form
->schema([
Forms\Components\Section::make()->columns(2)->schema([
Forms\Components\TextInput::make('name')
->label(__('Name'))
->label(__('cachet::component.form.name_label'))
->required()
->maxLength(255)
->autocomplete(false),
Forms\Components\ToggleButtons::make('status')
->label(__('Status'))
->label(__('cachet::component.form.status_label'))
->inline()
->columnSpanFull()
->options(ComponentStatusEnum::class)
->required(),
Forms\Components\MarkdownEditor::make('description')
->label(__('Description'))
->label(__('cachet::component.form.description_label'))
->maxLength(255)
->columnSpanFull(),
Forms\Components\Select::make('component_group_id')
->relationship('group', 'name')
->searchable()
->preload()
->label(__('Component Group')),
->label(__('cachet::component.form.component_group_label')),
Forms\Components\TextInput::make('link')
->label(__('Link'))
->label(__('cachet::component.form.link_label'))
->url()
->hint(__('An optional link to the component.')),
->label(__('cachet::component.form.link_helper')),
]),

Forms\Components\Section::make()->columns(2)->schema([
@@ -62,36 +62,36 @@ public static function table(Table $table): Table
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->label(__('Name'))
->label(__('cachet::component.list.headers.name'))
->searchable(),
Tables\Columns\TextColumn::make('status')
->label(__('Status'))
->label(__('cachet::component.list.headers.status'))
->badge()
->sortable(),
Tables\Columns\TextColumn::make('order')
->label(__('Order'))
->label(__('cachet::component.list.headers.order'))
->numeric()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('group.name')
->label(__('Group'))
->label(__('cachet::component.list.headers.group'))
->sortable(),
Tables\Columns\IconColumn::make('enabled')
->label(__('Enabled'))
->label(__('cachet::component.list.headers.enabled'))
->boolean()
->toggleable(isToggledHiddenByDefault: false),
Tables\Columns\TextColumn::make('created_at')
->label(__('Created at'))
->label(__('cachet::component.list.headers.created_at'))
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->label(__('Updated at'))
->label(__('cachet::component.list.headers.updated_at'))
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('deleted_at')
->label(__('Deleted at'))
->label(__('cachet::component.list.headers.deleted_at'))
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
@@ -108,8 +108,8 @@ public static function table(Table $table): Table
]),
])
->reorderable('order')
->emptyStateHeading(__('Components'))
->emptyStateDescription(__('Components represent the various parts of your system that can affect the status of your status page.'));
->emptyStateHeading(__('cachet::component.list.empty_state.heading'))
->emptyStateDescription(__('cachet::component.list.empty_state.description'));
}

public static function getRelations(): array
@@ -130,12 +130,12 @@ public static function getPages(): array

public static function getLabel(): ?string
{
return __('Component');
return trans_choice('cachet::component.resource_label', 1);
}

public static function getPluralLabel(): ?string
{
return __('Components');
return trans_choice('cachet::component.resource_label', 2);
}

public static function getNavigationBadge(): ?string
Original file line number Diff line number Diff line change
@@ -24,41 +24,41 @@ public function form(Form $form): Form
return $form
->schema([
Forms\Components\TextInput::make('name')
->label(__('Name'))
->label(__('cachet::component.form.name_label'))
->required()
->maxLength(255),
Forms\Components\ToggleButtons::make('status')
->label(__('Status'))
->label(__('cachet::component.form.status_label'))
->inline()
->columnSpanFull()
->options(ComponentStatusEnum::class)
->required(),
Forms\Components\MarkdownEditor::make('description')
->label(__('Description'))
->label(__('cachet::component.form.description_label'))
->maxLength(255)
->columnSpanFull(),
Forms\Components\TextInput::make('link')
->label(__('Link'))
->label(__('cachet::component.form.link_label'))
->url()
->hint(__('An optional link to the component.')),
->helperText(__('cachet::component.form.link_helper')),
]);
}

public function table(Table $table): Table
{
return $table
->recordTitleAttribute('name')
->modelLabel(__('Component'))
->pluralModelLabel(__('Components'))
->modelLabel(trans_choice('cachet::component.resource_label', 1))
->pluralModelLabel(trans_choice('cachet::component.resource_label', 2))
->columns([
Tables\Columns\TextColumn::make('name')
->label(__('Name')),
->label(__('cachet::component.list.headers.name')),
Tables\Columns\TextColumn::make('status')
->label(__('Status'))
->label(__('cachet::component.list.headers.status'))
->badge()
->sortable(),
Tables\Columns\IconColumn::make('enabled')
->label(__('Enabled'))
->label(__('cachet::component.list.headers.enabled'))
->boolean()
->toggleable(isToggledHiddenByDefault: false),
])