This project can implement i18nglish, which was created by RimoChan, in PHP without worrying about XSS attacks.
The example text is taken from Richard M. Stallman's Free Software Song lyrics.
Before:
When we have enough free software
At our call, hackers, at our call,
We'll kick out those dirty licenses
Ever more, hackers, ever more.
After:
W2n we h2e e4h f2e s6e
At o1r c2l, h5s, at o1r c2l,
We'll k2k o1t t3e d3y l6s
E2r m2e, h5s, e2r m2e.
(Note: I added the apostrophe in "We'll" myself, it was originally lost in the escaping process.)
git clonethe entire repository. If it's slow, try changinghubtoeein the Git URL to use the Gitee mirror. You can also use Composer:composer require diamochang/i7h-php.- Move
i7h.phpto your project. If you installed it with Composer, this step can be skipped. - Add the dependency to the code you want to use:
// Please refer to the actual location of i7h.php.
require_once "i7h.php";- Call it with the following code:
// Instantiate the i7h class
$i7h = new i7h();
// Call the i18n method to process the string and output the result.
echo $i7h->i18n('what you want to convert')- The job is done.
- English apostrophe may be lost in the escape process
PRs are welcome, Issues are welcome.
