热门标签 | 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。我只有一个晚上睡觉的时间......


推荐阅读
  • 海马s5近光灯能否直接更换为H7?
    本文主要介绍了海马s5车型的近光灯是否可以直接更换为H7灯泡,并提供了完整的教程下载地址。此外,还详细讲解了DSP功能函数中的数据拷贝、数据填充和浮点数转换为定点数的相关内容。 ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • eclipse学习(第三章:ssh中的Hibernate)——11.Hibernate的缓存(2级缓存,get和load)
    本文介绍了eclipse学习中的第三章内容,主要讲解了ssh中的Hibernate的缓存,包括2级缓存和get方法、load方法的区别。文章还涉及了项目实践和相关知识点的讲解。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
  • 合并列值-合并为一列问题需求:createtabletab(Aint,Bint,Cint)inserttabselect1,2,3unionallsel ... [详细]
  • 全面介绍Windows内存管理机制及C++内存分配实例(四):内存映射文件
    本文旨在全面介绍Windows内存管理机制及C++内存分配实例中的内存映射文件。通过对内存映射文件的使用场合和与虚拟内存的区别进行解析,帮助读者更好地理解操作系统的内存管理机制。同时,本文还提供了相关章节的链接,方便读者深入学习Windows内存管理及C++内存分配实例的其他内容。 ... [详细]
  • SpringBoot uri统一权限管理的实现方法及步骤详解
    本文详细介绍了SpringBoot中实现uri统一权限管理的方法,包括表结构定义、自动统计URI并自动删除脏数据、程序启动加载等步骤。通过该方法可以提高系统的安全性,实现对系统任意接口的权限拦截验证。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 本文介绍了Android 7的学习笔记总结,包括最新的移动架构视频、大厂安卓面试真题和项目实战源码讲义。同时还分享了开源的完整内容,并提醒读者在使用FileProvider适配时要注意不同模块的AndroidManfiest.xml中配置的xml文件名必须不同,否则会出现问题。 ... [详细]
  • ALTERTABLE通过更改、添加、除去列和约束,或者通过启用或禁用约束和触发器来更改表的定义。语法ALTERTABLEtable{[ALTERCOLUMNcolu ... [详细]
  • 开发笔记:实验7的文件读写操作
    本文介绍了使用C++的ofstream和ifstream类进行文件读写操作的方法,包括创建文件、写入文件和读取文件的过程。同时还介绍了如何判断文件是否成功打开和关闭文件的方法。通过本文的学习,读者可以了解如何在C++中进行文件读写操作。 ... [详细]
  • 本文介绍了在CentOS上安装Python2.7.2的详细步骤,包括下载、解压、编译和安装等操作。同时提供了一些注意事项,以及测试安装是否成功的方法。 ... [详细]
  • This article discusses the efficiency of using char str[] and char *str and whether there is any reason to prefer one over the other. It explains the difference between the two and provides an example to illustrate their usage. ... [详细]
  • 本文介绍了OpenStack的逻辑概念以及其构成简介,包括了软件开源项目、基础设施资源管理平台、三大核心组件等内容。同时还介绍了Horizon(UI模块)等相关信息。 ... [详细]
  • 在Oracle11g以前版本中的的DataGuard物理备用数据库,可以以只读的方式打开数据库,但此时MediaRecovery利用日志进行数据同步的过 ... [详细]
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社区 版权所有