| LOCALE::PO4A::ASCIIDOC.3PM(1) | User Contributed Perl Documentation | LOCALE::PO4A::ASCIIDOC.3PM(1) |
名称¶
Locale::Po4a::AsciiDoc - 从/到 PO 文件转换 AsciiDoc 文档
描述¶
Po4a (PO For Anything) 项目的目标是在文档等不需要翻译的领域使用 gettext 工具简化翻译(更有趣的是,简化翻译的维护)。
Locale::Po4a::AsciiDoc 是一个帮助翻译 AsciiDoc 格式文档的模块。
此模块接受的选项¶
以下是此模块的特定选项:
- definitions
- 包含 po4a
定义的文件的名称,如
INLINE CUSTOMIZATION
部分中定义。
如果无法将定义放在要翻译的文档中,可以使用此选项。
在定义文件中,行不能以两个斜杠开始,而直接由 po4a: 开始。
- entry
- 要转换的属性条目的空格分隔列表。默认情况下,没有属性条目是可翻译的。
- macro
- 空格分隔的宏定义列表。
- style
- 以空格分隔的样式定义列表。
- forcewrap
- 启用非逐字块中的自动行换行,即使结果可能被
AsciiDoc 格式器误解。
默认情况下,po4a 不会对生成的 AsciiDoc 文件进行封装,因为强制执行手动检查以确保封装不会更改格式。例如,请考虑以下列表项:
* a long sentence that is ending with a number 1. A second sentence.如果换行指向以下演示文稿,则该项目将被拆分到一个带编号的子列表中。更糟糕的是,只有使用翻译语言的人才能检查情况。
* a long sentence that is ending with a number 1. A second sentence.请注意,不封装 po4a 生成的文件应该不是问题,因为这些文件是自动处理的。它们无论如何都不应该被视为源文件。
With this option, po4a will produce better-looking AsciiDoc files, but it may lead to possibly erroneous formatted outputs.
- noimagetargets
- 默认情况下,块图像的目标是可翻译的,以提供使内容指向已翻译图像的机会。可以通过设置此选项来停止此操作。
- tablecells
- 此选项是启用子表分割为单元格内容的标志。分割仅限于单元格内容,其中没有任何解析。
- compat
- 将解析规则切换为与不同工具兼容。可用选项为 "asciidoc" 或 "asciidoctor"。Asciidoctor 有更严格的解析规则,例如打开和关闭块围栏的长度相等。
- nolinting
- 禁用发送邮件。当无法修复源代码以使文档结构更清晰时,这些消息将毫无用处。
- cleanspaces
- Remove extra spaces from the source segments in no-wrap mode. This is useful when the translation tools are sensitive to the number of spaces.
- yfm_keys
- 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_skip_array
- 不要转换 YAML Front Matter 部分中的数组值。
- 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.
在线定制¶
AsciiDoc 模块可自定义由 //po4a:。 这些行被解释为解析器的命令。 识别以下命令:
- //po4a: macro name[attribute list]
- 这详细描述 macro
的参数;name
必须是有效的宏名称,如果必须翻译目标,则以下划线结束。
attribute list 参数是一个逗号分隔的列表,其中包含有关可翻译参数的信息。此列表包含用于定义位置参数的数字或命名属性。
如果 name 前面加了一个加号 (+),则宏及其参数将作为一个整体进行转换。这种情况下不需要定义属性列表,但必须有方括号。
- //po4a: style [attribute list]
- 这详细描述了必须翻译样式的哪些属性。
attribute list 参数是一个逗号分隔的列表,其中包含有关可翻译参数的信息。此列表包含用于定义位置参数的数字或命名属性。第一个属性是样式名称,它不会被翻译。
如果样式名称前面有加号 (+),则属性列表将作为整体进行转换。不需要定义可翻译属性。
如果样式名称前面有减号 (-),则不会转换此属性。
If a percent signe (%) is appended to the style name, then the style is processed as verbatim. The lines in paragraph or block of such style are preserved in the po files and the corresponding entries are marked as no-wrap.
- //po4a: entry name
- 这将属性条目声明为可翻译。默认情况下,它们不会被翻译。
此模块的状态¶
在简单的 AsciiDoc 文件上测试成功。
作者¶
Nicolas François <nicolas.francois@centraliens.net> Denis Barbier <barbier@linuxfr.org>
翻译¶
taotieren <admin@taotieren.com>
版权和许可¶
Copyright © 2005-2008 Nicolas FRANÇOIS <nicolas.francois@centraliens.net>. Copyright © 2012 Denis BARBIER <barbier@linuxfr.org>. Copyright © 2017 Martin Quinson <mquinson#debian.org>.
This program is free software; you may redistribute it and/or modify it under the terms of GPL v2.0 or later (see the COPYING file).
| 2025-09-14 | perl v5.40.1 |