1. Go to this page and download the library: Download hollisho/h-translator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hollisho / h-translator example snippets
$translator = new Translator();
$phpFileLoader = new PhpFileLoader();
$translator->addLoader('phpFile', $phpFileLoader);
$translator->addResource('phpFile', dirname(__DIR__) . "/Files/zh-cn.php", 'zh_CN');
$trans = $translator->trans("user.username");
$localeManager = new LocaleManager();
$localeManager->setLocale(LocaleVo::EN_US);
$momentTranslator = new MomentTranslator($localeManager);
// format with moment.js definitions
$momentTranslator->format('llll');