dev-3bdulrahman / translation-dashboard
Modern Laravel Translation Dashboard
Requires
- php: ^8.1
- illuminate/support: ^9|^10|^11|^12
- illuminate/translation: ^9|^10|^11|^12
- symfony/finder: ^6|^7
Requires (Dev)
- orchestra/testbench: ^7|^8|^9|^10
README
# Translation DashboardA user-friendly dashboard for managing Laravel application translations.
Installation
- Add the package to your Laravel application:
composer require dev-3bdulrahman/translation-dashboard
العربية: عند تثبيت الباكج، سيتم تنفيذ جميع الأوامر التالية تلقائيًا:
- نشر ملفات الإعدادات (
php artisan translations:publish-config
) - نشر الأصول (
php artisan translations:publish-assets
) - نشر ملفات الترحيلات (
php artisan translations:publish-migrations
) - تشغيل الترحيلات (
php artisan migrate
) - استيراد الترجمات الموجودة (
php artisan translation:import
) - البحث عن مفاتيح الترجمة في التطبيق (
php artisan translation:find
)
لا تحتاج إلى تنفيذ أي أوامر يدويًا، فقط قم بتثبيت الباكج وستكون جاهزًا للاستخدام مباشرة!
English: When installing the package, all of the following commands will be executed automatically:
- Publish configuration files (
php artisan translations:publish-config
) - Publish assets (
php artisan translations:publish-assets
) - Publish migration files (
php artisan translations:publish-migrations
) - Run migrations (
php artisan migrate
) - Import existing translations (
php artisan translation:import
) - Find translation keys in your application (
php artisan translation:find
)
You don't need to run any commands manually - just install the package and you're ready to go!
Note: If you need to re-run any of these commands later, you can execute them manually:
php artisan translations:publish-config php artisan translations:publish-assets php artisan translations:publish-migrations php artisan migrate php artisan translation:import php artisan translation:findThe assets will be copied to the
public/translation-dashboard
directory. The package will automatically use these local assets instead of loading them from CDN.
Usage
-
Visit
/translations
in your browser to access the dashboard. -
Import existing translations:
- Click on "Import Groups" to import existing translations from your Laravel application.
-
Find translations:
- Click on "Find Translations in Files" to scan your application for translation keys.
-
Edit translations:
- Select a group from the dropdown menu.
- Click on any translation to edit it.
- Click "OK" to save the translation.
-
Add new translation keys:
- Enter new keys in the "Add New Keys to Group" section.
- Click "Add Keys" to add them to the selected group.
-
Publish translations:
- Click "Publish Translations" to export the translations back to your Laravel application.
Commands
php artisan translation:import
: Import translations from the application.php artisan translation:find
: Find translations in the application.php artisan translation:export
: Export translations to the application.php artisan translation:clean
: Clean the translation database.php artisan translation:reset
: Reset the translation database.php artisan translations:publish-assets
: Publish assets for the Translation Dashboard.php artisan translations:publish-config
: Publish the configuration file.php artisan translations:publish-migrations
: Publish migration files.
Configuration
You can configure the package by editing the config/translation-manager.php
file.
Troubleshooting
Assets not loading
If you're having issues with assets not loading:
-
Make sure you've published the assets:
php artisan translations:publish-assets
-
Check that the assets exist in the
public/translation-dashboard
directory. -
If the assets still don't load, the package will automatically fall back to CDN resources.
-
If you're using a custom public path, make sure to update your asset URLs accordingly.
Missing translations
If translations are not showing up:
-
Make sure you've run the migrations:
php artisan migrate
-
Import your existing translations:
php artisan translation:import
-
Check the database to ensure the translations were imported correctly.
License
This package is open-sourced software licensed under the MIT license.