名称
Locale::Po4a::Text -
将文本文档从/转换为 PO
文件
描述
Po4a (PO For Anything)
项目的目标是在文档等不需要翻译的领域使用
gettext
工具简化翻译(更有趣的是,简化翻译的维护)。
Locale::Po4a::Text
是一个帮助将文本文档翻译成其他
[人类] 语言的模块。
段落以空行
(或仅包含空格或表格的行)
拆分。
如果段落包含以空格(或制表符)开头的行,则此段落不会重新换行。
此模块接受的选项
以下是此模块的特定选项:
- keyvalue
- 将看起来像键值对的段落逐字处理
(在 PO
文件中使用无换行标志)。键值对定义为一行包含一个或多个非冒号和非空格字符,后跟冒号,后跟至少一个非空格字符。
- nobullets
- 停用对项目符号的检测。
默认情况下,当检测到项目符号时,项目符号段落不会被视为逐字段落(PO
文件中带有无换行标志)。相反,相应的段落在翻译中重新换行。
- tabs=mode
- 指定应如何处理制表。mode
可以是以下任一项:
- breaks=regex
- 引入中断的正则表达式匹配行。
正则表达式将锚定,以便整行必须匹配。
- debianchangelog
- 处理仅包含不可翻译信息的已发布版本的页眉和页脚。
- fortunes
- 处理富文本格式,该格式用位于
'%' 或 '%%'
中的一行分隔财富,并使用
'%%' 作为注释的开头。
- markdown
- 处理 Markdown
格式文本中的一些特殊标记。
- yfm_keys
(仅限 markdown)
- Comma-separated list of keys to process for translation in the YAML Front
Matter section. All other keys are skipped. Keys are matched with a
case-sensitive match. If yfm_paths and yfm_keys are used
together, values are included if they are matched by at least one of the
options. Array values are always translated, unless the
yfm_skip_array option is provided.
- yfm_lenient
(markdown only)
- Allow the YAML Front Matter parser to fail on malformated headers. This is
particularly helpful when your file starts with a horizontal ruler instead
of a YAML Front Matter, but you insist on using three dashes only for your
ruler.
- yfm_paths
(markdown only)
- yfm_paths
- Comma-separated list of hash paths to process for extraction in the YAML
Front Matter section, all other paths are skipped. Paths are matched with
a case-sensitive match. If yfm_paths and yfm_keys are used
together, values are included if they are matched by at least one of the
options. Arrays values are always returned unless the
yfm_skip_array option is provided.
- yfm_skip_array
(仅限 markdown)
- 不要转换 YAML Front Matter
部分中的数组值。
- control[=taglist]
- 处理控制文件。可以提供要翻译的标签的逗号分隔列表。
- neverwrap
- 防止 po4a
换行。这意味着每个内容都是逐字处理的,即使是简单的段落。
此模块的状态
在简单文本文件和
NEWS.Debian
文件上测试成功。
作者
Nicolas François <nicolas.francois@centraliens.net>
版权和许可
Copyright © 2005-2008 Nicolas FRANÇOIS <nicolas.francois@centraliens.net>.
Copyright © 2008-2009, 2018 Jonas Smedegaard <dr@jones.dk>.
Copyright © 2020 Martin Quinson <mquinson#debian.org>.
此程序是自由软件;您可以根据
GPL
条款重新分发和/或修改它(请参阅复制文件)。