支持文件类型 (Strings)

.HTML (Strings)

文本由 Phrase Language AI 从英语机器翻译而得。

文件扩展名

.html

API 扩展

html

导入

导出

复数形式支持

描述支持

格式选项

document_id

HTML 用于许多场合。Web 开发已经摆脱了静态 HTML 文件,但 HTML 内容仍然存在,例如以电子邮件的形式。

与所有支持的格式一样,系统会根据后台使用的 XML tags 尝试从文档中提取键和值。在此过程中,.HTML 文件中的简单元素(标题、段落等)被正确检测,但不支持任何更复杂的内容。

所有 HTML tags 都导入编辑器,准确识别段落。

示例:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Phrase Strings示例</title>
</head>
<body>
  <h1 data-i18n="page.title">欢迎使用我们的应用程序</h1>
  <p data-i18n="page.subtitle">我们希望您喜欢您的住宿。</p>

  <!-- XML 风格块用于包装可译的 Strings -->
  <translations>
    <字符串键="user.login.button">登录</字符串>
    <字符串键="user.logout.button">注销</字符串>
    <字符串键="user.greeting">您好, {{username}}!</字符串>
    <字符串键="form.error.required">此字段为必填字段。</字符串>
    <字符串键="form.error.电子邮件">请输入有效的电子邮件地址。</字符串>
  </translations>

  <!-- 更多可能被识别为 Strings 的 UI 内容 -->
  <按钮 data-i18n="user.login.按钮">登录</按钮>
  <按钮 data-i18n="user.logout.按钮">注销</按钮>

  <!-- 嵌入式 SVG(仍是 XML!) -->
  <svg width="100" height="100">
    <text x="10" y="20" data-i18n="graphic.label">Chart</text>
  </svg>
</body>
</html>
  • data-i18n 属性是检测哪些 HTML 元素的内容应替换为本地化 Strings 的常用方法。

  • 带有 <字符串键="...">值的</字符串> <translations> 块是可识别的自定义 XML 块。

  • {{username}} 等占位符表示动态内容。

格式选项

标识符

document_id

类型

字符串

上传

下载

说明

获取导出应基于的项目现有 HTML 文档的文档 ID。

 
这篇文章有帮助吗?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.