### Update Language Files with Artisan Command Source: https://github.com/laravel-lang/moonshine/blob/main/README.md After installation, run this Artisan command to connect the package and manage localizations for your application. ```bash php artisan lang:update ``` -------------------------------- ### Install MoonShine Translations via Composer Source: https://github.com/laravel-lang/moonshine/blob/main/README.md Use this command to add the MoonShine Translations package as a development dependency to your Laravel project. ```bash composer require laravel-lang/moonshine --dev ``` -------------------------------- ### Auto-register ServiceProvider Source: https://context7.com/laravel-lang/moonshine/llms.txt The ServiceProvider auto-registers the Plugin class with the Laravel service container if laravel-lang/publisher is installed. No manual registration is required. ```php app->register(Plugin::class); } } } // composer.json registers the provider automatically via Laravel's package discovery: // "extra": { // "laravel": { // "providers": ["LaravelLang\\MoonShine\\ServiceProvider"] // } // } ``` -------------------------------- ### French Locale File (`php.json`) Source: https://context7.com/laravel-lang/moonshine/llms.txt Excerpt of a French locale file, demonstrating the structure of combined auth, pagination, UI, and validation strings with full :attribute-prefixed validation messages. ```json // locales/fr/php.json (excerpt — French locale) { "404": "Houston we have a problem page not found", "accepted": "Le champ :attribute doit être accepté.", "add": "Add", "dashboard": "Dashboard", "failed": "Ces identifiants ne correspondent pas à nos enregistrements.", "home": "Home", "login.authorization": "Authorization", "login.description": "Please sign-in to your account", "login.email": "E-mail", "login.login": "Log in", "login.logout": "Log out", "login.password": "Password", "login.remember_me": "Remember me", "login.title": "Welcome to :moonshine_title!", "login.username": "Username", "next": "Next »", "notifications.mark_as_read": "Mark as read", "notifications.mark_as_read_all": "Mark all as read", "notifications.title": "Notifications", "password": "Le mot de passe est incorrect", "required": "Le champ :attribute est obligatoire.", "resource.admins_title": "Admins", "resource.export.exported": "File exported", "resource.import.imported": "Imported", "select.add_item": "Press Enter to add :value", "select.clear_all": "Clear all", "select.no_options": "No options to choose from", "showing": "Showing", "throttle": "Tentatives de connexion trop nombreuses. Veuillez essayer de nouveau dans :seconds secondes.", "unique": "La valeur du champ :attribute est déjà utilisée." } ``` -------------------------------- ### MoonShine 4.x UI Translation File (Excerpt) Source: https://context7.com/laravel-lang/moonshine/llms.txt An excerpt of the English interface strings for MoonShine 4.x, including 404 messages, general actions, login forms, notifications, resource management, and select components. Note the 'home' key is a v4.x addition. ```php 'Houston we have a problem page not found', 'add' => 'Add', 'home' => 'Home', // v4.x addition 'dashboard' => 'Dashboard', 'login' => [ 'authorization' => 'Authorization', 'description' => 'Please sign-in to your account', 'email' => 'E-mail', 'login' => 'Log in', 'logout' => 'Log out', 'password' => 'Password', 'remember_me' => 'Remember me', 'title' => 'Welcome to :moonshine_title!', 'username' => 'Username', ], 'notifications' => [ 'mark_as_read' => 'Mark as read', 'mark_as_read_all' => 'Mark all as read', 'title' => 'Notifications', ], 'resource' => [ 'admins_title' => 'Admins', 'avatar' => 'Avatar', 'change_password' => 'Change password', 'export' => ['exported' => 'File exported'], 'import' => [ 'extension_not_supported' => 'File extension not supported', 'file_required' => 'File is required', 'imported' => 'Imported', ], 'queued' => 'Queued', ], 'select' => [ 'add_item' => 'Press Enter to add :value', 'clear_all' => 'Clear all', 'max_item' => 'Only :count values can be added', 'no_options' => 'No options to choose from', 'no_results' => 'No results found', 'remove_item' => 'Remove item', 'unique_item' => 'Only unique values can be added', ], ]; ``` -------------------------------- ### Manage Locales with laravel-lang/publisher Source: https://context7.com/laravel-lang/moonshine/llms.txt Add, remove, or list locales using `laravel-lang/publisher` commands. The MoonShine package integrates automatically. ```bash # Add a new locale (e.g., German) php artisan lang:add de ``` ```bash # Remove a locale php artisan lang:remove de ``` ```bash # List all available locales php artisan lang:list ``` -------------------------------- ### Plugin Class for MoonShine Translations Source: https://context7.com/laravel-lang/moonshine/llms.txt The root `Plugin` class extends `laravel-lang/publisher`'s `Provider` and registers version-specific sub-plugins (`V3`, `V4`). The publisher selects the correct plugin based on the installed MoonShine version. ```php