Learn to create a translatable app with FilamentPHP. This guide covers two translation packages, Spatie Translatable and Zeus Translatable Pro, to help you choose the best fit for your project.
zeus zeus
Building a multi language App with FilamentPHP
Creating a translatable app can greatly enhance its accessibility and user reach. Here’s a simple guide on how to do this using the FilamentPHP framework.
Step 1: Set Up Your Laravel and FilamentPHP
First, you need to have a Laravel application set up and FilamentPHP installed. You can find detailed instructions for these initial steps in the Laravel and FilamentPHP documentation.
Step 2: Choose Your Translation Package
After setting up your environment, you have two main options for making your app translatable with FilamentPHP:
1. Spatie Translatable Package
This package uses a trait to make your Eloquent models translatable. It stores translations as JSON within your existing database tables, eliminating the need for extra tables. This approach is straightforward and easy to implement.
Pros:
- Simple setup
- No additional tables needed
Cons:
- May not be as efficient for large-scale apps
- Limited optimization options
For more details, visit: Filament Spatie Translatable
2. Translatable Pro
This is a more advanced and optimized solution for creating high-performance translatable apps. Translatable Pro offers enhanced performance and flexibility, making it suitable for larger and more complex applications.
Pros:
- Optimized for performance
- Advanced features for complex apps
Cons:
- More complex setup
- Might be overkill for smaller projects
For more details, visit: Translatable Pro
Step 3: Implement Your Chosen Package
Choose the package that best suits your project's needs and follow the implementation guide provided in the respective documentation. Each package will have specific instructions on how to integrate it with your FilamentPHP setup.
Conclusion
Both the Spatie Translatable Package and Translatable Pro have their own advantages and trade-offs. Consider the scale and requirements of your project when choosing the right package for your translatable app. Happy coding!
By keeping these steps simple and direct, you can quickly start building a translatable app with FilamentPHP and enhance your app's accessibility.