流利:一种用于自然流畅翻译的本地化系统
Fluent: A Localization System for Natural-Sounding Translations

原始链接: https://projectfluent.org/

Fluent 使用简单的文本字符串和标识符来表示消息,例如 “tabs-close-button” = “Close”。然而,翻译有时需要逻辑,特别是对于复数形式。Fluent 支持使用 Unicode 定义的类别,如 “[one]” 和 “[other]”,根据变量(如 `$tabCount`)调整消息。 如果没有逻辑需求,消息仍然保持简单直接。Fluent 还使用“术语”——以破折号开头的消息(例如 `-sync-brand-name`)——这些术语不直接显示,而是被其他消息引用,以确保一致性并强制执行风格。 术语是可重用的,简化了更新,并允许在不同的构建或发布渠道中轻松修改品牌。这个系统在简洁性和满足细微和一致本地化的灵活性之间取得了平衡。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Fluent: 一种用于自然流畅翻译的本地化系统 (projectfluent.org) 4 分,来自 stefankuehnel 2 小时前 | 隐藏 | 过去 | 收藏 | 讨论 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

In Fluent, most messages are simple text strings identified by an identifier. In the first message in the example, tabs-close-button is the identifier and Close is the value.

Sometimes, translations require a little bit of logic to sound right in the target language. In the tabs-close-tooltip message, the correct variant of the translation depends on the value of the $tabCount variable. The names of the variants, [one] and [other], are standard names of the plural categories defined by the Unicode in CLDR.

On the other hand, when no logic is required, translations in Fluent stay simple. The tabs-close-warning message appears in Firefox when the user tries to close a window with more than one tab. The message is only displayed when the tab count is 2 or more, and so in English, the word tab will always appear as the plural tabs.

-sync-brand-name is a special kind of message in Fluent, called a term. Term identifiers always start with a dash. Terms can be referenced by other messages, but cannot be displayed directly in the app. Referencing terms is a powerful tool for ensuring consistency. Once defined, a translation can be reused in other translations.

The -sync-brand-name term can be referenced from other messages, and it will always resolve to the same value. Terms help enforce style guidelines; they can also be swapped in and out to modify the branding in unofficial builds and on beta release channels.

联系我们 contact @ memedata.com