支持文件类型 (Strings)

.XLIFF - Symfony (Strings)

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

文件扩展名 

.xlf、.xliff

API 扩展 

symfony_xliff

导入 

导出 

复数形式支持 

描述支持 

格式选项 

enclose_in_cdata

include_translation_state

Symfony=""是一个高性能的 PHP 框架,由各种预定义的 PHP 组件组成。" 本地化""%1""对于使用 Symfony 构建的应用程序,可以使用 XLIFF、YAML 和 PHP 数组等文件格式进行本地化。 

Symfony .XLIFF 和标准 .XLIFF 的区别在于它们如何定位每个 <trans-unit> 表示的内容。标准 .XLIFF(以及其他框架支持的大多数 .XLIFF 变体)使用 ID 属性,Symfony .XLIFF 则使用属性重命名作为标识符。

为确保 Strings 上传到正确的区域,Symfony.XLIFF 文件头中的译文-语言属性需要匹配相关项目中配置的区域名称。

格式选项

标识符 

enclose_in_cdata

类型 

布尔值

上传 

下载 

默认 

false

说明 

包含 CDATA 中包含 html tags 的翻译。如果禁用,不支持的 HTML 实体将被替换为其解码值。例如:

  • &pound; 替换为 £

  • &trade; 替换为

标识符 

include_translation_state

类型 

布尔值

上传 

下载 

默认 

false

说明 

包括译文区域中的翻译状态。每个 <译文> 标签都将获得一个状态属性,可以是:新建已注销、已翻译

代码示例

<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
  <file original="global" datatype="plaintext" source-language="de-DE" target-language="en-GB">
    <body>
      <trans-unit id="boolean_key" resname="boolean_key">
        <source xml:lang="de-DE">--- true
</原文/源语>
        <target xml:lang="en-GB">--- true
</target>
      </trans-unit>
      <trans-unit id="empty_string_translation" resname="empty_string_translation">
        <source xml:lang="de-DE"/>
        <target xml:lang="en-GB"/>
      </trans-unit>
      <trans-unit id="key_with_description" resname="key_with_description">
        <原文/源语 xml:lang="de-DE">Schau dir das mal an!Dieser Schlüssel hat eine Beschreibung!</原文/源语>
        <译文 xml:lang="en-GB">查看!This key has a description!(至少在某些格式下)</译文>
        <note>我对这个键非常重要的描述!</note>
      </trans-unit>
      <trans-unit id="key_with_line-break" resname="key_with_line-break">
        <source xml:lang="de-DE">Diese Übersetzung hat
einen Zeilenumbruch.</source>
        <译文 xml:lang="en-GB">此译文包含
换行符。</译文>
      </trans-unit>
      <trans-unit id="nested.deeply.key" resname="nested.deeply.key">
        <原文/源语 xml:lang="de-DE">原文/源语>
        <译文 xml:lang="en-GB">我是一个深度嵌套的键。</译文>
      </trans-unit>
      <trans-unit id="nested.key" resname="nested.key">
        <原文/源语 xml:lang="de-DE">原文/源语>
        译文 xml:lang="en-GB"键嵌套在命名空间内。</译文>
      </trans-unit>
      <trans-unit id="null_translation" resname="null_translation">
        <source xml:lang="de-DE"/>
        <target xml:lang="en-GB"/>
      </trans-unit>
      <trans-unit id="sample_collection" resname="sample_collection">
        <source xml:lang="de-DE">---
- erstes 项目
- zweites 条目
</原文/源语>
        <target xml:lang="en-GB">---
- 第一项
- 第二项
- 第三项
</target>
      </trans-unit>
      <trans-unit id="simple_key" resname="simple_key">
        <原文/源语 xml:lang="de-DE">护士 ein einfacher Schlüssel mit einer einfachen Nachricht.</原文/源语>
        <译文 xml:lang="en-GB">只是一个带有简单信息的简单键。</译文>
      </trans-unit>
      <trans-unit id="unverified_key" resname="unverified_key">
        <source xml:lang="de-DE">Diese Übersetzung ist noch nicht bestätigt und wartet drauf!</source>
        <译文 xml:lang="en-GB">此翻译尚未验证并等待。"此翻译尚未验证并等待。(在某些格式中,我们也导出此状态)</译文>
      </trans-unit>
    </body>
  </file>
</xliff>
这篇文章有帮助吗?

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.