sitegeist / csv-labels
使用CSV文件为TYPO3提供翻译标签
1.0.4
2024-07-15 14:00 UTC
Requires
- typo3/cms-core: ^13.1 || ^12.2 || ^11.5 || ^10.4 || ^9.5
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-15 14:15:27 UTC
README
此实用工具扩展扩展了TYPO3的语言处理功能,使其能够使用简单的CSV文件格式来指定语言标签。虽然XLIFF文件格式是一个广泛使用的标准,功能更强大,但对于只包含少量条目的语言文件,CSV文件可以是一种实用的方法。
此扩展不会删除或禁用XLIFF文件,它只是提供了另一个可供选择的文件格式。我们在sitegeist使用CSV文件格式来定义Fluid Components的语言标签。
入门
composer require sitegeist/csv-labels
文件格式
locallang.csv
"id","description","default","de"
"Actions","","Actions","Aktionen"
"ConfirmDelete","Message in the delete user dialog","Should the following user be deleted?","Soll der folgende Nutzer gelöscht werden?"
规则
- 列
id
表示标签标识符 - 列
description
表示标签描述(用于文档目的) - 所有其他列均被视为标题行中地区语言的翻译
- csv文件使用
,
作为分隔符,使用"
作为文本分隔符(fgetcsv的默认配置fgetcsv)
使用方法
<!-- either explicitly --> <f:translate key="EXT:my_extension/Resources/Private/Language/locallang.csv:Actions" /> <!-- or as a fallback, in case the xlf file doesn't exist --> <f:translate key="EXT:my_extension/Resources/Private/Language/locallang.xlf:Actions" /> <!-- this means that it can also be used in extbase context without the full path --> <f:translate key="Actions" />
作者 & 赞助商
- Ulrich Mathes - mathes@sitegeist.de
- Simon Praetorius - moin@praetorius.me
- 所有贡献者
此软件包的开发和公共发布得到了我的雇主https://sitegeist.de的慷慨赞助。