代码拉取完成,页面将自动刷新
这个项目可以在 PHP 中实现莉沫酱自创的 i18nglish,且不用担心 XSS 攻击。
示例文本取自 Richard M. Stallman 的《自由软件之歌》英文歌词。
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.
(注:“We'll”中的撇号是我自己加的,原本这个撇号在转义过程中丢失了。)
git clone
整个仓库。如果速度缓慢,可以试着把 Git URL 中的hub
改为ee
以使用码云镜像。也可以使用 Composer:composer require diamochang/i7h-php
。i7h.php
移动到你的项目。如果你是用 Composer 安装的,这步可以跳过。// 请以实际存放 i7h.php 的位置为准
require_once "i7h.php";
// 实例化 i7h 类
$i7h = new i7h();
// 调用 i18n 方法处理字符串,并输出结果
echo $i7h->i18n('你要转换的内容')
欢迎 PR,欢迎 Issues。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。