简体   繁体   English

如何在Typo3的扩展之外使用XLIFF

[英]How to use XLIFF outside an extension in Typo3

I am in need of localizing some strings for my website. 我需要为我的网站本地化一些字符串。 I have all the necessary files in the fileadmin folder (I am not developing an extension). 我在fileadmin文件夹中具有所有必需的文件(我没有开发扩展名)。 I managed to localize inside my Fluid template using locallang.xml like this 我设法使用locallang.xml在我的Fluid模板中进行了本地化

<f:translate id="LLL:fileadmin/Resources/Private/Language/locallang.xml:hide-menu" />

with all the languages inside one file. 所有语言都放在一个文件中。 I did not manage to make it work simply by 我没有设法使它简单地通过

<f:translate id="hide-menu" />

Now I want to migrate to the newer way of XLIFF. 现在,我想迁移到XLIFF的新方法。 The location remains the same, the resource files are 位置保持不变,资源文件是

locallang.xlf
cs.locallang.xlf

When used in Fluid like this 当在这样的流体中使用时

<f:translate id="LLL:fileadmin/Resources/Private/Language/locallang.xlf:hide-menu" />

it only uses the default (explicitly named) file and not the translated one. 它仅使用默认(明确命名)文件,而不使用已翻译的文件。 Where am I supposed to put the files and how am I supposed to use them in a Fluid template, preferably using only the id, not the whole path? 我应该在哪里放置文件,以及如何在Fluid模板中使用它们,最好只使用id,而不要使用整个路径?

I recommend to move your templates and locallang files (and TS and all the basic stuff) to an extension. 我建议将模板和locallang文件(以及TS和所有基本内容)移至扩展名。 There is currently an unresolved (status under review) bug, regarding your problem. 关于您的问题,当前存在一个未解决(正在审查的状态)错误。 You can read more here and here . 您可以在这里这里阅读更多内容。 So if you dont have good reason to keep everything in fileadmin, going to an extension is my advice, since its considered to be better practice anyway. 因此,如果您没有充分的理由将所有内容保留在fileadmin中,那么我建议您使用扩展名,因为无论如何,它都被认为是更好的做法。

If you have to keep everything in fileadmin switch back to xml until the issue is fixed, wich hopefully will be the case in 6.2 ... 如果您必须将所有内容保留在fileadmin中,请切换回xml,直到问题解决为止,希望6.2中的情况如此...

I'm sorry to cant be of better help. 很抱歉无法提供更好的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM