kleisli / traduki
该软件包最新版本(1.1.3)没有可用的许可证信息。
导出/导入 Neos CMS 和 Flow 应用程序中节点的翻译、xliff 文件和实体
1.1.3
2024-05-02 09:38 UTC
Requires
- ext-dom: *
- ext-xmlreader: *
- ext-xmlwriter: *
- kleisli/milly-tools: @dev
- neos/flow: *
README
导出/导入 Neos CMS 和 Flow 应用程序中节点的翻译、xliff 文件和实体
配置设置
sourceLanguage
所有翻译所基于的默认语言export.directory
所有导出都写入的目录,默认: 'Data/Traduki/Export/'export.workspace
从中读取节点的作业空间,默认: 'live'export.documentTypeFilterPresets
导出文档节点的过滤选项,默认: 'Neos.Neos:Document'export.contentTypeFilterPresets
导出内容节点的过滤选项,默认: '!Neos.Neos:Document'import.directory
所有导入都将从中读取的目录,默认: 'Data/Traduki/Import/'
导出/导入
对于每种类型都有一个命令控制器,具有导出和导入操作。
翻译字符串将导出到自定义 XML 结构(用于节点)或 xliff 文件(用于 Xliff 和实体),可以发送给翻译机构进行翻译,然后可以导入翻译后的字符串。
翻译节点
与基于此的 Flownative.Neos.Trados 相比,此导出具有嵌套的内容节点,它尊重在文档中出现的结构和顺序。为了有上下文,这使得翻译人员更容易翻译内容。
nodes:export
USAGE:
./flow nodes:export [<options>] <starting point>
ARGUMENTS:
--starting-point The node with which to start the export: as identifier
or the path relative to the site node.
OPTIONS:
--source-language overwrite the default source language to use as base for
the export.
--target-language The target language for the translation
--filename Path and filename to the XML file to create. default
will be generated from the starting point node label
--modified-after export only nodes modified after this date
--ignore-hidden do not export hidden nodes, default: true
--document-filter preset key of the document type filter, default: default
--content-filter preset key of the content type filter, default: default
DESCRIPTION:
This command exports a specific node tree including all content into an XML format.
To filter Document or Content nodeTypes to be exported, use the settings
- Kleisli.Traduki.export.documentTypeFilterPreset
- Kleisli.Traduki.export.contentTypeFilterPreset
and add your own filter presets
跳过翻译节点属性
默认情况下,所有类型为 string
的节点属性都将包含在导出中。要跳过某些属性,可以在节点类型选项中定义它们。例如。
'Neos.Neos:Document':
options:
Kleisli:
Traduki:
properties:
twitterCardType:
skip: true
nodes:import
USAGE:
./flow nodes:import [<options>] <filename>
ARGUMENTS:
--filename Path and filename to the XML file to import.
OPTIONS:
--target-language The target language for the translation, optional if
included in XML.
--workspace A workspace to import into, optional but recommended
DESCRIPTION:
This command imports translated content from XML.
翻译 Xliff
xliff:export
更新并将一个软件包中所有 xliff 文件合并到一个文件中
USAGE:
./flow xliff:export <target language> <package key>
ARGUMENTS:
--target-language The target language code for the translation. e.g. fr
--package-key e.g. Vendor.Package
DESCRIPTION:
The source language is taken from the setting Kleisli.Traduki.sourceLanguage
xliff:import
拆分并导入一个软件包中合并的 xliff 文件
USAGE:
./flow xliff:import [<options>]
OPTIONS:
--sub-folder-path restrict importing to a subfolder path within the
Xliff-Import directory
--file-name-suffix e.g. "Vendor.Package.xlf", default value is ".xlf
DESCRIPTION:
By default, all the files in the folder "Xliff" in the configured import directory are imported.
This can be restricted to a single targetLanguage and package
xliff:update
在目标语言中创建新文件并更新已存在的 xliff 文件以跟踪更改的源语言标签
USAGE:
./flow xliff:update [<options>]
OPTIONS:
--target-language The target language for the translation. e.g. fr
--package-key e.g. Vendor.Package
DESCRIPTION:
New translation units in the source language, are added to the target language xliff with state="new"
and translation units where the content of the source language changed are attributed with state="needs-translation"
翻译实体
entities:export
USAGE:
./flow entities:export <target language> <model class>
ARGUMENTS:
--target-language The target language for the translation. e.g. fr
--model-class 'Vendor\Package\Domain\Model\MyModel'
DESCRIPTION:
Exports properties annotated with Gedmo\Mapping\Annotation\Translatable into a xliff file.
The default/source language is taken from the setting Kleisli.Traduki.sourceLanguage
entities:import
USAGE:
./flow entities:import [<options>]
OPTIONS:
--target-language The target language for the translation. e.g. fr
--model-class 'Vendor\Package\Domain\Model\MyModel'
DESCRIPTION:
Imports properties annotated with Gedmo\Mapping\Annotation\Translatable from a translated
xliff file, that was previously exported by entities:export.
By default, all the files in the subfolder "Entities" in the import directory are imported. This
can be restricted to a single targetLanguage and Model
感谢
节点导出器和导入器基于 Flownative.Neos.Trados。最初我计划为此软件包提交一个 PR,但当我意识到它将需要进行大规模重写时,我决定将其作为新的软件包发布,并扩展它以处理 xliff 和实体。
该软件包的开发得到了 Profolio 的显著资助——一个职业选择和职业咨询的数字平台。