cms-laravel icon indicating copy to clipboard operation
cms-laravel copied to clipboard

Implement multilingual content management

Open sweep-ai[bot] opened this issue 1 year ago • 0 comments

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:

  1. Database Schema Changes:

    • Added a languages table to store language information, including the language name, code, and active status.
    • Updated the contents table to include a language_code column and a translation_group_id column to support content translations.
    • Added a unique constraint on the content_title and language_code columns in the contents table to ensure unique content titles per language.
  2. Model Changes:

    • Updated the Content model to include the new database columns and relationships for language and translations.
    • Added a Language model to manage language-related data.
  3. Filament Resource Changes:

    • Updated the ContentResource to include a language filter, a "Translate" action, and additional form fields to manage content in multiple languages.
    • Added a new LanguageResource to manage the available languages in the application.
  4. Livewire Component:

    • Added a 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 the contents table to support multilingual content.
  • database/migrations/2023_11_01_000000_create_languages_table.php: Created a new languages table to store language information.
  • app/Models/Content.php: Updated the Content model to include language-related functionality.
  • app/Models/Language.php: Added a new Language model to manage language data.
  • app/Filament/App/Resources/ContentResource.php: Updated the ContentResource to include language-related features.
  • app/Filament/App/Resources/LanguageResource.php: Added a new LanguageResource 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.

sweep-ai[bot] avatar Jul 26 '24 16:07 sweep-ai[bot]