Multi-Languages Last updated: 2022-10-04

Adding multiple languages is an indispensable thing, so we provided you with the best means of it through which you can write your codes with sources we have chosen for you because they are the best
Do not worry, we are providing you with the best source in this field, which is multiple languages through the package


Instead of many other packages with the same idea, we believe that this package is the most effective because as you will see next it will make searching in these multiple languages quite easy
All what you have to do is follow the package instructions according to what is included in the explanation of the package installation and remember that each version of the framework in the package is available specifically. 

Let me give you some examples

https://github.com/Astrotomic/laravel-translatable

PackageLaravelPHP
v11.10 - v11.10

8.* / 9.*

^8.0

v11.6 - v11.9

5.8.* / 6.* / 7.* / 8.*

>=7.2

v11.4 - v11.5

5.6.* / 5.7.* / 5.8.* / 6.*

>=7.1.3

v11.0 - v11.3

5.6.* / 5.7.* / 5.8.*

>=7.1.3

Then you have to choose the appropriate version of the package with your framework

 

Well, after you have installed the package and set up your tables and models to add more than one language, what should you do inside your resource ?

You can start using the translatable method to implement what is stated with all the elements,, especially with text , email ,textarea ,ckeditor

Well let's take an example

text()->make('title', 'title')
   ->translatable([
   'ar' => 'العربية',
   'en' => 'English',
   ])


   ckeditor()->make('content ', 'content')
   ->translatable([
   'ar' => 'العربية',
   'en' => 'English',
   ]),

   textarea()->make('content ', 'content')
   ->translatable([
   'ar' => 'العربية',
   'en' => 'English',
   ])

Note that we set the method

->translatable([
   'ar' => 'العربية',
   'en' => 'English',
   ])

Let's see the result then

Look how simple : )

You can now add as many languages as you need without making any other additional settings