Skip to content

Commit

Permalink
Merge pull request #23 from grafst/main
Browse files Browse the repository at this point in the history
make heading, subheading and navigationlabel translatable
  • Loading branch information
Jehizkia authored Sep 17, 2024
2 parents cf97f04 + 6b3d30f commit 4c5ad62
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 6 deletions.
3 changes: 3 additions & 0 deletions resources/lang/ar/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

// translations for Kenepa/Banner
return [
'title' => 'إدارة البانر',
'subheading' => 'إدارة اللافتات الخاصة بك',
'navigation_label' => 'إدارة البانر',
'create' => 'اضافة',
'save' => 'حفظ',
'inactive' => 'غير نشط',
Expand Down
5 changes: 5 additions & 0 deletions resources/lang/de/banner.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

// translations for Kenepa/Banner
return [
];
79 changes: 79 additions & 0 deletions resources/lang/de/form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php

return [
'tabs' => [
'general' => 'Allgemein',
'styling' => 'Styling',
'scheduling' => 'Planung',
],
'fields' => [
'id' => 'ID',
'name' => 'Name',
'content' => 'Inhalt',
'render_location' => 'Anzeigeposition',
'render_location_help' => 'Mit der Anzeigeposition kannst du festlegen, wo ein Banner auf der Seite angezeigt wird. In Kombination mit Scopes wird dies zu einem leistungsstarken Tool, um zu steuern, wo und wann deine Banner angezeigt werden. Du kannst Banner im Header, in der Seitenleiste oder an anderen strategischen Positionen platzieren, um deren Sichtbarkeit und Wirkung zu maximieren.',
'render_location_options' => [
'panel' => [
'header' => 'Header',
'page_start' => 'Anfang der Seite',
'page_end' => 'Ende der Seite',
],
'authentication' => [
'login_form_before' => 'Vor dem Login-Formular',
'login_form_after' => 'Nach dem Login-Formular',
'password_reset_form_before' => 'Vor dem Passwort-Zurücksetzen-Formular',
'password_reset_form_after' => 'Nach dem Passwort-Zurücksetzen-Formular',
'register_form_before' => 'Vor dem Registrierungsformular',
'register_form_after' => 'Nach dem Registrierungsformular',
],
'global_search' => [
'before' => 'Vor der globalen Suche',
'after' => 'Nach der globalen Suche',
],
'page_widgets' => [
'header_before' => 'Vor den Header-Widgets',
'header_after' => 'Nach den Header-Widgets',
'footer_before' => 'Vor den Footer-Widgets',
'footer_after' => 'Nach den Footer-Widgets',
],
'sidebar' => [
'nav_start' => 'Vor der Seitenleisten-Navigation',
'nav_end' => 'Nach der Seitenleisten-Navigation',
],
'resource_table' => [
'before' => 'Vor der Ressourcentabelle',
'after' => 'Nach der Ressourcentabelle',
],
],
'scope' => 'Scope',
'scope_help' => 'Mit der Scope-Funktion kannst du steuern, wo dein Banner angezeigt wird. Du kannst dein Banner auf bestimmte Seiten oder gesamte Ressourcen ausrichten, um sicherzustellen, dass es der richtigen Zielgruppe zur richtigen Zeit angezeigt wird.',
'options' => 'Optionen',
'can_be_closed_by_user' => 'Banner kann vom Benutzer geschlossen werden',
'can_truncate_message' => 'Inhalt des Banners wird gekürzt',
'is_active' => 'Ist aktiv',
'text_color' => 'Textfarbe',
'icon' => 'Icon',
'icon_color' => 'Iconfarbe',
'background' => 'Hintergrund',
'background_type' => 'Hintergrundtyp',
'background_type_solid' => 'Einfarbig',
'background_type_gradient' => 'Verlauf',
'start_color' => 'Startfarbe',
'end_color' => 'Endfarbe',
'start_time' => 'Startzeit',
'start_time_reset' => 'Startzeit zurücksetzen',
'end_time' => 'Endzeit',
'end_time_reset' => 'Endzeit zurücksetzen',
],
'badges' => [
'scheduling_status' => [
'active' => 'Aktiv',
'scheduled' => 'Geplant',
'expired' => 'Abgelaufen',
],
],
'actions' => [
'help' => 'Hilfe',
'reset' => 'Zurücksetzen',
],
];
30 changes: 30 additions & 0 deletions resources/lang/de/manager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

// translations for Kenepa/Banner
return [
'title' => 'Banner Verwaltung',
'subheading' => 'Verwalte deine Banner',
'navigation_label' => 'Banner Verwaltung',
'create' => 'Erstellen',
'save' => 'Speichern',
'inactive' => 'Inaktiv',
'banner_list_empty_state_title' => 'Noch keine Banner',
'banner_list_empty_state_description' => 'Sobald du dein erstes Banner erstellst, wird es hier angezeigt.',
'banner_edit_empty_state_title' => 'Kein Banner ausgewählt',
'banner_edit_empty_state_description' => 'Wähle oder erstelle ein Banner, um loszulegen',
'enable_all_banners' => 'Alle Banner aktivieren',
'disable_all_banners' => 'Alle Banner deaktivieren',
'successfully_deleted_banner' => 'Banner gelöscht',
'successfully_updated_banner' => 'Banner aktualisiert',
'successfully_created_banner' => 'Banner erstellt',
'disabled_all_banners' => 'Alle Banner deaktiviert',
'enabled_all_banners' => 'Alle Banner aktiviert',
'failed_to_load_banner' => 'Banner konnte nicht geladen werden',
'banner_name' => 'Name',
'banner_content' => 'Inhalt',
'banner_render_location' => 'Anzeigeposition',
'status_due' => 'Fällig',
'status_visible' => 'Sichtbar',
'status_fulfilled' => 'Erfüllt',
'active_since' => 'Aktiv seit',
];
3 changes: 3 additions & 0 deletions resources/lang/en/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

// translations for Kenepa/Banner
return [
'title' => 'Banner Manager',
'subheading' => 'Manage your banners',
'navigation_label' => 'Banner Manager',
'create' => 'Create',
'save' => 'Save',
'inactive' => 'Inactive',
Expand Down
3 changes: 3 additions & 0 deletions resources/lang/uk/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

// translations for Kenepa/Banner
return [
'title' => 'Менеджер банерів',
'subheading' => 'Керуйте своїми банерами',
'navigation_label' => 'Менеджер банерів',
'create' => 'Створити',
'save' => 'Зберегти',
'inactive' => 'Неактивний',
Expand Down
12 changes: 6 additions & 6 deletions src/BannerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ class BannerPlugin implements Plugin
{
protected bool $persistBannersInDatabase = false;

protected ?string $title = 'Banner Manager';
protected ?string $title = 'banner::manager.title';

protected ?string $subheading = 'Manage your banners';
protected ?string $subheading = 'banner::manager.subheading';

protected ?string $navigationIcon = 'heroicon-o-megaphone';

protected ?string $navigationLabel = 'Banner manager';
protected ?string $navigationLabel = 'banner::manager.navigation_label';

protected ?string $navigationGroup = '';

Expand Down Expand Up @@ -88,7 +88,7 @@ public function title(string $title): static

public function getTitle(): ?string
{
return $this->title;
return __($this->title);
}

public function subheading(string $subheading): static
Expand All @@ -100,7 +100,7 @@ public function subheading(string $subheading): static

public function getSubheading(): string
{
return $this->subheading;
return __($this->subheading);
}

public function navigationIcon(?string $icon): static
Expand Down Expand Up @@ -141,7 +141,7 @@ public function getNavigationSort(): ?int

public function getNavigationLabel()
{
return $this->navigationLabel;
return __($this->navigationLabel);
}

public function navigationLabel(?string $label): static
Expand Down

0 comments on commit 4c5ad62

Please sign in to comment.