From 5a7af1866ee94953a39bedad23d89debddceff4b Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 21 Jan 2025 23:21:19 -0300 Subject: [PATCH 1/6] Added translations to package for english and brazilian portuguese --- resources/lang/en/categories.php | 5 +++ resources/lang/en/comments.php | 5 +++ resources/lang/en/general.php | 8 +++++ resources/lang/en/news-letters.php | 5 +++ resources/lang/en/posts.php | 5 +++ resources/lang/en/seo-details.php | 5 +++ resources/lang/en/settings.php | 50 ++++++++++++++++++++++++++++ resources/lang/en/share-snippets.php | 5 +++ resources/lang/en/tags.php | 5 +++ resources/lang/pt_BR/settings.php | 50 ++++++++++++++++++++++++++++ src/FilamentBlogServiceProvider.php | 1 + src/Models/Setting.php | 27 ++++++++++----- src/Resources/SettingResource.php | 10 ++++-- 13 files changed, 170 insertions(+), 11 deletions(-) create mode 100644 resources/lang/en/categories.php create mode 100644 resources/lang/en/comments.php create mode 100644 resources/lang/en/general.php create mode 100644 resources/lang/en/news-letters.php create mode 100644 resources/lang/en/posts.php create mode 100644 resources/lang/en/seo-details.php create mode 100644 resources/lang/en/settings.php create mode 100644 resources/lang/en/share-snippets.php create mode 100644 resources/lang/en/tags.php create mode 100644 resources/lang/pt_BR/settings.php diff --git a/resources/lang/en/categories.php b/resources/lang/en/categories.php new file mode 100644 index 0000000..25058db --- /dev/null +++ b/resources/lang/en/categories.php @@ -0,0 +1,5 @@ + 'Created At', + 'updated_at' => 'Updated At', + 'deleted_at' => 'Deleted At', + 'created_by' => 'Created By', +]; \ No newline at end of file diff --git a/resources/lang/en/news-letters.php b/resources/lang/en/news-letters.php new file mode 100644 index 0000000..25058db --- /dev/null +++ b/resources/lang/en/news-letters.php @@ -0,0 +1,5 @@ + [ + 'columns' => [ + 'title' => 'Title', + 'description' => 'Description', + 'logo' => 'Logo', + 'organization_name' => 'Organization Name' + ] + ], + 'form' => [ + 'sections' => [ + 'general_information' => [ + 'title' => 'General Information', + ], + 'seo' => [ + 'title' => 'SEO', + 'subtitle' => 'Place your google analytic and adsense code here. This will be added to the head tag of your blog post only.', + ], + 'quick_links' => [ + 'title' => 'Quick Links', + 'subtitle' => 'Add your quick links here. This will be displayed in the footer of your blog.', + ], + ], + 'fields' => [ + 'general_information' => [ + 'title' => 'Title', + 'description' => 'Description', + 'logo' => 'Logo', + 'favicon' => 'Favicon', + 'organization_name' => 'Organization Name', + ], + 'seo' => [ + 'google_console_code' => 'Google Console Code', + 'google_analytic_code' => 'Google Analytic Code', + 'google_adsense_code' => 'Google Adsense Code', + ], + 'quick_links' => [ + 'repeater_quick_links' => [ + 'title' => 'Links', + 'label' => 'Label', + 'url' => 'URL', + 'add_to_links' => 'Add to Links', + 'helper_text' => 'URL should start with http:// or https://' + ] + ] + ] + ] +]; \ No newline at end of file diff --git a/resources/lang/en/share-snippets.php b/resources/lang/en/share-snippets.php new file mode 100644 index 0000000..25058db --- /dev/null +++ b/resources/lang/en/share-snippets.php @@ -0,0 +1,5 @@ + [ + 'columns' => [ + 'title' => 'Título', + 'description' => 'Descrição', + 'logo' => 'Logo', + 'organization_name' => 'Nome da Organização' + ] + ], + 'form' => [ + 'sections' => [ + 'general_information' => [ + 'title' => 'Informações Gerais', + ], + 'seo' => [ + 'title' => 'SEO', + 'subtitle' => 'Coloque aqui o código do Google Analytics e do Adsense. Isso será adicionado à tag head apenas da sua postagem no blog.', + ], + 'quick_links' => [ + 'title' => 'Links Rápidos', + 'subtitle' => 'Adicione seus links rápidos aqui. Eles serão exibidos no rodapé do seu blog.', + ], + ], + 'fields' => [ + 'general_information' => [ + 'title' => 'Título', + 'description' => 'Descrição', + 'logo' => 'Logo', + 'favicon' => 'Favicon', + 'organization_name' => 'Nome da Organização', + ], + 'seo' => [ + 'google_console_code' => 'Código do Google Console', + 'google_analytic_code' => 'Código do Google Analytics', + 'google_adsense_code' => 'Código do Google Adsense', + ], + 'quick_links' => [ + 'repeater_quick_links' => [ + 'title' => 'Links', + 'label' => 'Etiqueta', + 'url' => 'URL', + 'add_to_links' => 'Adicionar aos Links', + 'helper_text' => 'A URL deve começar com http:// ou https://' + ] + ] + ] + ] +]; diff --git a/src/FilamentBlogServiceProvider.php b/src/FilamentBlogServiceProvider.php index baa9e8b..fff5199 100644 --- a/src/FilamentBlogServiceProvider.php +++ b/src/FilamentBlogServiceProvider.php @@ -23,6 +23,7 @@ public function configurePackage(Package $package): void $package->name('filament-blog') ->hasConfigFile(['filamentblog']) ->hasMigrations('create_blog_tables') + ->hasTranslations() ->hasCommands(RenameTablesCommand::class) ->runsMigrations() ->hasViewComponents( diff --git a/src/Models/Setting.php b/src/Models/Setting.php index cde8227..a2a33a9 100644 --- a/src/Models/Setting.php +++ b/src/Models/Setting.php @@ -12,7 +12,6 @@ use Firefly\FilamentBlog\Database\Factories\SettingFactory; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -use Symfony\Component\Console\Descriptor\TextDescriptor; class Setting extends Model { @@ -54,62 +53,72 @@ protected static function newFactory() public static function getForm(): array { return [ - Section::make('General Information') + Section::make(__('filament-blog::settings.form.sections.general_information.title')) ->schema([ TextInput::make('title') + ->label(__('filament-blog::settings.form.fields.general_information.title')) ->maxLength(155) ->required(), TextInput::make('organization_name') + ->label(__('filament-blog::settings.form.fields.general_information.organization_name')) ->required() ->maxLength(155) ->minLength(3), Textarea::make('description') + ->label(__('filament-blog::settings.form.fields.general_information.description')) ->required() ->minLength(10) ->maxLength(1000) ->columnSpanFull(), FileUpload::make('logo') + ->label(__('filament-blog::settings.form.fields.general_information.logo')) ->hint('Max height 400') ->directory('setting/logo') ->maxSize(1024 * 1024 * 2) ->rules('dimensions:max_height=400') ->nullable()->columnSpanFull(), FileUpload::make('favicon') + ->label(__('filament-blog::settings.form.fields.general_information.favicon')) ->directory('setting/favicon') ->maxSize(50 ) ->nullable()->columnSpanFull() ])->columns(2), - Section::make('SEO') - ->description('Place your google analytic and adsense code here. This will be added to the head tag of your blog post only.') + Section::make(__('filament-blog::settings.form.sections.seo.title')) + ->description(__('filament-blog::settings.form.sections.seo.subtitle')) ->schema([ Textarea::make('google_console_code') + ->label(__('filament-blog::settings.form.fields.seo.google_console_code')) ->startsWith('nullable() ->columnSpanFull(), Textarea::make('google_analytic_code') + ->label(__('filament-blog::settings.form.fields.seo.google_analytic_code')) ->startsWith('endsWith('') ->nullable() ->columnSpanFull(), Textarea::make('google_adsense_code') + ->label(__('filament-blog::settings.form.fields.seo.google_adsense_code')) ->startsWith('endsWith('') ->nullable() ->columnSpanFull(), ])->columns(2), - Section::make('Quick Links') - ->description('Add your quick links here. This will be displayed in the footer of your blog.') + Section::make(__('filament-blog::settings.form.sections.quick_links.title')) + ->description(__('filament-blog::settings.form.sections.quick_links.subtitle')) ->schema([ Repeater::make('quick_links') - ->label('Links') + ->addActionLabel(__('filament-blog::settings.form.fields.quick_links.repeater_quick_links.add_to_links')) + ->label(__('filament-blog::settings.form.fields.quick_links.repeater_quick_links.title')) ->schema([ TextInput::make('label') + ->label(__('filament-blog::settings.form.fields.quick_links.repeater_quick_links.label')) ->required() ->maxLength(155), TextInput::make('url') - ->label('URL') - ->helperText('URL should start with http:// or https://') + ->label(__('filament-blog::settings.form.fields.quick_links.repeater_quick_links.url')) + ->helperText(__('filament-blog::settings.form.fields.quick_links.repeater_quick_links.helper_text')) ->required() ->url() ->maxLength(255), diff --git a/src/Resources/SettingResource.php b/src/Resources/SettingResource.php index aa96ce5..7bca96f 100644 --- a/src/Resources/SettingResource.php +++ b/src/Resources/SettingResource.php @@ -34,21 +34,27 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('title') + ->label(__('filament-blog::settings.table.columns.title')) ->limit(25) ->searchable(), Tables\Columns\TextColumn::make('description') + ->label(__('filament-blog::settings.table.columns.description')) ->limit(30) ->searchable(), - Tables\Columns\ImageColumn::make('logo'), + Tables\Columns\ImageColumn::make('logo') + ->label(__('filament-blog::settings.table.columns.logo')), - Tables\Columns\TextColumn::make('organization_name'), + Tables\Columns\TextColumn::make('organization_name') + ->label(__('filament-blog::settings.table.columns.organization_name')), Tables\Columns\TextColumn::make('created_at') + ->label(__('filament-blog::general.created_at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') + ->label(__('filament-blog::general.updated_at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), From 4a17a4d46e8b18163fb3f4d3d7aabf8a6677d58f Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Thu, 23 Jan 2025 14:34:22 -0300 Subject: [PATCH 2/6] :globe_with_meridians: Added translations to package for english and brazilian portuguese --- config/filamentblog.php | 8 +- resources/lang/en/categories.php | 16 +++- resources/lang/en/comments.php | 25 ++++++ resources/lang/en/news-letters.php | 5 -- resources/lang/en/news_letters.php | 20 +++++ resources/lang/en/posts.php | 82 +++++++++++++++++- resources/lang/en/seo-details.php | 5 -- resources/lang/en/seo_details.php | 21 +++++ resources/lang/en/settings.php | 2 + resources/lang/en/share-snippets.php | 5 -- resources/lang/en/share_snippets.php | 21 +++++ resources/lang/en/tags.php | 15 +++- resources/lang/pt_BR/categories.php | 19 +++++ resources/lang/pt_BR/comments.php | 29 +++++++ resources/lang/pt_BR/general.php | 8 ++ resources/lang/pt_BR/news_letters.php | 19 +++++ resources/lang/pt_BR/posts.php | 85 +++++++++++++++++++ resources/lang/pt_BR/seo_details.php | 21 +++++ resources/lang/pt_BR/settings.php | 2 + resources/lang/pt_BR/share_snippets.php | 21 +++++ resources/lang/pt_BR/tags.php | 18 ++++ src/Enums/PostStatus.php | 6 +- src/Models/Category.php | 2 + src/Models/Comment.php | 6 +- src/Models/Post.php | 20 ++++- src/Models/SeoDetail.php | 4 + src/Models/ShareSnippet.php | 6 +- src/Models/Tag.php | 2 + src/Resources/CategoryResource.php | 29 +++++-- .../RelationManagers/PostsRelationManager.php | 22 ++++- src/Resources/CommentResource.php | 26 ++++-- src/Resources/NewsletterResource.php | 19 ++++- .../Pages/ListNewsletters.php | 6 +- src/Resources/PostResource.php | 64 ++++++++++---- .../PostResource/Pages/ListPosts.php | 8 +- .../PostResource/Pages/ManaePostSeoDetail.php | 22 +++-- .../PostResource/Pages/ManagePostComments.php | 53 ++++++++---- src/Resources/PostResource/Pages/ViewPost.php | 10 ++- .../CommentsRelationManager.php | 10 ++- .../Widgets/BlogPostPublishedChart.php | 6 +- src/Resources/SeoDetailResource.php | 22 ++++- src/Resources/SettingResource.php | 15 +++- src/Resources/ShareSnippetResource.php | 15 +++- .../Pages/ListShareSnippets.php | 10 ++- src/Resources/TagResource.php | 20 ++++- 45 files changed, 739 insertions(+), 111 deletions(-) delete mode 100644 resources/lang/en/news-letters.php create mode 100644 resources/lang/en/news_letters.php delete mode 100644 resources/lang/en/seo-details.php create mode 100644 resources/lang/en/seo_details.php delete mode 100644 resources/lang/en/share-snippets.php create mode 100644 resources/lang/en/share_snippets.php create mode 100644 resources/lang/pt_BR/categories.php create mode 100644 resources/lang/pt_BR/comments.php create mode 100644 resources/lang/pt_BR/general.php create mode 100644 resources/lang/pt_BR/news_letters.php create mode 100644 resources/lang/pt_BR/posts.php create mode 100644 resources/lang/pt_BR/seo_details.php create mode 100644 resources/lang/pt_BR/share_snippets.php create mode 100644 resources/lang/pt_BR/tags.php diff --git a/config/filamentblog.php b/config/filamentblog.php index 7c16055..55a2432 100644 --- a/config/filamentblog.php +++ b/config/filamentblog.php @@ -15,7 +15,7 @@ return [ 'tables' => [ - 'prefix' => 'fblog_', // prefix for all blog tables + 'prefix' => 'blog_', // prefix for all blog tables ], 'route' => [ 'prefix' => 'blogs', @@ -49,4 +49,10 @@ 'site_key' => env('RECAPTCHA_SITE_KEY'), 'secret_key' => env('RECAPTCHA_SECRET_KEY'), ], + + 'group_navigation_title' => 'Blog', + + 'date_format' => 'Y-m-d', + + 'time_format' => 'H:i', ]; diff --git a/resources/lang/en/categories.php b/resources/lang/en/categories.php index 25058db..cf0581e 100644 --- a/resources/lang/en/categories.php +++ b/resources/lang/en/categories.php @@ -1,5 +1,19 @@ 'Category', + 'plural_title' => 'Categories', + 'forms' => [ + 'fields' => [ + 'name' => 'Name', + 'slug' => 'Slug', + ], + ], + 'tables' => [ + 'columns' => [ + 'name' => 'Name', + 'slug' => 'Slug', + 'posts_count' => 'Posts Count', + ], + ], ]; \ No newline at end of file diff --git a/resources/lang/en/comments.php b/resources/lang/en/comments.php index 25058db..e357d63 100644 --- a/resources/lang/en/comments.php +++ b/resources/lang/en/comments.php @@ -1,5 +1,30 @@ 'Comment', + 'plural_title' => 'Comments', + 'forms' => [ + 'fields' => [ + 'user' => 'User', + 'post' => 'Post', + 'comment' => 'Comment', + 'approved' => 'Approved', + ] + ], + 'tables' => [ + 'columns' => [ + 'user' => 'User', + 'post' => 'Post', + 'comment' => 'Comment', + 'approved' => 'Approved', + 'approved_at' => [ + 'label' => 'Approved At', + 'placeholder' => 'Not approved yet', + ] + ], + 'filters' => [ + 'users' => 'Users', + ] + ] ]; \ No newline at end of file diff --git a/resources/lang/en/news-letters.php b/resources/lang/en/news-letters.php deleted file mode 100644 index 25058db..0000000 --- a/resources/lang/en/news-letters.php +++ /dev/null @@ -1,5 +0,0 @@ - 'News Letter', + 'plural_title' => 'News Letters', + 'list_title' => 'Newsletters Subscriber', + 'forms' => [ + 'fields' => [ + 'email' => 'Email', + 'subscribed' => 'Subscribed', + ] + ], + 'tables' => [ + 'columns' => [ + 'email' => 'Email', + 'subscribed' => 'Subscribed', + ] + ] + +]; \ No newline at end of file diff --git a/resources/lang/en/posts.php b/resources/lang/en/posts.php index 25058db..d9e16fa 100644 --- a/resources/lang/en/posts.php +++ b/resources/lang/en/posts.php @@ -1,5 +1,85 @@ 'Posts', + 'plural_title' => 'Posts', + 'forms' => [ + 'fields' => [ + 'category' => 'Category', + 'title' => 'Title', + 'slug' => 'Slug', + 'sub_title' => 'Sub Title', + 'tags' => 'Tags', + 'body' => 'Body', + 'cover_photo' => 'Cover Photo', + 'photo_alt_text' => 'Photo Alt Text', + 'status' => [ + 'label' => 'Status', + 'options' => [ + 'pending' => 'Pending', + 'scheduled' => 'Scheduled', + 'published' => 'Published', + ], + ], + 'published_at' => 'Published At', + 'scheduled_for' => 'Scheduled For', + 'user' => 'User', + 'keywords' => 'Keywords', + 'description' => 'Description', + ], + 'sections' => [ + 'general' => 'General', + 'publish_information' => 'Publish Information', + 'description' => 'Description', + 'header_title' => 'Blog Details', + 'titles' => 'Titles', + 'feature_image' => 'Feature Image', + 'status' => 'Status', + 'comment' => 'Comment', + ], + 'tabs' => [ + 'edit_page' => [ + 'view_post' => 'View Post', + 'manage_seo_details' => 'Manage SEO Detail', + 'manage_comments' => 'Manage Comments', + 'edit_post' => 'Edit Post', + ], + 'list_page' => [ + 'all' => 'All', + 'published' => 'Published', + 'scheduled' => 'Scheduled', + 'pending' => 'Pending', + ] + ], + 'widget' => [ + 'cards' => [ + 'published_post' => 'Published Post', + 'scheduled_post' => 'Scheduled Post', + 'pending_post' => 'Pending Post', + ] + ], + 'actions' => [ + 'preview' => 'Preview', + 'send_notification' => 'Send Notification', + ] + ], + 'tables' => [ + 'columns' => [ + 'title' => 'Title', + 'status' => 'Status', + 'cover_photo' => 'Cover Photo', + 'author' => 'Author', + 'description' => 'Description', + 'keywords' => 'Keywords', + 'commented_by' => 'Commented By', + 'comment' => 'Comment', + 'approved_at' => [ + 'label' => 'Approved At', + 'placeholder' => 'Not approved yet', + ], + ], + 'filters' => [ + 'user' => 'User', + ] + ] ]; \ No newline at end of file diff --git a/resources/lang/en/seo-details.php b/resources/lang/en/seo-details.php deleted file mode 100644 index 25058db..0000000 --- a/resources/lang/en/seo-details.php +++ /dev/null @@ -1,5 +0,0 @@ - 'SEO Detail', + 'plural_title' => 'SEO Details', + 'forms' => [ + 'fields' => [ + 'post' => 'Post', + 'title' => 'Title', + 'keywords' => 'Keywords', + 'description' => 'Description' + ] + ], + 'tables' => [ + 'columns' => [ + 'post' => 'Post', + 'title' => 'Title', + 'keywords' => 'Keywords' + ] + ] +]; \ No newline at end of file diff --git a/resources/lang/en/settings.php b/resources/lang/en/settings.php index 9547126..4a1773c 100644 --- a/resources/lang/en/settings.php +++ b/resources/lang/en/settings.php @@ -1,6 +1,8 @@ 'Setting', + 'plural_title' => 'Settings', 'table' => [ 'columns' => [ 'title' => 'Title', diff --git a/resources/lang/en/share-snippets.php b/resources/lang/en/share-snippets.php deleted file mode 100644 index 25058db..0000000 --- a/resources/lang/en/share-snippets.php +++ /dev/null @@ -1,5 +0,0 @@ - 'Share Snippet', + 'plural_title' => 'Share Snippets', + 'subtitle' => 'Please visit https://platform.sharethis.com to get the script code and html code for sharing snippets', + 'forms' => [ + 'fields' => [ + 'js_script' => 'JS Script', + 'html_code' => 'HTML Code', + 'active' => 'Active', + ] + ], + 'tables' => [ + 'columns' => [ + 'script_code' => 'Script Code', + 'html_code' => 'HTML Code', + 'active' => 'Active', + ] + ] +]; \ No newline at end of file diff --git a/resources/lang/en/tags.php b/resources/lang/en/tags.php index 25058db..52e1a1c 100644 --- a/resources/lang/en/tags.php +++ b/resources/lang/en/tags.php @@ -1,5 +1,18 @@ 'Tag', + 'plural_title' => 'Tags', + 'forms' => [ + 'fields' => [ + 'name' => 'Name', + 'slug' => 'Slug', + ], + ], + 'tables' => [ + 'columns' => [ + 'name' => 'Name', + 'slug' => 'Slug', + ], + ], ]; \ No newline at end of file diff --git a/resources/lang/pt_BR/categories.php b/resources/lang/pt_BR/categories.php new file mode 100644 index 0000000..66480c5 --- /dev/null +++ b/resources/lang/pt_BR/categories.php @@ -0,0 +1,19 @@ + 'Categoria', + 'plural_title' => 'Categorias', + 'forms' => [ + 'fields' => [ + 'name' => 'Nome', + 'slug' => 'Slug', + ], + ], + 'tables' => [ + 'columns' => [ + 'name' => 'Nome', + 'slug' => 'Slug', + 'posts_count' => 'Quantidade de Publicações', + ], + ], +]; diff --git a/resources/lang/pt_BR/comments.php b/resources/lang/pt_BR/comments.php new file mode 100644 index 0000000..6e393ab --- /dev/null +++ b/resources/lang/pt_BR/comments.php @@ -0,0 +1,29 @@ + 'Comentário', + 'plural_title' => 'Comentários', + 'forms' => [ + 'fields' => [ + 'user' => 'Usuário', + 'post' => 'Publicação', + 'comment' => 'Comentário', + 'approved' => 'Aprovado', + ] + ], + 'tables' => [ + 'columns' => [ + 'user' => 'Usuário', + 'post' => 'Publicação', + 'comment' => 'Comentário', + 'approved' => 'Aprovado', + 'approved_at' => [ + 'label' => 'Aprovado Em', + 'placeholder' => 'Não aprovado ainda', + ] + ], + 'filters' => [ + 'user' => 'Usuário', + ] + ] +]; \ No newline at end of file diff --git a/resources/lang/pt_BR/general.php b/resources/lang/pt_BR/general.php new file mode 100644 index 0000000..aff2afd --- /dev/null +++ b/resources/lang/pt_BR/general.php @@ -0,0 +1,8 @@ + 'Criado Em', + 'updated_at' => 'Atualizado Em', + 'deleted_at' => 'Deletado Em', + 'created_by' => 'Criado Por', +]; diff --git a/resources/lang/pt_BR/news_letters.php b/resources/lang/pt_BR/news_letters.php new file mode 100644 index 0000000..a7ef01d --- /dev/null +++ b/resources/lang/pt_BR/news_letters.php @@ -0,0 +1,19 @@ + 'Boletim Informativo', + 'plural_title' => 'Boletins Informativos', + 'list_title' => 'Assinantes do Boletim Informativo', + 'forms' => [ + 'fields' => [ + 'email' => 'E-mail', + 'subscribed' => 'Inscrito', + ] + ], + 'tables' => [ + 'columns' => [ + 'email' => 'E-mail', + 'subscribed' => 'Inscrito', + ] + ] +]; diff --git a/resources/lang/pt_BR/posts.php b/resources/lang/pt_BR/posts.php new file mode 100644 index 0000000..1e5b019 --- /dev/null +++ b/resources/lang/pt_BR/posts.php @@ -0,0 +1,85 @@ + 'Publicação', + 'plural_title' => 'Publicações', + 'forms' => [ + 'fields' => [ + 'category' => 'Categoria', + 'title' => 'Título', + 'slug' => 'Slug', + 'sub_title' => 'Subtítulo', + 'tags' => 'Tags', + 'body' => 'Conteúdo', + 'cover_photo' => 'Foto de Capa', + 'photo_alt_text' => 'Texto Alternativo da Foto', + 'status' => [ + 'label' => 'Status', + 'options' => [ + 'pending' => 'Pendente', + 'scheduled' => 'Agendado', + 'published' => 'Publicado', + ], + ], + 'published_at' => 'Publicado em', + 'scheduled_for' => 'Agendado para', + 'user' => 'Usuário', + 'keywords' => 'Palavras-chave', + 'description' => 'Descrição', + ], + 'sections' => [ + 'general' => 'Geral', + 'publish_information' => 'Informações de Publicação', + 'description' => 'Descrição', + 'header_title' => 'Detalhes da Postagem', + 'titles' => 'Títulos', + 'feature_image' => 'Imagem em Destaque', + 'status' => 'Status', + 'comment' => 'Comentário', + ], + 'tabs' => [ + 'edit_page' => [ + 'view_post' => 'Visualizar Publicação', + 'manage_seo_details' => 'Gerenciar Detalhes de SEO', + 'manage_comments' => 'Gerenciar Comentários', + 'edit_post' => 'Editar Publicação', + ], + 'list_page' => [ + 'all' => 'Todas', + 'published' => 'Publicadas', + 'scheduled' => 'Agendadas', + 'pending' => 'Pendentes', + ] + ], + 'widget' => [ + 'cards' => [ + 'published_post' => 'Publicação Publicada', + 'scheduled_post' => 'Publicação Agendada', + 'pending_post' => 'Publicação Pendente', + ] + ], + 'actions' => [ + 'preview' => 'Pré-Visualizar', + 'send_notification' => 'Enviar Notificação', + ] + ], + 'tables' => [ + 'columns' => [ + 'title' => 'Título', + 'status' => 'Status', + 'cover_photo' => 'Foto de Capa', + 'author' => 'Autor', + 'description' => 'Descrição', + 'keywords' => 'Palavras-chave', + 'commented_by' => 'Comentado Por', + 'comment' => 'Comentário', + 'approved_at' => [ + 'label' => 'Aprovado Em', + 'placeholder' => 'Não aprovado ainda', + ], + ], + 'filters' => [ + 'user' => 'Usuário', + ] + ] +]; \ No newline at end of file diff --git a/resources/lang/pt_BR/seo_details.php b/resources/lang/pt_BR/seo_details.php new file mode 100644 index 0000000..c5236f8 --- /dev/null +++ b/resources/lang/pt_BR/seo_details.php @@ -0,0 +1,21 @@ + 'Detalhe de SEO', + 'plural_title' => 'Detalhes de SEO', + 'forms' => [ + 'fields' => [ + 'post' => 'Publicação', + 'title' => 'Título', + 'keywords' => 'Palavras-chave', + 'description' => 'Descrição' + ] + ], + 'tables' => [ + 'columns' => [ + 'post' => 'Publicação', + 'title' => 'Título', + 'keywords' => 'Palavras-chave' + ] + ] +]; \ No newline at end of file diff --git a/resources/lang/pt_BR/settings.php b/resources/lang/pt_BR/settings.php index b588481..6474126 100644 --- a/resources/lang/pt_BR/settings.php +++ b/resources/lang/pt_BR/settings.php @@ -1,6 +1,8 @@ 'Configuração', + 'plural_title' => 'Configurações', 'table' => [ 'columns' => [ 'title' => 'Título', diff --git a/resources/lang/pt_BR/share_snippets.php b/resources/lang/pt_BR/share_snippets.php new file mode 100644 index 0000000..77883c4 --- /dev/null +++ b/resources/lang/pt_BR/share_snippets.php @@ -0,0 +1,21 @@ + 'Compartilhar Código', + 'plural_title' => 'Compartilhar Códigos', + 'subtitle' => 'Visite https://platform.sharethis.com para obter o código do script e o código HTML para compartilhar snippets', + 'forms' => [ + 'fields' => [ + 'js_script' => 'Script JS', + 'html_code' => 'Código HTML', + 'active' => 'Ativo', + ] + ], + 'tables' => [ + 'columns' => [ + 'script_code' => 'Código do Script', + 'html_code' => 'Código HTML', + 'active' => 'Ativo', + ] + ] +]; diff --git a/resources/lang/pt_BR/tags.php b/resources/lang/pt_BR/tags.php new file mode 100644 index 0000000..ee54fae --- /dev/null +++ b/resources/lang/pt_BR/tags.php @@ -0,0 +1,18 @@ + 'Tag', + 'plural_title' => 'Tags', + 'forms' => [ + 'fields' => [ + 'name' => 'Nome', + 'slug' => 'Slug', + ], + ], + 'tables' => [ + 'columns' => [ + 'name' => 'Nome', + 'slug' => 'Slug', + ], + ], +]; diff --git a/src/Enums/PostStatus.php b/src/Enums/PostStatus.php index 5fdeee5..a538d45 100644 --- a/src/Enums/PostStatus.php +++ b/src/Enums/PostStatus.php @@ -24,9 +24,9 @@ public function getColor(): string public function getLabel(): string { return match ($this) { - self::PENDING => 'Pending', - self::SCHEDULED => 'Scheduled', - self::PUBLISHED => 'Published' + self::PENDING => __('filament-blog::posts.forms.fields.status.options.pending'), + self::SCHEDULED => __('filament-blog::posts.forms.fields.status.options.scheduled'), + self::PUBLISHED => __('filament-blog::posts.forms.fields.status.options.published'), }; } diff --git a/src/Models/Category.php b/src/Models/Category.php index 600fe78..96b432c 100644 --- a/src/Models/Category.php +++ b/src/Models/Category.php @@ -33,6 +33,7 @@ public static function getForm() { return [ TextInput::make('name') + ->label(__('filament-blog::categories.forms.fields.name')) ->live(true) ->afterStateUpdated(function (Get $get, Set $set, ?string $operation, ?string $old, ?string $state) { @@ -43,6 +44,7 @@ public static function getForm() ->maxLength(155), TextInput::make('slug') + ->label(__('filament-blog::categories.forms.fields.slug')) ->unique(config('filamentblog.tables.prefix').'categories', 'slug', null, 'id') ->readOnly() ->maxLength(255), diff --git a/src/Models/Comment.php b/src/Models/Comment.php index 6083978..4c5ea1e 100644 --- a/src/Models/Comment.php +++ b/src/Models/Comment.php @@ -65,16 +65,20 @@ public static function getForm(): array { return [ Select::make('user_id') + ->label(__('filament-blog::comments.forms.fields.user')) ->relationship('user', config('filamentblog.user.columns.name')) ->required(), Select::make('post_id') + ->label(__('filament-blog::comments.forms.fields.post')) ->relationship('post', 'title') ->required(), Textarea::make('comment') + ->label(__('filament-blog::comments.forms.fields.comment')) ->required() ->maxLength(65535) ->columnSpanFull(), - Toggle::make('approved'), + Toggle::make('approved') + ->label(__('filament-blog::comments.forms.fields.approved')), ]; } diff --git a/src/Models/Post.php b/src/Models/Post.php index 7841067..dfefac3 100644 --- a/src/Models/Post.php +++ b/src/Models/Post.php @@ -138,11 +138,13 @@ protected function getFeaturePhotoAttribute() public static function getForm() { return [ - Section::make('Blog Details') + Section::make(__('filament-blog::posts.forms.sections.header_title')) ->schema([ Fieldset::make('Titles') + ->label(__('filament-blog::posts.forms.sections.titles')) ->schema([ Select::make('category_id') + ->label(__('filament-blog::posts.forms.fields.category')) ->multiple() ->preload() ->createOptionForm(Category::getForm()) @@ -151,6 +153,7 @@ public static function getForm() ->columnSpanFull(), TextInput::make('title') + ->label(__('filament-blog::posts.forms.fields.title')) ->live(true) ->afterStateUpdated(fn (Set $set, ?string $state) => $set( 'slug', @@ -161,13 +164,16 @@ public static function getForm() ->maxLength(255), TextInput::make('slug') + ->label(__('filament-blog::posts.forms.fields.slug')) ->maxLength(255), Textarea::make('sub_title') + ->label(__('filament-blog::posts.forms.fields.sub_title')) ->maxLength(255) ->columnSpanFull(), Select::make('tag_id') + ->label(__('filament-blog::posts.forms.fields.tags')) ->multiple() ->preload() ->createOptionForm(Tag::getForm()) @@ -176,15 +182,17 @@ public static function getForm() ->columnSpanFull(), ]), TiptapEditor::make('body') + ->label(__('filament-blog::posts.forms.fields.body')) ->profile('default') ->disableFloatingMenus() ->extraInputAttributes(['style' => 'max-height: 30rem; min-height: 24rem']) ->required() ->columnSpanFull(), Fieldset::make('Feature Image') + ->label(__('filament-blog::posts.forms.sections.feature_image')) ->schema([ FileUpload::make('cover_photo_path') - ->label('Cover Photo') + ->label(__('filament-blog::posts.forms.fields.cover_photo')) ->directory('/blog-feature-images') ->hint('This cover image is used in your blog post as a feature image. Recommended image size 1200 X 628') ->image() @@ -193,19 +201,24 @@ public static function getForm() ->maxSize(1024 * 5) ->rules('dimensions:max_width=1920,max_height=1004') ->required(), - TextInput::make('photo_alt_text')->required(), + TextInput::make('photo_alt_text') + ->label(__('filament-blog::posts.forms.fields.photo_alt_text')) + ->required(), ])->columns(1), Fieldset::make('Status') + ->label(__('filament-blog::posts.forms.sections.status')) ->schema([ ToggleButtons::make('status') + ->label(__('filament-blog::posts.forms.fields.status.label')) ->live() ->inline() ->options(PostStatus::class) ->required(), DateTimePicker::make('scheduled_for') + ->label(__('filament-blog::posts.forms.fields.scheduled_for')) ->visible(function ($get) { return $get('status') === PostStatus::SCHEDULED->value; }) @@ -216,6 +229,7 @@ public static function getForm() ->native(false), ]), Select::make(config('filamentblog.user.foreign_key')) + ->label(__('filament-blog::posts.forms.fields.user')) ->relationship('user', config('filamentblog.user.columns.name')) ->nullable(false) ->default(auth()->id()), diff --git a/src/Models/SeoDetail.php b/src/Models/SeoDetail.php index e00d2d7..35cf100 100644 --- a/src/Models/SeoDetail.php +++ b/src/Models/SeoDetail.php @@ -70,6 +70,7 @@ public static function getForm() { return [ Select::make('post_id') + ->label(__('filament-blog::seo_details.forms.fields.post')) ->createOptionForm(Post::getForm()) ->editOptionForm(Post::getForm()) ->relationship('post', 'title') @@ -80,12 +81,15 @@ public static function getForm() ->default(request('post_id') ?? '') ->columnSpanFull(), TextInput::make('title') + ->label(__('filament-blog::seo_details.forms.fields.title')) ->required() ->maxLength(255) ->columnSpanFull(), TagsInput::make('keywords') + ->label(__('filament-blog::seo_details.forms.fields.keywords')) ->columnSpanFull(), Textarea::make('description') + ->label(__('filament-blog::seo_details.forms.fields.description')) ->required() ->maxLength(65535) ->columnSpanFull(), diff --git a/src/Models/ShareSnippet.php b/src/Models/ShareSnippet.php index 548f849..3ee1570 100644 --- a/src/Models/ShareSnippet.php +++ b/src/Models/ShareSnippet.php @@ -37,11 +37,13 @@ public static function getForm(): array { return [ Textarea::make('script_code') - ->label('JS Script') + ->label(__('filament-blog::share_snippets.forms.fields.js_script')) ->required(), Textarea::make('html_code') + ->label(__('filament-blog::share_snippets.forms.fields.html_code')) ->required(), - Toggle::make('active'), + Toggle::make('active') + ->label(__('filament-blog::share_snippets.forms.fields.active')), ]; } diff --git a/src/Models/Tag.php b/src/Models/Tag.php index da91d8a..09781ea 100644 --- a/src/Models/Tag.php +++ b/src/Models/Tag.php @@ -33,6 +33,7 @@ public static function getForm(): array { return [ TextInput::make('name') + ->label(__('filament-blog::tags.forms.fields.name')) ->live(true)->afterStateUpdated(fn(Set $set, ?string $state) => $set( 'slug', Str::slug($state) @@ -42,6 +43,7 @@ public static function getForm(): array ->maxLength(50), TextInput::make('slug') + ->label(__('filament-blog::tags.forms.fields.slug')) ->unique(config('filamentblog.tables.prefix').'tags', 'slug', null, 'id') ->readOnly() ->maxLength(155), diff --git a/src/Resources/CategoryResource.php b/src/Resources/CategoryResource.php index abfb3ce..df452b6 100644 --- a/src/Resources/CategoryResource.php +++ b/src/Resources/CategoryResource.php @@ -33,17 +33,22 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('name') + ->label(__('filament-blog::categories.tables.columns.name')) ->searchable(), - Tables\Columns\TextColumn::make('slug'), + Tables\Columns\TextColumn::make('slug') + ->label(__('filament-blog::categories.tables.columns.slug')), Tables\Columns\TextColumn::make('posts_count') + ->label(__('filament-blog::categories.tables.columns.posts_count')) ->badge() ->counts('posts'), Tables\Columns\TextColumn::make('created_at') - ->dateTime() + ->label(__('filament-blog::general.created_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') - ->dateTime() + ->label(__('filament-blog::general.updated_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) @@ -65,10 +70,12 @@ public static function table(Table $table): Table public static function infolist(Infolist $infolist): Infolist { return $infolist->schema([ - Section::make('Category') + Section::make(__('filament-blog::categories.title')) ->schema([ - TextEntry::make('name'), - TextEntry::make('slug'), + TextEntry::make('name') + ->label(__('filament-blog::categories.forms.fields.name')), + TextEntry::make('slug') + ->label(__('filament-blog::categories.forms.fields.slug')), ])->columns(2) ->icon('heroicon-o-square-3-stack-3d'), ]); @@ -89,4 +96,14 @@ public static function getPages(): array 'view' => \Firefly\FilamentBlog\Resources\CategoryResource\Pages\ViewCategory::route('/{record}'), ]; } + + public static function getLabel() : ?string + { + return __('filament-blog::categories.title'); + } + + public static function getPluralLabel() : ?string + { + return __('filament-blog::categories.plural_title'); + } } diff --git a/src/Resources/CategoryResource/RelationManagers/PostsRelationManager.php b/src/Resources/CategoryResource/RelationManagers/PostsRelationManager.php index ad9f7cb..793e606 100644 --- a/src/Resources/CategoryResource/RelationManagers/PostsRelationManager.php +++ b/src/Resources/CategoryResource/RelationManagers/PostsRelationManager.php @@ -7,6 +7,7 @@ use Filament\Tables; use Filament\Tables\Table; use Firefly\FilamentBlog\Models\Post; +use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; class PostsRelationManager extends RelationManager @@ -30,11 +31,13 @@ public function table(Table $table): Table ->recordTitleAttribute('title') ->columns([ Tables\Columns\TextColumn::make('title') + ->label(__('filament-blog::posts.tables.columns.title')) ->limit(40) ->description(function (Post $record) { return Str::limit($record->sub_title); }), Tables\Columns\TextColumn::make('status') + ->label(__('filament-blog::posts.tables.columns.status')) ->badge() ->color(function ($state) { return $state->getColor(); @@ -44,16 +47,27 @@ public function table(Table $table): Table // ]) ->headerActions([ - Tables\Actions\CreateAction::make(), + Tables\Actions\CreateAction::make() + ->label(__('filament-actions::create.single.modal.heading', ['label' => __('filament-blog::posts.title')])), ]) ->actions([ - Tables\Actions\EditAction::make()->slideOver(), - Tables\Actions\DeleteAction::make(), + Tables\Actions\EditAction::make() + ->slideOver() + ->modalHeading(__('filament-actions::edit.single.modal.heading', ['label' => __('filament-blog::posts.title')])), + Tables\Actions\DeleteAction::make() + ->modalHeading(__('filament-actions::delete.single.modal.heading', ['label' => __('filament-blog::posts.title')])), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ - Tables\Actions\DeleteBulkAction::make(), + Tables\Actions\DeleteBulkAction::make() + ->modalHeading(__('filament-actions::delete.multiple.modal.heading', ['label' => __('filament-blog::posts.title')])), ]), ]); } + + public static function getTitle(Model $ownerRecord, string $pageClass): string + { + return __('filament-blog::posts.title'); + } + } diff --git a/src/Resources/CommentResource.php b/src/Resources/CommentResource.php index 2534edd..3e835ed 100644 --- a/src/Resources/CommentResource.php +++ b/src/Resources/CommentResource.php @@ -31,15 +31,18 @@ public static function table(Table $table): Table return $table ->columns([ UserPhotoName::make('user') - ->label('User'), + ->label(__('filament-blog::comments.tables.columns.user')), Tables\Columns\TextColumn::make('post.title') + ->label(__('filament-blog::comments.tables.columns.post')) ->numeric() ->limit(20) ->sortable(), Tables\Columns\TextColumn::make('comment') + ->label(__('filament-blog::comments.tables.columns.comment')) ->searchable() ->limit(20), Tables\Columns\ToggleColumn::make('approved') + ->label(__('filament-blog::comments.tables.columns.approved')) ->beforeStateUpdated(function ($record, $state) { if ($state) { $record->approved_at = now(); @@ -50,20 +53,23 @@ public static function table(Table $table): Table return $state; }), Tables\Columns\TextColumn::make('approved_at') + ->label(__('filament-blog::comments.tables.columns.approved_at.label')) ->sortable() - ->placeholder('Not approved yet'), + ->placeholder(__('filament-blog::comments.tables.columns.approved_at.placeholder')), Tables\Columns\TextColumn::make('created_at') - ->dateTime() + ->label(__('filament-blog::general.created_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') - ->dateTime() + ->label(__('filament-blog::general.updated_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) ->filters([ - Tables\Filters\SelectFilter::make('user') + Tables\Filters\SelectFilter::make(__('filament-blog::comments.tables.filters.user')) ->relationship('user', config('filamentblog.user.columns.name')) ->searchable() ->preload() @@ -98,4 +104,14 @@ public static function getPages(): array 'edit' => \Firefly\FilamentBlog\Resources\CommentResource\Pages\EditComment::route('/{record}/edit'), ]; } + + public static function getLabel(): string + { + return __('filament-blog::comments.title'); + } + + public static function getPluralLabel(): string + { + return __('filament-blog::comments.plural_title'); + } } diff --git a/src/Resources/NewsletterResource.php b/src/Resources/NewsletterResource.php index 1e6b5c6..49a53c3 100644 --- a/src/Resources/NewsletterResource.php +++ b/src/Resources/NewsletterResource.php @@ -24,11 +24,13 @@ public static function form(Form $form): Form return $form ->schema([ Forms\Components\TextInput::make('email') + ->label(__('filament-blog::news_letters.forms.fields.email')) ->email() ->required() ->unique(ignoreRecord: true) ->maxLength(100), Forms\Components\Toggle::make('subscribed') + ->label(__('filament-blog::news_letters.forms.fields.subscribed')) ->default(true) ->required()->columnSpanFull(), ])->columns(2); @@ -39,15 +41,18 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('email') + ->label(__('filament-blog::news_letters.tables.columns.email')) ->searchable(), Tables\Columns\ToggleColumn::make('subscribed') - ->label('Subscribed'), + ->label(__('filament-blog::news_letters.tables.columns.subscribed')), Tables\Columns\TextColumn::make('created_at') - ->dateTime() + ->label(__('filament-blog::general.created_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') - ->dateTime() + ->label(__('filament-blog::general.updated_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) @@ -79,4 +84,12 @@ public static function getPages(): array 'edit' => \Firefly\FilamentBlog\Resources\NewsletterResource\Pages\EditNewsletter::route('/{record}/edit'), ]; } + + public static function getLabel(): string { + return __('filament-blog::news_letters.title'); + } + + public static function getPluralLabel(): string { + return __('filament-blog::news_letters.plural_title'); + } } diff --git a/src/Resources/NewsletterResource/Pages/ListNewsletters.php b/src/Resources/NewsletterResource/Pages/ListNewsletters.php index c332748..336edca 100644 --- a/src/Resources/NewsletterResource/Pages/ListNewsletters.php +++ b/src/Resources/NewsletterResource/Pages/ListNewsletters.php @@ -10,7 +10,7 @@ class ListNewsletters extends ListRecords { protected static string $resource = NewsletterResource::class; - protected static ?string $title = 'Newsletters Subscriber'; + protected static ?string $title = ''; protected function getHeaderActions(): array { @@ -18,4 +18,8 @@ protected function getHeaderActions(): array Actions\CreateAction::make(), ]; } + + public function getTitle(): string { + return __('filament-blog::news_letters.list_title'); + } } diff --git a/src/Resources/PostResource.php b/src/Resources/PostResource.php index f93ca8b..3645532 100644 --- a/src/Resources/PostResource.php +++ b/src/Resources/PostResource.php @@ -53,31 +53,36 @@ public static function table(Table $table): Table ->deferLoading() ->columns([ Tables\Columns\TextColumn::make('title') + ->label(__('filament-blog::posts.tables.columns.title')) ->description(function (Post $record) { return Str::limit($record->sub_title, 40); }) ->searchable()->limit(20), Tables\Columns\TextColumn::make('status') + ->label(__('filament-blog::posts.tables.columns.status')) ->badge() ->color(function ($state) { return $state->getColor(); }), - Tables\Columns\ImageColumn::make('cover_photo_path')->label('Cover Photo'), + Tables\Columns\ImageColumn::make('cover_photo_path') + ->label(__('filament-blog::posts.tables.columns.cover_photo')), UserPhotoName::make('user') - ->label('Author'), + ->label(__('filament-blog::posts.tables.columns.author')), Tables\Columns\TextColumn::make('created_at') - ->dateTime() + ->label(__('filament-blog::general.created_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') - ->dateTime() + ->label(__('filament-blog::general.updated_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), ])->defaultSort('id', 'desc') ->filters([ - Tables\Filters\SelectFilter::make('user') + Tables\Filters\SelectFilter::make(__('filament-blog::posts.tables.filters.user')) ->relationship('user', config('filamentblog.user.columns.name')) ->searchable() ->preload() @@ -99,31 +104,44 @@ public static function table(Table $table): Table public static function infolist(Infolist $infolist): Infolist { return $infolist->schema([ - Section::make('Post') + Section::make(__('filament-blog::posts.forms.sections.header_title')) ->schema([ - Fieldset::make('General') + Fieldset::make(__('filament-blog::posts.forms.sections.general')) ->schema([ - TextEntry::make('title'), - TextEntry::make('slug'), - TextEntry::make('sub_title'), + TextEntry::make('title') + ->label(__('filament-blog::posts.forms.fields.title')), + TextEntry::make('slug') + ->label(__('filament-blog::posts.forms.fields.slug')), + TextEntry::make('sub_title') + ->label(__('filament-blog::posts.forms.fields.sub_title')), ]), - Fieldset::make('Publish Information') + Fieldset::make(__('filament-blog::posts.forms.sections.publish_information')) ->schema([ TextEntry::make('status') - ->badge()->color(function ($state) { + ->label(__('filament-blog::posts.forms.fields.status.label')) + ->badge() + ->color(function ($state) { return $state->getColor(); }), - TextEntry::make('published_at')->visible(function (Post $record) { - return $record->status === PostStatus::PUBLISHED; - }), + TextEntry::make('published_at') + ->label(__('filament-blog::posts.forms.fields.published_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) + ->visible(function (Post $record) { + return $record->status === PostStatus::PUBLISHED; + }), - TextEntry::make('scheduled_for')->visible(function (Post $record) { - return $record->status === PostStatus::SCHEDULED; - }), + TextEntry::make('scheduled_for') + ->label(__('filament-blog::posts.forms.fields.scheduled_for')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) + ->visible(function (Post $record) { + return $record->status === PostStatus::SCHEDULED; + }), ]), Fieldset::make('Description') + ->label(__('filament-blog::posts.forms.sections.description')) ->schema([ TextEntry::make('body') + ->label(__('filament-blog::posts.forms.fields.body')) ->html() ->columnSpanFull(), ]), @@ -167,4 +185,14 @@ public static function getPages(): array 'seoDetail' => \Firefly\FilamentBlog\Resources\PostResource\Pages\ManaePostSeoDetail::route('/{record}/seo-details'), ]; } + + public static function getLabel() : ?string + { + return __('filament-blog::posts.title'); + } + + public static function getPluralLabel() : ?string + { + return __('filament-blog::posts.plural_title'); + } } diff --git a/src/Resources/PostResource/Pages/ListPosts.php b/src/Resources/PostResource/Pages/ListPosts.php index 4d5c8cf..c69520a 100644 --- a/src/Resources/PostResource/Pages/ListPosts.php +++ b/src/Resources/PostResource/Pages/ListPosts.php @@ -29,17 +29,17 @@ protected function getHeaderWidgets(): array public function getTabs(): array { return [ - 'all' => Tab::make('All'), - 'published' => Tab::make('Published') + 'all' => Tab::make(__('filament-blog::posts.forms.tabs.list_page.all')), + 'published' => Tab::make(__('filament-blog::posts.forms.tabs.list_page.published')) ->modifyQueryUsing(function ($query) { $query->published(); })->icon('heroicon-o-check-badge'), - 'pending' => Tab::make('Pending') + 'pending' => Tab::make(__('filament-blog::posts.forms.tabs.list_page.pending')) ->modifyQueryUsing(function ($query) { $query->pending(); }) ->icon('heroicon-o-clock'), - 'scheduled' => Tab::make('Scheduled') + 'scheduled' => Tab::make(__('filament-blog::posts.forms.tabs.list_page.scheduled')) ->modifyQueryUsing(function ($query) { $query->scheduled(); }) diff --git a/src/Resources/PostResource/Pages/ManaePostSeoDetail.php b/src/Resources/PostResource/Pages/ManaePostSeoDetail.php index 92dd410..66552a1 100644 --- a/src/Resources/PostResource/Pages/ManaePostSeoDetail.php +++ b/src/Resources/PostResource/Pages/ManaePostSeoDetail.php @@ -27,12 +27,12 @@ public function getTitle(): string|Htmlable $recordTitle = $recordTitle instanceof Htmlable ? $recordTitle->toHtml() : $recordTitle; - return 'Manage Seo Detail'; + return __('filament-blog::posts.forms.tabs.edit_page.manage_seo_details'); } public static function getNavigationLabel(): string { - return 'Manage Seo Detail'; + return __('filament-blog::posts.forms.tabs.edit_page.manage_seo_details'); } protected function canCreate(): bool @@ -45,12 +45,15 @@ public function form(Form $form): Form return $form ->schema([ TextInput::make('title') + ->label(__('filament-blog::posts.forms.fields.title')) ->required() ->maxLength(255) ->columnSpanFull(), TagsInput::make('keywords') + ->label(__('filament-blog::posts.forms.fields.keywords')) ->columnSpanFull(), Textarea::make('description') + ->label(__('filament-blog::posts.forms.fields.description')) ->required() ->maxLength(65535) ->columnSpanFull(), @@ -63,22 +66,29 @@ public function table(Table $table): Table ->recordTitleAttribute('title') ->columns([ Tables\Columns\TextColumn::make('title') + ->label(__('filament-blog::posts.tables.columns.title')) ->limit(20), Tables\Columns\TextColumn::make('description') + ->label(__('filament-blog::posts.tables.columns.description')) ->limit(40), - Tables\Columns\TextColumn::make('keywords')->badge(), + Tables\Columns\TextColumn::make('keywords') + ->label(__('filament-blog::posts.tables.columns.keywords')) + ->badge(), Tables\Columns\TextColumn::make('created_at') - ->dateTime() + ->label(__('filament-blog::general.created_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') - ->dateTime() + ->label(__('filament-blog::general.updated_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->toggleable(isToggledHiddenByDefault: true), ]) ->filters([ // ]) ->headerActions([ - Tables\Actions\CreateAction::make(), + Tables\Actions\CreateAction::make() + ->label(__('filament-blog::posts.forms.tabs.edit_page.add_seo_detail')), ]) ->actions([ Tables\Actions\EditAction::make(), diff --git a/src/Resources/PostResource/Pages/ManagePostComments.php b/src/Resources/PostResource/Pages/ManagePostComments.php index 37cf05d..a308830 100644 --- a/src/Resources/PostResource/Pages/ManagePostComments.php +++ b/src/Resources/PostResource/Pages/ManagePostComments.php @@ -30,17 +30,17 @@ public function getTitle(): string|Htmlable $recordTitle = $recordTitle instanceof Htmlable ? $recordTitle->toHtml() : $recordTitle; - return 'Manage Comments'; + return __('filament-blog::posts.forms.tabs.edit_page.manage_comments'); } public function getBreadcrumb(): string { - return 'Comments'; + return __('filament-blog::posts.forms.tabs.edit_page.manage_comments'); } public static function getNavigationLabel(): string { - return 'Manage Comments'; + return __('filament-blog::posts.forms.tabs.edit_page.manage_comments'); } public function form(Form $form): Form @@ -48,13 +48,16 @@ public function form(Form $form): Form return $form ->schema([ Select::make('user_id') + ->label(__('filament-blog::comments.forms.fields.user')) ->relationship('user', config('filamentblog.user.columns.name')) ->required(), Textarea::make('comment') + ->label(__('filament-blog::comments.forms.fields.comment')) ->required() ->maxLength(65535) ->columnSpanFull(), - Toggle::make('approved'), + Toggle::make('approved') + ->label(__('filament-blog::comments.forms.fields.approved')), ]) ->columns(1); } @@ -64,9 +67,10 @@ public function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('comment') + ->label(__('filament-blog::posts.tables.columns.comment')) ->searchable(), UserPhotoName::make('user') - ->label('Commented By'), + ->label(__('filament-blog::posts.tables.columns.commented_by')), Tables\Columns\ToggleColumn::make('approved') ->beforeStateUpdated(function ($record, $state) { if ($state) { @@ -78,38 +82,47 @@ public function table(Table $table): Table return $state; }), Tables\Columns\TextColumn::make('approved_at') - ->placeholder('Not approved') + ->label(__('filament-blog::posts.tables.columns.approved_at.label')) + ->placeholder(__('filament-blog::posts.tables.columns.approved_at.placeholder')) ->sortable(), Tables\Columns\TextColumn::make('created_at') - ->dateTime() + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) + ->label(__('filament-blog::general.created_at')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') - ->dateTime() + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) + ->label(__('filament-blog::general.updated_at')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) ->filters([ Tables\Filters\SelectFilter::make('user') + ->label(__('filament-blog::posts.tables.filters.user')) ->relationship('user', config('filamentblog.user.columns.name')) ->searchable() ->preload() ->multiple(), ]) ->headerActions([ - Tables\Actions\CreateAction::make(), + Tables\Actions\CreateAction::make() + ->label(__('filament-actions::create.single.label', ['label' => __('filament-blog::comments.title')])) ]) ->actions([ Tables\Actions\ActionGroup::make([ - Tables\Actions\EditAction::make(), - Tables\Actions\ViewAction::make(), - Tables\Actions\DeleteAction::make(), + Tables\Actions\EditAction::make() + ->modalHeading(__('filament-actions::edit.single.modal.heading', ['label' => __('filament-blog::comments.title')])), + Tables\Actions\ViewAction::make() + ->modalHeading(__('filament-actions::view.single.modal.heading', ['label' => __('filament-blog::comments.title')])), + Tables\Actions\DeleteAction::make() + ->modalHeading(__('filament-actions::delete.single.modal.heading', ['label' => __('filament-blog::comments.title')])), ]), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ - Tables\Actions\DeleteBulkAction::make(), + Tables\Actions\DeleteBulkAction::make() + ->modalHeading(__('filament-actions::delete.multiple.modal.heading', ['label' => __('filament-blog::comments.title')])), ]), ]); } @@ -117,13 +130,17 @@ public function table(Table $table): Table public function infolist(Infolist $infolist): Infolist { return $infolist->schema([ - Section::make('Comment') + Section::make(__('filament-blog::posts.forms.sections.comment')) ->schema([ TextEntry::make('user.name') - ->label('Commented by'), - TextEntry::make('comment'), - TextEntry::make('created_at'), - TextEntry::make('approved_at')->label('Approved At')->placeholder('Not Approved'), + ->label(__('filament-blog::posts.tables.columns.commented_by')), + TextEntry::make('comment') + ->label(__('filament-blog::posts.tables.columns.comment')), + TextEntry::make('created_at') + ->label(__('filament-blog::general.created_at')), + TextEntry::make('approved_at') + ->label(__('filament-blog::posts.tables.columns.approved_at.label')) + ->placeholder(__('filament-blog::posts.tables.columns.approved_at.placeholder')), ]) ->icon('heroicon-o-chat-bubble-left-ellipsis'), diff --git a/src/Resources/PostResource/Pages/ViewPost.php b/src/Resources/PostResource/Pages/ViewPost.php index 6dcd496..4ab9f95 100644 --- a/src/Resources/PostResource/Pages/ViewPost.php +++ b/src/Resources/PostResource/Pages/ViewPost.php @@ -24,7 +24,7 @@ protected function getHeaderActions(): array { return [ Action::make('sendNotification') - ->label('Send Notification') + ->label(__('filament-blog::posts.forms.actions.send_notification')) ->requiresConfirmation() ->icon('heroicon-o-bell')->action(function (Post $record) { event(new BlogPublished($record)); @@ -33,7 +33,7 @@ protected function getHeaderActions(): array return $record->isNotPublished(); }), Action::make('preview') - ->label('Preview') + ->label(__('filament-blog::posts.forms.actions.preview')) ->requiresConfirmation() ->icon('heroicon-o-eye')->url(function (Post $record) { return route('filamentblog.post.show', $record->slug); @@ -43,4 +43,10 @@ protected function getHeaderActions(): array }), ]; } + + public static function getNavigationLabel(): string + { + return __('filament-blog::posts.forms.tabs.edit_page.view_post'); + } + } diff --git a/src/Resources/PostResource/RelationManagers/CommentsRelationManager.php b/src/Resources/PostResource/RelationManagers/CommentsRelationManager.php index e2ee387..268cf52 100644 --- a/src/Resources/PostResource/RelationManagers/CommentsRelationManager.php +++ b/src/Resources/PostResource/RelationManagers/CommentsRelationManager.php @@ -17,6 +17,7 @@ public function form(Form $form): Form return $form ->schema([ Forms\Components\TextInput::make('comment') + ->label(__('filament-blog::comments.forms.fields.comment')) ->required() ->maxLength(255), ]); @@ -34,11 +35,14 @@ public function table(Table $table): Table // ]) ->headerActions([ - Tables\Actions\CreateAction::make(), + Tables\Actions\CreateAction::make() + ->modalHeading(__('filament-actions::delete.single.modal.heading', ['label' => __('filament-blog::comments.title')])), ]) ->actions([ - Tables\Actions\EditAction::make(), - Tables\Actions\DeleteAction::make(), + Tables\Actions\EditAction::make() + ->modalHeading(__('filament-actions::edit.single.modal.heading', ['label' => __('filament-blog::comments.title')])), + Tables\Actions\DeleteAction::make() + ->modalHeading(__('filament-actions::delete.single.modal.heading', ['label' => __('filament-blog::comments.title')])), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ diff --git a/src/Resources/PostResource/Widgets/BlogPostPublishedChart.php b/src/Resources/PostResource/Widgets/BlogPostPublishedChart.php index ab9674b..676fce4 100644 --- a/src/Resources/PostResource/Widgets/BlogPostPublishedChart.php +++ b/src/Resources/PostResource/Widgets/BlogPostPublishedChart.php @@ -10,9 +10,9 @@ class BlogPostPublishedChart extends BaseWidget protected function getStats(): array { return [ - BaseWidget\Stat::make('Published Post', Post::published()->count()), - BaseWidget\Stat::make('Scheduled Post', Post::scheduled()->count()), - BaseWidget\Stat::make('Pending Post', Post::pending()->count()), + BaseWidget\Stat::make(__('filament-blog::posts.forms.widget.cards.published_post'), Post::published()->count()), + BaseWidget\Stat::make(__('filament-blog::posts.forms.widget.cards.scheduled_post'), Post::scheduled()->count()), + BaseWidget\Stat::make(__('filament-blog::posts.forms.widget.cards.pending_post'), Post::pending()->count()), ]; } } diff --git a/src/Resources/SeoDetailResource.php b/src/Resources/SeoDetailResource.php index 2e523be..c49d2ab 100644 --- a/src/Resources/SeoDetailResource.php +++ b/src/Resources/SeoDetailResource.php @@ -30,18 +30,24 @@ public static function table(Table $table): Table ->striped() ->columns([ Tables\Columns\TextColumn::make('post.title') + ->label(__('filament-blog::seo_details.tables.columns.post')) ->limit(20), Tables\Columns\TextColumn::make('title') + ->label(__('filament-blog::seo_details.tables.columns.title')) ->limit(20) ->searchable(), - Tables\Columns\TextColumn::make('keywords')->badge() + Tables\Columns\TextColumn::make('keywords') + ->badge() + ->label(__('filament-blog::seo_details.tables.columns.keywords')) ->searchable(), Tables\Columns\TextColumn::make('created_at') - ->dateTime() + ->label(__('filament-blog::general.created_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') - ->dateTime() + ->label(__('filament-blog::general.updated_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) @@ -74,4 +80,14 @@ public static function getPages(): array 'edit' => \Firefly\FilamentBlog\Resources\SeoDetailResource\Pages\EditSeoDetail::route('/{record}/edit'), ]; } + + public static function getLabel(): string + { + return __('filament-blog::seo_details.title'); + } + + public static function getPluralLabel(): string + { + return __('filament-blog::seo_details.plural_title'); + } } diff --git a/src/Resources/SettingResource.php b/src/Resources/SettingResource.php index 7bca96f..f034c9a 100644 --- a/src/Resources/SettingResource.php +++ b/src/Resources/SettingResource.php @@ -18,6 +18,16 @@ class SettingResource extends Resource protected static ?int $navigationSort = 8; + public static function getLabel(): string + { + return __('filament-blog::settings.title'); + } + + public static function getPluralLabel(): string + { + return __('filament-blog::settings.plural_title'); + } + public static function form(Form $form): Form { return $form @@ -50,12 +60,13 @@ public static function table(Table $table): Table Tables\Columns\TextColumn::make('created_at') ->label(__('filament-blog::general.created_at')) - ->dateTime() + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), + Tables\Columns\TextColumn::make('updated_at') ->label(__('filament-blog::general.updated_at')) - ->dateTime() + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) diff --git a/src/Resources/ShareSnippetResource.php b/src/Resources/ShareSnippetResource.php index 143e44a..a138ab7 100644 --- a/src/Resources/ShareSnippetResource.php +++ b/src/Resources/ShareSnippetResource.php @@ -19,6 +19,16 @@ class ShareSnippetResource extends Resource protected static ?int $navigationSort = 7; + public static function getLabel(): string + { + return __('filament-blog::share_snippets.title'); + } + + public static function getPluralLabel(): string + { + return __('filament-blog::share_snippets.plural_title'); + } + public static function canCreate(): bool { return ! (self::$model::all()->count() > 0); @@ -41,12 +51,15 @@ public static function table(Table $table): Table return $table ->columns([ TextColumn::make('script_code') + ->label(__('filament-blog::share_snippets.tables.columns.script_code')) ->limit(50) ->searchable(), TextColumn::make('html_code') + ->label(__('filament-blog::share_snippets.tables.columns.html_code')) ->limit(50) ->searchable(), - Tables\Columns\ToggleColumn::make('active'), + Tables\Columns\ToggleColumn::make('active') + ->label(__('filament-blog::share_snippets.tables.columns.active')), ]) ->filters([ // diff --git a/src/Resources/ShareSnippetResource/Pages/ListShareSnippets.php b/src/Resources/ShareSnippetResource/Pages/ListShareSnippets.php index 2f44f66..0613a29 100644 --- a/src/Resources/ShareSnippetResource/Pages/ListShareSnippets.php +++ b/src/Resources/ShareSnippetResource/Pages/ListShareSnippets.php @@ -11,7 +11,7 @@ class ListShareSnippets extends ListRecords { protected static string $resource = ShareSnippetResource::class; - protected ?string $subheading = 'Please visit https://platform.sharethis.com to get the script code and html code for sharing snippets'; + protected ?string $subheading = ''; protected function getHeaderActions(): array { @@ -24,4 +24,12 @@ protected function getTableDescription(): string|Htmlable|null { return 'Share Snippets'; } + + /** + * @return string|null + */ + public function getSubheading(): ?string + { + return __('filament-blog::share_snippets.subtitle'); + } } diff --git a/src/Resources/TagResource.php b/src/Resources/TagResource.php index f34905a..28a5b7f 100644 --- a/src/Resources/TagResource.php +++ b/src/Resources/TagResource.php @@ -29,16 +29,20 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('name') + ->label(__('filament-blog::tags.tables.columns.name')) ->searchable(), - Tables\Columns\TextColumn::make('slug'), + Tables\Columns\TextColumn::make('slug') + ->label(__('filament-blog::tags.tables.columns.slug')), Tables\Columns\TextColumn::make('created_at') - ->dateTime() + ->label(__('filament-blog::general.created_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') - ->dateTime() + ->label(__('filament-blog::general.updated_at')) + ->dateTime(config('filamentblog.date_format') . ' ' . config('filamentblog.time_format')) ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) @@ -71,4 +75,14 @@ public static function getPages(): array 'edit' => \Firefly\FilamentBlog\Resources\TagResource\Pages\EditTag::route('/{record}/edit'), ]; } + + public static function getLabel() : ?string + { + return __('filament-blog::tags.title'); + } + + public static function getPluralLabel() : ?string + { + return __('filament-blog::tags.plural_title'); + } } From af26ec26afd5bc74a66700a8f51df400cff13f4d Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Thu, 23 Jan 2025 14:41:06 -0300 Subject: [PATCH 3/6] :globe_with_meridians: Added settings for changing the navigation group label --- src/Resources/CategoryResource.php | 7 +++++-- src/Resources/CommentResource.php | 7 +++++-- src/Resources/NewsletterResource.php | 7 +++++-- src/Resources/PostResource.php | 7 +++++-- src/Resources/SeoDetailResource.php | 7 +++++-- src/Resources/SettingResource.php | 7 +++++-- src/Resources/ShareSnippetResource.php | 7 +++++-- src/Resources/TagResource.php | 7 +++++-- 8 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/Resources/CategoryResource.php b/src/Resources/CategoryResource.php index df452b6..25f274c 100644 --- a/src/Resources/CategoryResource.php +++ b/src/Resources/CategoryResource.php @@ -18,8 +18,6 @@ class CategoryResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-squares-plus'; - protected static ?string $navigationGroup = 'Blog'; - protected static ?int $navigationSort = 1; public static function form(Form $form): Form @@ -106,4 +104,9 @@ public static function getPluralLabel() : ?string { return __('filament-blog::categories.plural_title'); } + + public static function getNavigationGroup(): ?string + { + return config('filamentblog.group_navigation_title'); + } } diff --git a/src/Resources/CommentResource.php b/src/Resources/CommentResource.php index 3e835ed..ddd1b0d 100644 --- a/src/Resources/CommentResource.php +++ b/src/Resources/CommentResource.php @@ -16,8 +16,6 @@ class CommentResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-chat-bubble-left-right'; - protected static ?string $navigationGroup = 'Blog'; - protected static ?int $navigationSort = 5; public static function form(Form $form): Form @@ -114,4 +112,9 @@ public static function getPluralLabel(): string { return __('filament-blog::comments.plural_title'); } + + public static function getNavigationGroup(): ?string + { + return config('filamentblog.group_navigation_title'); + } } diff --git a/src/Resources/NewsletterResource.php b/src/Resources/NewsletterResource.php index 49a53c3..f6137e1 100644 --- a/src/Resources/NewsletterResource.php +++ b/src/Resources/NewsletterResource.php @@ -15,8 +15,6 @@ class NewsletterResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-newspaper'; - protected static ?string $navigationGroup = 'Blog'; - protected static ?int $navigationSort = 6; public static function form(Form $form): Form @@ -92,4 +90,9 @@ public static function getLabel(): string { public static function getPluralLabel(): string { return __('filament-blog::news_letters.plural_title'); } + + public static function getNavigationGroup(): ?string + { + return config('filamentblog.group_navigation_title'); + } } diff --git a/src/Resources/PostResource.php b/src/Resources/PostResource.php index 3645532..f8b524a 100644 --- a/src/Resources/PostResource.php +++ b/src/Resources/PostResource.php @@ -28,8 +28,6 @@ class PostResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-document-minus'; - protected static ?string $navigationGroup = 'Blog'; - protected static ?string $recordTitleAttribute = 'title'; protected static ?int $navigationSort = 3; @@ -195,4 +193,9 @@ public static function getPluralLabel() : ?string { return __('filament-blog::posts.plural_title'); } + + public static function getNavigationGroup(): ?string + { + return config('filamentblog.group_navigation_title'); + } } diff --git a/src/Resources/SeoDetailResource.php b/src/Resources/SeoDetailResource.php index c49d2ab..6146a6d 100644 --- a/src/Resources/SeoDetailResource.php +++ b/src/Resources/SeoDetailResource.php @@ -14,8 +14,6 @@ class SeoDetailResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-document-magnifying-glass'; - protected static ?string $navigationGroup = 'Blog'; - protected static ?int $navigationSort = 4; public static function form(Form $form): Form @@ -90,4 +88,9 @@ public static function getPluralLabel(): string { return __('filament-blog::seo_details.plural_title'); } + + public static function getNavigationGroup(): ?string + { + return config('filamentblog.group_navigation_title'); + } } diff --git a/src/Resources/SettingResource.php b/src/Resources/SettingResource.php index f034c9a..7c152be 100644 --- a/src/Resources/SettingResource.php +++ b/src/Resources/SettingResource.php @@ -14,8 +14,6 @@ class SettingResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-cog-6-tooth'; - protected static ?string $navigationGroup = 'Blog'; - protected static ?int $navigationSort = 8; public static function getLabel(): string @@ -99,4 +97,9 @@ public static function getPages(): array 'edit' => \Firefly\FilamentBlog\Resources\SettingResource\Pages\EditSetting::route('/{record}/edit'), ]; } + + public static function getNavigationGroup(): ?string + { + return config('filamentblog.group_navigation_title'); + } } diff --git a/src/Resources/ShareSnippetResource.php b/src/Resources/ShareSnippetResource.php index a138ab7..f01d2d5 100644 --- a/src/Resources/ShareSnippetResource.php +++ b/src/Resources/ShareSnippetResource.php @@ -15,8 +15,6 @@ class ShareSnippetResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-share'; - protected static ?string $navigationGroup = 'Blog'; - protected static ?int $navigationSort = 7; public static function getLabel(): string @@ -88,4 +86,9 @@ public static function getPages(): array 'edit' => \Firefly\FilamentBlog\Resources\ShareSnippetResource\Pages\EditShareSnippet::route('/{record}/edit'), ]; } + + public static function getNavigationGroup(): ?string + { + return config('filamentblog.group_navigation_title'); + } } diff --git a/src/Resources/TagResource.php b/src/Resources/TagResource.php index 28a5b7f..e611856 100644 --- a/src/Resources/TagResource.php +++ b/src/Resources/TagResource.php @@ -14,8 +14,6 @@ class TagResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-tag'; - protected static ?string $navigationGroup = 'Blog'; - protected static ?int $navigationSort = 2; public static function form(Form $form): Form @@ -85,4 +83,9 @@ public static function getPluralLabel() : ?string { return __('filament-blog::tags.plural_title'); } + + public static function getNavigationGroup(): ?string + { + return config('filamentblog.group_navigation_title'); + } } From 38cb24e13e7367a93bf82a910bdce52403dce988 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Fri, 24 Jan 2025 02:39:55 -0300 Subject: [PATCH 4/6] :globe_with_meridians: Added settings for changing the formatted published date and applied translations for blade views --- config/filamentblog.php | 2 + resources/lang/en/components/comment.php | 7 +++ resources/lang/en/components/header.php | 5 ++ resources/lang/en/layouts.php | 12 +++++ resources/lang/en/mails/blog-published.php | 7 +++ resources/lang/en/pages/all-post.php | 6 +++ resources/lang/en/pages/category-post.php | 5 ++ resources/lang/en/pages/index.php | 5 ++ resources/lang/en/pages/search.php | 5 ++ resources/lang/en/pages/show.php | 8 ++++ resources/lang/en/pages/tag-post.php | 5 ++ .../lang/en/{ => resources}/categories.php | 0 .../lang/en/{ => resources}/comments.php | 0 resources/lang/en/{ => resources}/general.php | 0 .../lang/en/{ => resources}/news_letters.php | 0 resources/lang/en/{ => resources}/posts.php | 0 .../lang/en/{ => resources}/seo_details.php | 0 .../lang/en/{ => resources}/settings.php | 0 .../en/{ => resources}/share_snippets.php | 0 resources/lang/en/{ => resources}/tags.php | 0 resources/lang/pt_BR/components/comment.php | 7 +++ resources/lang/pt_BR/components/header.php | 5 ++ resources/lang/pt_BR/layouts.php | 12 +++++ resources/lang/pt_BR/mails/blog-published.php | 7 +++ resources/lang/pt_BR/pages/all-post.php | 6 +++ resources/lang/pt_BR/pages/category-post.php | 5 ++ resources/lang/pt_BR/pages/index.php | 5 ++ resources/lang/pt_BR/pages/search.php | 5 ++ resources/lang/pt_BR/pages/show.php | 8 ++++ resources/lang/pt_BR/pages/tag-post.php | 5 ++ .../lang/pt_BR/{ => resources}/categories.php | 0 .../lang/pt_BR/{ => resources}/comments.php | 0 .../lang/pt_BR/{ => resources}/general.php | 0 .../pt_BR/{ => resources}/news_letters.php | 0 .../lang/pt_BR/{ => resources}/posts.php | 0 .../pt_BR/{ => resources}/seo_details.php | 0 .../lang/pt_BR/{ => resources}/settings.php | 0 .../pt_BR/{ => resources}/share_snippets.php | 0 resources/lang/pt_BR/{ => resources}/tags.php | 0 resources/views/blogs/all-post.blade.php | 4 +- resources/views/blogs/category-post.blade.php | 4 +- resources/views/blogs/index.blade.php | 4 +- resources/views/blogs/search.blade.php | 6 ++- resources/views/blogs/show.blade.php | 14 +++--- resources/views/blogs/tag-post.blade.php | 4 +- resources/views/components/comment.blade.php | 10 ++-- resources/views/components/header.blade.php | 6 +-- resources/views/layouts/app.blade.php | 18 +++---- .../views/mails/blog-published.blade.php | 8 ++-- src/Enums/PostStatus.php | 6 +-- src/Models/Category.php | 4 +- src/Models/Comment.php | 8 ++-- src/Models/Post.php | 32 ++++++------- src/Models/SeoDetail.php | 8 ++-- src/Models/Setting.php | 36 +++++++------- src/Models/ShareSnippet.php | 6 +-- src/Models/Tag.php | 4 +- src/Resources/CategoryResource.php | 20 ++++---- .../RelationManagers/PostsRelationManager.php | 14 +++--- src/Resources/CommentResource.php | 22 ++++----- src/Resources/NewsletterResource.php | 16 +++---- .../Pages/ListNewsletters.php | 2 +- src/Resources/PostResource.php | 40 ++++++++-------- .../PostResource/Pages/ListPosts.php | 8 ++-- .../PostResource/Pages/ManaePostSeoDetail.php | 22 ++++----- .../PostResource/Pages/ManagePostComments.php | 48 +++++++++---------- src/Resources/PostResource/Pages/ViewPost.php | 6 +-- .../CommentsRelationManager.php | 8 ++-- .../Widgets/BlogPostPublishedChart.php | 6 +-- src/Resources/SeoDetailResource.php | 14 +++--- src/Resources/SettingResource.php | 16 +++---- src/Resources/ShareSnippetResource.php | 10 ++-- .../Pages/ListShareSnippets.php | 2 +- src/Resources/TagResource.php | 12 ++--- 74 files changed, 357 insertions(+), 223 deletions(-) create mode 100644 resources/lang/en/components/comment.php create mode 100644 resources/lang/en/components/header.php create mode 100644 resources/lang/en/layouts.php create mode 100644 resources/lang/en/mails/blog-published.php create mode 100644 resources/lang/en/pages/all-post.php create mode 100644 resources/lang/en/pages/category-post.php create mode 100644 resources/lang/en/pages/index.php create mode 100644 resources/lang/en/pages/search.php create mode 100644 resources/lang/en/pages/show.php create mode 100644 resources/lang/en/pages/tag-post.php rename resources/lang/en/{ => resources}/categories.php (100%) rename resources/lang/en/{ => resources}/comments.php (100%) rename resources/lang/en/{ => resources}/general.php (100%) rename resources/lang/en/{ => resources}/news_letters.php (100%) rename resources/lang/en/{ => resources}/posts.php (100%) rename resources/lang/en/{ => resources}/seo_details.php (100%) rename resources/lang/en/{ => resources}/settings.php (100%) rename resources/lang/en/{ => resources}/share_snippets.php (100%) rename resources/lang/en/{ => resources}/tags.php (100%) create mode 100644 resources/lang/pt_BR/components/comment.php create mode 100644 resources/lang/pt_BR/components/header.php create mode 100644 resources/lang/pt_BR/layouts.php create mode 100644 resources/lang/pt_BR/mails/blog-published.php create mode 100644 resources/lang/pt_BR/pages/all-post.php create mode 100644 resources/lang/pt_BR/pages/category-post.php create mode 100644 resources/lang/pt_BR/pages/index.php create mode 100644 resources/lang/pt_BR/pages/search.php create mode 100644 resources/lang/pt_BR/pages/show.php create mode 100644 resources/lang/pt_BR/pages/tag-post.php rename resources/lang/pt_BR/{ => resources}/categories.php (100%) rename resources/lang/pt_BR/{ => resources}/comments.php (100%) rename resources/lang/pt_BR/{ => resources}/general.php (100%) rename resources/lang/pt_BR/{ => resources}/news_letters.php (100%) rename resources/lang/pt_BR/{ => resources}/posts.php (100%) rename resources/lang/pt_BR/{ => resources}/seo_details.php (100%) rename resources/lang/pt_BR/{ => resources}/settings.php (100%) rename resources/lang/pt_BR/{ => resources}/share_snippets.php (100%) rename resources/lang/pt_BR/{ => resources}/tags.php (100%) diff --git a/config/filamentblog.php b/config/filamentblog.php index 55a2432..7a0dcfd 100644 --- a/config/filamentblog.php +++ b/config/filamentblog.php @@ -55,4 +55,6 @@ 'date_format' => 'Y-m-d', 'time_format' => 'H:i', + + 'formatted_published_date' => 'd M Y', ]; diff --git a/resources/lang/en/components/comment.php b/resources/lang/en/components/comment.php new file mode 100644 index 0000000..ef2b3f2 --- /dev/null +++ b/resources/lang/en/components/comment.php @@ -0,0 +1,7 @@ + 'Leave a Reply', + 'comment' => 'Comment', + 'write-your-message-here' => 'Write your message here', + 'submit' => 'Post a Comment', +]; \ No newline at end of file diff --git a/resources/lang/en/components/header.php b/resources/lang/en/components/header.php new file mode 100644 index 0000000..ea6a056 --- /dev/null +++ b/resources/lang/en/components/header.php @@ -0,0 +1,5 @@ + 'Categories', + 'search' => 'Search', +]; \ No newline at end of file diff --git a/resources/lang/en/layouts.php b/resources/lang/en/layouts.php new file mode 100644 index 0000000..7585f94 --- /dev/null +++ b/resources/lang/en/layouts.php @@ -0,0 +1,12 @@ + 'No links found', + 'subscribe-newsletter' => 'Subscribe to our Newsletter', + 'subscribe-newsletter-description' => 'Subscribe to our mailing list to receive daily updates direct to your inbox!', + 'email' => 'Email', + 'email-placeholder' => 'Enter your email', + 'all-rights-reserved' => 'All rights reserved', + 'home' => 'Home', + 'all-posts' => 'All Posts', + 'quick-links' => 'Quick Links' +]; \ No newline at end of file diff --git a/resources/lang/en/mails/blog-published.php b/resources/lang/en/mails/blog-published.php new file mode 100644 index 0000000..ef26dee --- /dev/null +++ b/resources/lang/en/mails/blog-published.php @@ -0,0 +1,7 @@ + 'New Blog Post Notification', + 'body-title' => 'New Blog Post Published!', + 'read-more' => 'Read More', + 'footer-thanks-message' => 'Thank you for subscribing to our blog updates!' +]; \ No newline at end of file diff --git a/resources/lang/en/pages/all-post.php b/resources/lang/en/pages/all-post.php new file mode 100644 index 0000000..17a0b33 --- /dev/null +++ b/resources/lang/en/pages/all-post.php @@ -0,0 +1,6 @@ + 'Latest News / Blogs', + 'no-post' => 'No posts found', +]; \ No newline at end of file diff --git a/resources/lang/en/pages/category-post.php b/resources/lang/en/pages/category-post.php new file mode 100644 index 0000000..357f7c2 --- /dev/null +++ b/resources/lang/en/pages/category-post.php @@ -0,0 +1,5 @@ + 'Category', + 'no-post-found' => 'No posts found', +]; diff --git a/resources/lang/en/pages/index.php b/resources/lang/en/pages/index.php new file mode 100644 index 0000000..b538703 --- /dev/null +++ b/resources/lang/en/pages/index.php @@ -0,0 +1,5 @@ + 'Show all blogs', + 'no-post-found' => 'No posts found' +]; \ No newline at end of file diff --git a/resources/lang/en/pages/search.php b/resources/lang/en/pages/search.php new file mode 100644 index 0000000..898bc3b --- /dev/null +++ b/resources/lang/en/pages/search.php @@ -0,0 +1,5 @@ + 'Search Results', + 'no-post-found' => 'No posts found', +]; \ No newline at end of file diff --git a/resources/lang/en/pages/show.php b/resources/lang/en/pages/show.php new file mode 100644 index 0000000..0b27ad2 --- /dev/null +++ b/resources/lang/en/pages/show.php @@ -0,0 +1,8 @@ + 'Home', + 'comments' => 'Comments', + 'related_posts' => 'Related Posts', + 'no-related-posts' => 'No related posts found', + 'show-all' => 'Show all blogs' +]; \ No newline at end of file diff --git a/resources/lang/en/pages/tag-post.php b/resources/lang/en/pages/tag-post.php new file mode 100644 index 0000000..7ecd2e0 --- /dev/null +++ b/resources/lang/en/pages/tag-post.php @@ -0,0 +1,5 @@ + 'Tag', + 'no-post-found' => 'No posts found' +]; \ No newline at end of file diff --git a/resources/lang/en/categories.php b/resources/lang/en/resources/categories.php similarity index 100% rename from resources/lang/en/categories.php rename to resources/lang/en/resources/categories.php diff --git a/resources/lang/en/comments.php b/resources/lang/en/resources/comments.php similarity index 100% rename from resources/lang/en/comments.php rename to resources/lang/en/resources/comments.php diff --git a/resources/lang/en/general.php b/resources/lang/en/resources/general.php similarity index 100% rename from resources/lang/en/general.php rename to resources/lang/en/resources/general.php diff --git a/resources/lang/en/news_letters.php b/resources/lang/en/resources/news_letters.php similarity index 100% rename from resources/lang/en/news_letters.php rename to resources/lang/en/resources/news_letters.php diff --git a/resources/lang/en/posts.php b/resources/lang/en/resources/posts.php similarity index 100% rename from resources/lang/en/posts.php rename to resources/lang/en/resources/posts.php diff --git a/resources/lang/en/seo_details.php b/resources/lang/en/resources/seo_details.php similarity index 100% rename from resources/lang/en/seo_details.php rename to resources/lang/en/resources/seo_details.php diff --git a/resources/lang/en/settings.php b/resources/lang/en/resources/settings.php similarity index 100% rename from resources/lang/en/settings.php rename to resources/lang/en/resources/settings.php diff --git a/resources/lang/en/share_snippets.php b/resources/lang/en/resources/share_snippets.php similarity index 100% rename from resources/lang/en/share_snippets.php rename to resources/lang/en/resources/share_snippets.php diff --git a/resources/lang/en/tags.php b/resources/lang/en/resources/tags.php similarity index 100% rename from resources/lang/en/tags.php rename to resources/lang/en/resources/tags.php diff --git a/resources/lang/pt_BR/components/comment.php b/resources/lang/pt_BR/components/comment.php new file mode 100644 index 0000000..7433e54 --- /dev/null +++ b/resources/lang/pt_BR/components/comment.php @@ -0,0 +1,7 @@ + 'Deixe uma Resposta', + 'comment' => 'Comentário', + 'write-your-message-here' => 'Escreva sua mensagem aqui', + 'submit' => 'Postar um Comentário', +]; diff --git a/resources/lang/pt_BR/components/header.php b/resources/lang/pt_BR/components/header.php new file mode 100644 index 0000000..f63b996 --- /dev/null +++ b/resources/lang/pt_BR/components/header.php @@ -0,0 +1,5 @@ + 'Categorias', + 'search' => 'Buscar', +]; diff --git a/resources/lang/pt_BR/layouts.php b/resources/lang/pt_BR/layouts.php new file mode 100644 index 0000000..316e6b8 --- /dev/null +++ b/resources/lang/pt_BR/layouts.php @@ -0,0 +1,12 @@ + 'Nenhum link encontrado', + 'subscribe-newsletter' => 'Inscreva-se na nossa Newsletter', + 'subscribe-newsletter-description' => 'Assine nossa lista de e-mails para receber atualizações diárias diretamente na sua caixa de entrada!', + 'email' => 'E-mail', + 'email-placeholder' => 'Digite seu e-mail', + 'all-rights-reserved' => 'Todos os direitos reservados', + 'home' => 'Início', + 'all-posts' => 'Todas as Publicações', + 'quick-links' => 'Links Rápidos' +]; diff --git a/resources/lang/pt_BR/mails/blog-published.php b/resources/lang/pt_BR/mails/blog-published.php new file mode 100644 index 0000000..913e930 --- /dev/null +++ b/resources/lang/pt_BR/mails/blog-published.php @@ -0,0 +1,7 @@ + 'Notificação de Nova Publicação no Blog', + 'body-title' => 'Nova Publicação no Blog Disponível!', + 'read-more' => 'Leia Mais', + 'footer-thanks-message' => 'Obrigado por assinar as atualizações do nosso blog!', +]; diff --git a/resources/lang/pt_BR/pages/all-post.php b/resources/lang/pt_BR/pages/all-post.php new file mode 100644 index 0000000..59fa39a --- /dev/null +++ b/resources/lang/pt_BR/pages/all-post.php @@ -0,0 +1,6 @@ + 'Últimas Notícias / Blogs', + 'no-post' => 'Nenhuma publicação encontrada', +]; diff --git a/resources/lang/pt_BR/pages/category-post.php b/resources/lang/pt_BR/pages/category-post.php new file mode 100644 index 0000000..777aa6d --- /dev/null +++ b/resources/lang/pt_BR/pages/category-post.php @@ -0,0 +1,5 @@ + 'Categoria', + 'no-post-found' => 'Nenhuma publicação encontrada', +]; diff --git a/resources/lang/pt_BR/pages/index.php b/resources/lang/pt_BR/pages/index.php new file mode 100644 index 0000000..3911347 --- /dev/null +++ b/resources/lang/pt_BR/pages/index.php @@ -0,0 +1,5 @@ + 'Mostrar todos os blogs', + 'no-post-found' => 'Nenhuma publicação encontrada' +]; diff --git a/resources/lang/pt_BR/pages/search.php b/resources/lang/pt_BR/pages/search.php new file mode 100644 index 0000000..ca74177 --- /dev/null +++ b/resources/lang/pt_BR/pages/search.php @@ -0,0 +1,5 @@ + 'Resultados da Pesquisa', + 'no-post-found' => 'Nenhuma publicação encontrada', +]; diff --git a/resources/lang/pt_BR/pages/show.php b/resources/lang/pt_BR/pages/show.php new file mode 100644 index 0000000..fdd4c75 --- /dev/null +++ b/resources/lang/pt_BR/pages/show.php @@ -0,0 +1,8 @@ + 'Início', + 'comments' => 'Comentários', + 'related_posts' => 'Publicações Relacionadas', + 'no-related-posts' => 'Nenhuma publicação relacionada encontrada', + 'show-all' => 'Mostrar todos os blogs', +]; diff --git a/resources/lang/pt_BR/pages/tag-post.php b/resources/lang/pt_BR/pages/tag-post.php new file mode 100644 index 0000000..951bc5a --- /dev/null +++ b/resources/lang/pt_BR/pages/tag-post.php @@ -0,0 +1,5 @@ + 'Tag', + 'no-post-found' => 'Nenhuma publicação encontrada', +]; diff --git a/resources/lang/pt_BR/categories.php b/resources/lang/pt_BR/resources/categories.php similarity index 100% rename from resources/lang/pt_BR/categories.php rename to resources/lang/pt_BR/resources/categories.php diff --git a/resources/lang/pt_BR/comments.php b/resources/lang/pt_BR/resources/comments.php similarity index 100% rename from resources/lang/pt_BR/comments.php rename to resources/lang/pt_BR/resources/comments.php diff --git a/resources/lang/pt_BR/general.php b/resources/lang/pt_BR/resources/general.php similarity index 100% rename from resources/lang/pt_BR/general.php rename to resources/lang/pt_BR/resources/general.php diff --git a/resources/lang/pt_BR/news_letters.php b/resources/lang/pt_BR/resources/news_letters.php similarity index 100% rename from resources/lang/pt_BR/news_letters.php rename to resources/lang/pt_BR/resources/news_letters.php diff --git a/resources/lang/pt_BR/posts.php b/resources/lang/pt_BR/resources/posts.php similarity index 100% rename from resources/lang/pt_BR/posts.php rename to resources/lang/pt_BR/resources/posts.php diff --git a/resources/lang/pt_BR/seo_details.php b/resources/lang/pt_BR/resources/seo_details.php similarity index 100% rename from resources/lang/pt_BR/seo_details.php rename to resources/lang/pt_BR/resources/seo_details.php diff --git a/resources/lang/pt_BR/settings.php b/resources/lang/pt_BR/resources/settings.php similarity index 100% rename from resources/lang/pt_BR/settings.php rename to resources/lang/pt_BR/resources/settings.php diff --git a/resources/lang/pt_BR/share_snippets.php b/resources/lang/pt_BR/resources/share_snippets.php similarity index 100% rename from resources/lang/pt_BR/share_snippets.php rename to resources/lang/pt_BR/resources/share_snippets.php diff --git a/resources/lang/pt_BR/tags.php b/resources/lang/pt_BR/resources/tags.php similarity index 100% rename from resources/lang/pt_BR/tags.php rename to resources/lang/pt_BR/resources/tags.php diff --git a/resources/views/blogs/all-post.blade.php b/resources/views/blogs/all-post.blade.php index 5afdac2..470b967 100644 --- a/resources/views/blogs/all-post.blade.php +++ b/resources/views/blogs/all-post.blade.php @@ -2,7 +2,7 @@

- Latest News / Blogs + @lang('filament-blog::pages/all-post.title')

@@ -14,7 +14,7 @@ @empty
-

No posts found

+

@lang('filament-blog::pages/all-post.no-post')

@endforelse diff --git a/resources/views/blogs/category-post.blade.php b/resources/views/blogs/category-post.blade.php index c1f514d..7faef1c 100644 --- a/resources/views/blogs/category-post.blade.php +++ b/resources/views/blogs/category-post.blade.php @@ -2,7 +2,7 @@

- Category: {{ $category->name }} + @lang('filament-blog::pages/category-post.title'): {{ $category->name }}

@@ -14,7 +14,7 @@ @empty
-

No posts found

+

@lang('filament-blog::pages/category-post.no-post-found')

@endforelse diff --git a/resources/views/blogs/index.blade.php b/resources/views/blogs/index.blade.php index 00a8cb7..a0cc6fd 100644 --- a/resources/views/blogs/index.blade.php +++ b/resources/views/blogs/index.blade.php @@ -22,7 +22,7 @@ diff --git a/resources/views/blogs/show.blade.php b/resources/views/blogs/show.blade.php index 07cea53..3ff249a 100644 --- a/resources/views/blogs/show.blade.php +++ b/resources/views/blogs/show.blade.php @@ -2,9 +2,9 @@
- COMMENTS + @lang('filament-blog::pages/show.comments')
{!! $shareButton?->html_code !!} @@ -83,7 +83,7 @@ @if($post->comments->count())
-

Comments

+

@lang('filament-blog::pages/show.comments')

@foreach($post->comments as $comment) @@ -124,7 +124,7 @@

- # Related Posts + # @lang('filament-blog::pages/show.related_posts')

@@ -135,13 +135,13 @@ @empty
-

No related posts found.

+

@lang('filament-blog::pages/show.no-related-posts').

@endforelse
diff --git a/resources/views/components/comment.blade.php b/resources/views/components/comment.blade.php index 7fbad58..9c756e5 100644 --- a/resources/views/components/comment.blade.php +++ b/resources/views/components/comment.blade.php @@ -3,11 +3,11 @@ @csrf
-

Leave a reply

+

@lang('filament-blog::components/comment.leave-reply')

diff --git a/resources/views/components/header.blade.php b/resources/views/components/header.blade.php index 419da0a..3f3e023 100644 --- a/resources/views/components/header.blade.php +++ b/resources/views/components/header.blade.php @@ -15,11 +15,11 @@
-

Quick Links

+

@lang('filament-blog::layouts.quick-links')

@forelse($setting->quick_links ?? [] as $link) {{ $link['label'] }} @empty -

No links found

+

@lang('filament-blog::layouts.no-links-found')

@endforelse
- Subscribe to our Newsletter + @lang('filament-blog::layouts.subscribe-newsletter')

- Subscribe to our mailing list to receive daily updates direct to your inbox! + @lang('filament-blog::layouts.subscribe-newsletter-description')

@csrf - + @error('email') {{ $message }} @enderror @@ -217,7 +217,7 @@ class="transition duration-300 will-change-transform hover:translate-x-1 hover:t + placeholder="{{ __('filament-blog::layouts.email-placeholder') }}" type="email">
@@ -255,7 +255,7 @@ class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50"> - Home + @lang('filament-blog::layouts.home') @@ -263,7 +263,7 @@ class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50"> - All Posts + @lang('filament-blog::layouts.all-posts')
diff --git a/resources/views/mails/blog-published.blade.php b/resources/views/mails/blog-published.blade.php index 3d47131..5216b96 100644 --- a/resources/views/mails/blog-published.blade.php +++ b/resources/views/mails/blog-published.blade.php @@ -3,7 +3,7 @@ - New Blog Post Notification + @lang('filament-blog::resources/mails.blog-published.title')