TYPO3 9.5.8的ckeditor中用于文件链接的已翻译titleText似乎不适用于我

时间:2019-07-17 10:26:12

标签: ckeditor typo3-9.x

我们正在使用TYPO3 9.5.8建立4种语言的新网站,客户希望获得文件和外部链接的自动标题。当然,这些也需要翻译。基本(标准)语言为德语,并提供英语,法语和意大利语翻译。

我到目前为止的工作:

  • EXT:my_extension / Resources / Private / Language中的语言文件(此处的翻译在后端和前端均可正常工作
  • 我自己的rte_config.yaml也可以正常使用,包括classesAnchor,它可以为ckeditor中的链接设置默认类
  • 只有不正确的工作是titleText的翻译。

从以前的TYPO3版本中,我知道我必须通过rte_config.yaml或page_ts_config中的classesAnchor进行设置。

它还说,titleText可以用语言分割。

TYPO3 Documentation for Version 7中,我找不到最近的解释:

  

.titleText =将类应用于锚点时将用作锚点标题的文本;可能是语言分割的;也可以使用TYPO3语法LLL:EXT:extension-key / sub-directory / locallang.xlf:label-index以便使用指定的语言将文本本地化为内容的语言文件和标签索引

所以我在rte_config.yaml中尝试过:

# Load default processing options
imports:
    - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
    - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
    - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }


# lots more config and styling stuff, I will spare you

buttons:
  link:
    properties:
      class:
        allowedClasses: 'extern,download'
    file:
      properties:
        class:
          default: 'download'
    url:
      properties:
        class:
          default: 'extern'

classes:
  extern:
    name: 'Externer Link'
  download:
    name: 'Download Link'

classesAnchor:
  extern:
    class: 'extern'
    type: 'url'
    titleText: 'my_extension/Resources/Private/Language/locallang.xlf:RTE.link-extern'
  download:
    class: 'download'
    type: 'file'
    titleText: 'LLL:EXT:my_extension/Resources/Private/Language/locallang.xlf:RTE.link-download'

locallang.xlf:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
    <file source-language="en" datatype="plaintext" original="messages" product-name="my_extension">
        <header/>
        <body>
            <trans-unit id="RTE.link-extern">
                <source>External Link</source>
            </trans-unit>
        </body>
    </file>
</xliff>

de.locallang.xlf:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
    <file source-language="en" target-language="de" datatype="plaintext" original="messages" product-name="my_extension">
      <header/>
        <body>
            <trans-unit id="RTE.link-extern">
                <target>Externer Link</target>
            </trans-unit>
        </body>
    </file>
</xliff>

它确实从xlf文件中获取文本,但是无论内容元素在后端以哪种语言显示,它都只能以英语显示。

我在这里想念什么?还是这真的是一个核心错误?

在旁注:这是我的第一个问题,因此请指出,如果下次我可以做得更好,或者缺少某些信息

0 个答案:

没有答案