Implement multilingual content management #189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request introduces a multilingual content management system for the CMS-Laravel application. It allows users to create, translate, and manage content in multiple languages.
Description
The key changes in this pull request are:
Database Schema Changes:
languages
table to store language information, including the language name, code, and active status.contents
table to include alanguage_code
column and atranslation_group_id
column to support content translations.content_title
andlanguage_code
columns in thecontents
table to ensure unique content titles per language.Model Changes:
Content
model to include the new database columns and relationships for language and translations.Language
model to manage language-related data.Filament Resource Changes:
ContentResource
to include a language filter, a "Translate" action, and additional form fields to manage content in multiple languages.LanguageResource
to manage the available languages in the application.Livewire Component:
LanguageSwitcher
Livewire component to allow users to switch the application's language.Summary
The key changes in this pull request are:
database/migrations/2023_10_26_164941_create_contents_table.php
: Added new columns and constraints to thecontents
table to support multilingual content.database/migrations/2023_11_01_000000_create_languages_table.php
: Created a newlanguages
table to store language information.app/Models/Content.php
: Updated theContent
model to include language-related functionality.app/Models/Language.php
: Added a newLanguage
model to manage language data.app/Filament/App/Resources/ContentResource.php
: Updated theContentResource
to include language-related features.app/Filament/App/Resources/LanguageResource.php
: Added a newLanguageResource
to manage available languages.app/Http/Livewire/LanguageSwitcher.php
: Added a new Livewire component to allow users to switch the application's language.Suggested changes from Sweep Chat by @curtisdelicata. Continue chatting at https://sweep-chat-demo.vercel.app/c/74b23fb2-cdff-4528-bcaf-91aa76046696.