A simple tool for Laravel document translate.
To install this tool, run the command below and you will get the latest version
composer install louissu/laravel-translate-formatter
This is a very simple tool to translate the nouns list from laravel-taiwan/docs wiki. It's will translate the nouns by the format with:
ability => 權限(ability)
It's non-case sensitive (means translate no matter upper or lower case) and will ignore code block. This result is just for reference only, so after run the
translate() function, you still need to check them carefully, that's why the format include the resource and result.
<?php require "vendor/autoload.php"; use Louissu\Translate\Handler; $handler = new Handler(); echo $handler ->setLocale('zh-TW') ->translate(file_get_contents('./content.md'));
This function set locale from English to something you want, it's default zh-TW and only zh-TW currently, welcome to pr!
This function will translate the corresponding nouns and return the result.
I write the reason why I do this project in my blog article. You can visit if you are interested it!