How to Translate language in Doctry?
Translation of strings is termed as localization in laravel official documention.
You can change language according to your need in doctry by following the steps given below.
- Go to project main folder you will find "resources" folder e.g doctry > resources
- There you will find a folder named "lang"
- In which there are language folders like "en", "de" etc.
If your required folder exist then you need to do the following steps for translating or changing words
you can find 6 files containing application translation in which you can change words value as you required.
you can find most of the translation in lang.php file.
Create New Language
If your required folder not exist then you can create new language by following steps
Create your language folder with its code name e.g "en", "de" etc.
- Copy all the files from "en" folder and paste it in your folder that you want your application to be translated in.
- All files contain the translated strings of the whole application. You have to translate all files manually.
- Go to project main folder (root) -> app folder -> Helper.php
- Open Helper.php find (getTranslatedLang) function add your created language in list e.g
'fr' => array( 'code' => 'fr', 'title' => 'French', ),
- Go to Admin Dashboard -> General Settings you will find "Language Settings" option if you do previous step correctly you will find your language in the dropdown as shown in image below.
- select your language and click save.
- After select language and save if still language not update then clear your application cache from Admin Dashboard -> General Settings > Clear Cache settings as shown in below image.
For more information regrading translation in laravel you can visit laravel official documention Laravel Localization