Download the PHP package thienson98/tftranslator without Composer
On this page you can find all versions of the php package thienson98/tftranslator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thienson98/tftranslator
More information about thienson98/tftranslator
Files in thienson98/tftranslator
Package tftranslator
Short Description A simple package help you automatically translate all text on your site to other languages.
License MIT
Informations about the package tftranslator
3F Translator
A simple Laravel package help you automatically translate all text on your site to other languages. Writed by Trieu Tai Niem.
Requirement
- PHP: >= 7.0
- Laravel: >= 5.5
Features
-
Automatically find translate string in parameter of translation functions ( _() or lang() ) and generate into json translation files
-
Automatically translates text found into other languages using google translator
- Automatically updates and translates newly added text
Installation
Open terminal and change directory to your project folder, now using composer command bellow to install package:
Finally, open laravel config file config/app.php and add the following line to end of $provider array:
That's all!
How to use?
If you want to automatically generate keys from translation functions (__ or lang) into json language files, use the following command:
Of course, you can also use the above command to update the changes in your files
Auto find and insert translation function
You do not want to take the effort to insert text as parameter of translation function?
Do not worry! You just execute the command bellow:
Translation functions will be added to the view files and automatically generated json language files.
Specify other languages
The default languages of the translator are Vietnamese (vi) and English (en). You can translate into other languages with the option.
For example, use the following command to translate to Japanese:
Or translate to Vietnamese, Japanese and Chinese:
It supports all languages and works with all of the options.
Remove unused keys
To clean unused translation keys, you can use the following command:
It will remove all the keys that are not using in views.
Just write the translation keys
Of course, if you do not want to use Google translator to translate your texts. You can use the option below:
It will ignore auto-translations and only give you translation keys into json files.
This option works with all of the options above.