热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

流体TYPO3翻译页面模板中的文本-FluidTYPO3TranslateTextinPageTemplate

IworkwithTYPO36.2.12andthelatestFluidTYPO3-Extensions.IalsohaveaMultilanguage-Website(

I work with TYPO3 6.2.12 and the latest FluidTYPO3-Extensions. I also have a Multilanguage-Website (german/english).

我使用TYPO3 6.2.12和最新的FluidTYPO3-Extensions。我还有一个多语言网站(德语/英语)。

At my Page-Template Subpage.html I need a headline in english (mydomain.de/en/page.html) and also in german (mydomain.de/de/seite.html). But I don't know why?!

在我的Page-Template Subpage.html中,我需要一个英文标题(mydomain.de/en/page.html)和德语(mydomain.de/de/seite.html)。但我不知道为什么?!

Manufacturers

and for the german users ...

对于德国用户......

Hersteller

I've made it with the file locallang.xlf and de.locallang.xlf (s. below and thanks to jost answer 1). But how's the syntax for my template?

我用文件locallang.xlf和de.locallang.xlf(s。在下面,并且由于jost answer 1)制作了它。但是我的模板的语法怎么样?

My tries doesn't work .. cleared caches?!

我的尝试不起作用..清除缓存?!

or

 

Need a bit of help to show the Text from locallang.xlfat my template. Thanks.

需要一些帮助来显示locallang.xlfat我的模板中的Text。谢谢。

2 个解决方案

#1


The xliff format is described here.

这里描述了xliff格式。

You need to have one file for the default labels, e.g. locallang.xlf. Then you add another file for each translation, with the language code prepended to the file name of the file with the default labels. In the example it could be de.locallang.xlf. This file has to be in the same folder the locallang.xlf is located.

您需要为默认标签设置一个文件,例如locallang.xlf。然后为每个翻译添加另一个文件,语言代码前置于具有默认标签的文件的文件名。在示例中,它可以是de.locallang.xlf。此文件必须位于locallang.xlf所在的文件夹中。

This file is a copy of the file with the default labels, but with some additions:

此文件是具有默认标签的文件的副本,但增加了一些内容:

  1. The tag gets an additional attribute target-language with the language code of the translation as value.
  2. 标记获取另一个属性目标语言,其中转换的语言代码为值。

  3. Each -tag gets a tag as sibling, containing the translation of the label.
  4. 每个 -tag都会获得一个 标记作为兄弟,包含标签的翻译。

Make sure you clear the caches (in the install tool) after changing translations, so you can see the changes.

确保在更改翻译后清除缓存(在安装工具中),以便您可以查看更改。

A translation program for XLIFF is virtaal, works quite well for me.

XLIFF的翻译程序很有用,对我来说效果很好。

In your example, you should have these two files:

在您的示例中,您应该有这两个文件:

locallang.xlf:



    
        
        
            
                Manufacturer
            
        
    

de.locallang.xlf:



    
        
        
            
                Manufacturer
                Hersteller
            
        
    

#2


Got it.

My default Language is "german", the second language is "english"

我的默认语言是“德语”,第二语言是“英语”

locallang.xlf



    
        
        

            
                Hersteller
            

        
    

en.locallang.xlf



    
        
        

            
                Hersteller
                Manufacturer
            

        
    

And at my fluid-template

在我的流体模板上

Perfect! Thanks to Jost. I only had time for one night sleep over it...

完善!感谢Jost。我只有一个晚上睡觉的时间......


推荐阅读
  • 本文将介绍如何编写一些有趣的VBScript脚本,这些脚本可以在朋友之间进行无害的恶作剧。通过简单的代码示例,帮助您了解VBScript的基本语法和功能。 ... [详细]
  • 本文详细介绍了Java编程语言中的核心概念和常见面试问题,包括集合类、数据结构、线程处理、Java虚拟机(JVM)、HTTP协议以及Git操作等方面的内容。通过深入分析每个主题,帮助读者更好地理解Java的关键特性和最佳实践。 ... [详细]
  • UNP 第9章:主机名与地址转换
    本章探讨了用于在主机名和数值地址之间进行转换的函数,如gethostbyname和gethostbyaddr。此外,还介绍了getservbyname和getservbyport函数,用于在服务器名和端口号之间进行转换。 ... [详细]
  • 优化ListView性能
    本文深入探讨了如何通过多种技术手段优化ListView的性能,包括视图复用、ViewHolder模式、分批加载数据、图片优化及内存管理等。这些方法能够显著提升应用的响应速度和用户体验。 ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 本文详细介绍了如何构建一个高效的UI管理系统,集中处理UI页面的打开、关闭、层级管理和页面跳转等问题。通过UIManager统一管理外部切换逻辑,实现功能逻辑分散化和代码复用,支持多人协作开发。 ... [详细]
  • RecyclerView初步学习(一)
    RecyclerView初步学习(一)ReCyclerView提供了一种插件式的编程模式,除了提供ViewHolder缓存模式,还可以自定义动画,分割符,布局样式,相比于传统的ListVi ... [详细]
  • 从 .NET 转 Java 的自学之路:IO 流基础篇
    本文详细介绍了 Java 中的 IO 流,包括字节流和字符流的基本概念及其操作方式。探讨了如何处理不同类型的文件数据,并结合编码机制确保字符数据的正确读写。同时,文中还涵盖了装饰设计模式的应用,以及多种常见的 IO 操作实例。 ... [详细]
  • 本文介绍如何使用阿里云的fastjson库解析包含时间戳、IP地址和参数等信息的JSON格式文本,并进行数据处理和保存。 ... [详细]
  • ASP.NET MVC中Area机制的实现与优化
    本文探讨了在ASP.NET MVC框架中,如何通过Area机制有效地组织和管理大规模应用程序的不同功能模块。通过合理的文件夹结构和命名规则,开发人员可以更高效地管理和扩展项目。 ... [详细]
  • 实体映射最强工具类:MapStruct真香 ... [详细]
  • 基于KVM的SRIOV直通配置及性能测试
    SRIOV介绍、VF直通配置,以及包转发率性能测试小慢哥的原创文章,欢迎转载目录?1.SRIOV介绍?2.环境说明?3.开启SRIOV?4.生成VF?5.VF ... [详细]
  • 本文探讨了领域驱动设计(DDD)的核心概念、应用场景及其实现方式,详细介绍了其在企业级软件开发中的优势和挑战。通过对比事务脚本与领域模型,展示了DDD如何提升系统的可维护性和扩展性。 ... [详细]
  • 探讨如何真正掌握Java EE,包括所需技能、工具和实践经验。资深软件教学总监李刚分享了对毕业生简历中常见问题的看法,并提供了详尽的标准。 ... [详细]
  • 优化局域网SSH连接延迟问题的解决方案
    本文介绍了解决局域网内SSH连接到服务器时出现长时间等待问题的方法。通过调整配置和优化网络设置,可以显著缩短SSH连接的时间。 ... [详细]
author-avatar
肥zi斌_343
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有