两个强大的流程:从HTML中提取文案到JSON,以及使用JSON从带键的模板还原原始HTML
强大的HTML解析能力,能准确识别和提取各种标签中的文本内容,同时自动过滤脚本和样式代码
自动生成i18n标准的JSON资源文件,包含键值映射和嵌套结构,便于直接集成
提供翻译JSON和带t(...)键的HTML,以重建原始HTML并恢复文案,无需更改您的模板
体验我们的工具如何将HTML内容转换为结构化的国际化资源
<div class="header">
<h1>Welcome to our service</h1>
<p>This is a sample text to demonstrate i18n extraction.</p>
<button title="Click to continue">Get Started</button>
</div>{
"header.title": "Welcome to our service",
"header.description": "This is a sample text to demonstrate i18n extraction.",
"header.button.text": "Get Started",
"header.button.title": "Click to continue"
}提取后,您可以轻松地将JSON文件与流行的i18n库集成:
// React + i18next (example)
import i18n from 'i18next'
import { useTranslation } from 'react-i18next'
import translations from './translations.json'
i18n.init({ resources: { en: { translation: translations } } })
function Header() {
const { t } = useTranslation()
return (
<div className="header">
<h1>{t('header.title')}</h1>
<p>{t('header.description')}</p>
<button title={t('header.button.title')}>{t('header.button.text')}</button>
</div>
)
}