Implement multilingual content management #189
Closed
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:
languagestable to store language information, including the language name, code, and active status.contentstable to include alanguage_codecolumn and atranslation_group_idcolumn to support content translations.content_titleandlanguage_codecolumns in thecontentstable to ensure unique content titles per language.Model Changes:
Contentmodel to include the new database columns and relationships for language and translations.Languagemodel to manage language-related data.Filament Resource Changes:
ContentResourceto include a language filter, a "Translate" action, and additional form fields to manage content in multiple languages.LanguageResourceto manage the available languages in the application.Livewire Component:
LanguageSwitcherLivewire 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 thecontentstable to support multilingual content.database/migrations/2023_11_01_000000_create_languages_table.php: Created a newlanguagestable to store language information.app/Models/Content.php: Updated theContentmodel to include language-related functionality.app/Models/Language.php: Added a newLanguagemodel to manage language data.app/Filament/App/Resources/ContentResource.php: Updated theContentResourceto include language-related features.app/Filament/App/Resources/LanguageResource.php: Added a newLanguageResourceto 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.