TYPO3表单textarea组件defaultValue属性翻译问题求助
解决TYPO3表单Textarea组件defaultValue翻译失效问题
问题出在你使用的翻译ID不正确:defaultValue是Textarea元素的直接属性,并非properties下的子属性,所以不能在翻译ID里加.properties前缀。
正确的翻译配置
修改对应的trans-unit ID,移除.properties部分:
<trans-unit id="productformular.element.textarea-1.defaultValue"> <source>Hello, I am interested in this device. Please contact me as soon as possible.</source> </trans-unit>
后续验证步骤
- 保存修改后的翻译文件
- 清除TYPO3系统的所有缓存(包括翻译缓存)
- 切换到目标语言,查看Textarea的默认值是否正常显示翻译内容
补充说明
TYPO3表单翻译ID的规则是:
- 元素自身的直接属性:
[表单标识符].element.[元素标识符].[属性名] - 元素properties下的子属性:
[表单标识符].element.[元素标识符].properties.[属性名]
你的label和placeholder属于properties下的属性,所以之前的ID是正确的;而defaultValue是元素本身的属性,不需要加.properties前缀。
内容的提问来源于stack exchange,提问作者Maximilian Z.
相关产品推荐
相关产品推荐

