Typo3 – 为新表单输入添加翻译不起作用

huangapple go评论74阅读模式
英文:

Typo3 - Adding translation for new form input doesn't work

问题

I had to add a new input to an existing form in typo3 V.10.4.31. Then I tried to translate the placeholder. The input is displayed in the form but the placeholder isn't translated.

Here is the formfield:

defaultValue: ''
            type: Text
            identifier: country
            label: 'Land / Country'
            properties:
              fluidAdditionalAttributes:
                placeholder: Land

The locallang.xlf:

<trans-unit id="element.country.properties.placeholder">
      <source>Country</source>
</trans-unit>

And the de.locallang.xlf:

<trans-unit id="element.country.properties.placeholder">
            <source>Country</source>
            <target>Land</target>
</trans-unit>

I'm new in typo3 and I wonder if I missed something. The other formfields are translated correctly so I thought I only have to add the translation in the existing files. I copied the code of another field and only changed the identifier and the text.

英文:

I had to add a new input to an excisting form in typo3 V.10.4.31. Then I tried to translate the placeholder. The input is displayed in the form but the placeholder isn't translated.

Here is the formfield:

defaultValue: ''
            type: Text
            identifier: country
            label: 'Land / Country'
            properties:
              fluidAdditionalAttributes:
                placeholder: Land

The locallang.xlf:

<trans-unit id="element.country.properties.placeholder">
      <source>Country</source>
</trans-unit>

And the de.locallang.xlf:

<trans-unit id="element.country.properties.placeholder">
            <source>Country</source>
            <target>Land</target>
</trans-unit>

I'm new in typo3 and I wonder if I missed something. The other formfields are translated correctly so I thought I only have add the translation in the existing files. I copied the code of an other field and only changed the identifier and the text.

答案1

得分: 0

看起来对我来说是100%,我认为你有一个缓存问题,请尝试在“维护”中清除缓存(如果你的TYPO3版本在V9以上)...我认为你的xlf文件需要加载。

英文:

looks 100% to me, I think you have a caching problem, try to clear the cache in 'maintenance' (if your TYPO3 is above V9) ... I think your xlf file needs to load

huangapple
  • 本文由 发表于 2023年6月26日 22:29:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76557648.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定