Setting up a TYPO3 page as multilingual page - typo3

I've got a TYPO3 page which is only in german. Now I want to set up the page in english as well. How can I realise this? I've read about webpage language and so on but, can't find a whole tutorial.
I'm using TYPO3 6.2.9
Thanks a lot
Update
## Localization menu:
lib.langMenu = HMENU
lib.langMenu {
special = language
special.value = 0,1,2
special.normalWhenNoLanguage = 0
1 = GMENU
1.NO {
XY = [5.w]+4, [5.h]+4
backColor = white
5 = IMAGE
5.file = EXT:cms/tslib/media/flags/flag_uk.gif || EXT:cms/tslib/media/flags/flag_de.gif
5.offset = 2,2
}
1.ACT < lib.langMenu.1.NO
1.ACT=1
1.ACT.backColor = black
1.USERDEF1 < lib.langMenu.1.NO
1.USERDEF1=1
1.USERDEF1.5.file = EXT:cms/tslib/media/flags/flag_uk.gif || EXT:cms/tslib/media/flags/flag_de.gif
1.USERDEF1.noLink = 0
1.USERDEF2 < lib.langMenu.1.USERDEF1
1.USERDEF2.backColor = green
}

Well,
in TYPO3 it is really easy to set up an other Language
All you need to do ist:
Create on your rootpage (the world) a new lanuguage
Then add in your Setup on the rootpage the following (for example french)
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = fr
config.locale_all = fr_FR
[global]
Then translate your first page.
You can access the page with this link.
Hope it helps.

Related

Typo3 CMS 8.7.15 // restrict search results to current language

I'm using the TYPO3 version TYPO3 CMS 8.7.15. with a multilanguage setup. Everything works fine. German is the default language. The other configured languages are english, portugeese and chinese. The problem is when I try to search keywords in different languages than the current language, i get results from the other translations. I want to ask for the right settings to display only search results in the current language from the current content.
config {
linkVars = L
uniqueLinkVars = 1
sys_language_mode = content_fallback
sys_language_overlay = 1
sys_language_uid = 0
locale_all = de_DE.UTF-8
htmlTag_langKey = de
language = de
}
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 0
# SPRACHE: ENGLISCH
[globalVar = GP:L=6]
config {
sys_language_uid = 6
language = en
locale_all = en_GB.UTF-8
htmlTag_setParams = en
}
pugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 6
[global]
# SPRACHE: PORTUGIESISCH
[globalVar = GP:L=7]
config {
sys_language_uid = 7
language = pt
locale_all = pt_PT.UTF-8
htmlTag_setParams = pt
}
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 7
[global]
# SPRACHE: CHINESISCH (EINFACH)
[globalVar = GP:L=8]
config {
sys_language_uid = 8
language = zh
locale_all = zh_CN.UTF-8
htmlTag_setParams = zh
}
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 8
[global]
The only way to configure it right is the plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang variable. But this has no effect to my search results. What is wrong with my configuration?
If you put your search field into your menu for example (fluidtemplate) the <f:form.hidden name="search[languageUid]"is not filled. So the results shows all languages.
I helped myself by using a lib that gives me the current language.
Fluid:
<f:form.hidden name="search[languageUid]" value="{f:cObject(typoscriptObjectPath: 'lib.language')}" />
Typoscript Setup:
# German language
temp.language = TEXT
temp.language.value = 0
# English language
[globalVar = GP:L = 1]
temp.language.value = 1
[global]
lib.language < temp.language

In TYPO3, using RealURL, how do translated URLs work

I have added an HMENU of type language, and some translations, and I can click the menu buttons to see the translations. However, there are a few things which are broken, and I'd like to get a more fundamental understanding.
The first thing which is strange: in the language menu the HREF for untranslated pages looks like e.g. /en/my-page, whereas the HREF for translated pages looks like /my-page?L=1. Wbat's going on here? I've put in the preVars section described in https://github.com/dmitryd/typo3-realurl/wiki/Notes-for-Integrators#configuring-languages. I would prefer it if the user never had to see the ?L=x query string parameter.
Edit: I have fixed this first issue by correcting my domain record from https://www.my.domain.com to www.my.domain.com, then clearing out the realurl database tables.
My second problem is my other normal HMENUs. The text in these is getting translated correctly, but the links are not - you end up going back to the default language every time you navigate.
Any help much appreciated.
I have tried all of the following:
'Clear all cache' button
'Clear PHP opcode cache' button
rm -rf /var/www/typo3temp/*
Delete contents of all the tx_realurl tables in the database
My TypoScript:
config.doctype = html5
config.absRefPrefix = /
config.tx_realurl_enable = 1
## config.sys_language_overlay = 1 # I don't actually know what this does!
config.linkVars = L(0-9) # Make the language link variables work.
## Defaults
config.language = en
config.locale_all = en_GB.utf8
config.htmlTag_langKey = en-GB.utf8
config.sys_language_uid = 0
[globalVar = GP:L = 1]
config.language = da
config.locale_all = da_DA.utf8
config.htmlTag_langKey = da-DA.utf8
config.sys_language_uid = 1
[globalVar = GP:L = 2]
config.language = de
config.locale_all = de_DE.utf8
config.htmlTag_langKey = de-DE.utf8
config.sys_language_uid = 2
## There's no 3
[globalVar = GP:L = 4]
config.language = es
config.locale_all = es_ES.utf8
config.htmlTag_langKey = es-ES.utf8
config.sys_language_uid = 4
## There's no 5
[globalVar = GP:L = 6]
config.language = lv
config.locale_all = lv_LV.utf8
config.htmlTag_langKey = lv-LV.utf8
config.sys_language_uid = 6
[globalVar = GP:L = 7]
config.language = ro
config.locale_all = ro_RO.utf8
config.htmlTag_langKey = ro-RO.utf8
config.sys_language_uid = 7
[globalVar = GP:L = 8]
config.language = pl
config.locale_all = pl_PL.utf8
config.htmlTag_langKey = pl-PL.utf8
config.sys_language_uid = 8
[globalVar = GP:L = 9]
config.language = pt
config.locale_all = pt_PT.utf8
config.htmlTag_langKey = pt-PT.utf8
config.sys_language_uid = 9
[END]
## Language Menu
lib.language_menu = HMENU
lib.language_menu {
special = language
special.value = 0,1,2,4,6,7,8,9
1 = TMENU
1 {
wrap = <ul class="language-menu">|</ul>
noBlur = 1
NO = 1
NO {
linkWrap = <li>|</li>
stdWrap.override = En || Da || De || Es || Lv || Ro || Pl || Pt
}
ACT < .NO
ACT {
linkWrap = <li class="active">|</li>
}
# NO + Translation doesn't exist
USERDEF1 < .NO
# USERDEF1.doNotLinkIt = 1
# ACT + Translation doesn't exist
USERDEF2 < .ACT
# USERDEF2.doNotLinkIt = 1
}
}
You need to set config.linkVars to keep the language GET parameter in all links: https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#linkvars
Example (if you only have two languages):
config.linkVars = L(0-1)
if realUrl does not render links like
/<lng>/mypage.html and only mypage.html?L=<2>
check the path to your realurl config file, /see extension manager -> real Url -> setings where realurl is looking for it
check settings in extension manager realurl : is autoconfig enabled ?
check the domain settings records (sometimes rearl needs a domain
record set)
check if the page with documentroot has the setting is document Root (helps realurl to generate a working realUrl autoconfig.
if you start from scratch with realurl, removing the autogenerated realurl config file, disable the extension and enablerealurl again sometimes helps after fixing bugs.

Typo3 backend not multilanguest

In typoscript I have setup my website to support three languages. In the frontend it is working fine but in the backend i'm missing the dropdown selection for "languages"? Only "Columns" and "Quickedit" are visible. How can i enable the "languages" selection in the BE?
I used this typoscript to set it up:
page.config.linkVars = L
page.config.uniqueLinkVars = 1
page.config.sys_language_overlay = content_fallback
page.config.language = nl
page.config.locale_all = nl_NL
page.config.htmlTag_langKey = nl-NL
page.config.sys_language_uid = 0
[browser = msie]
page.config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xmlns:v=”urn:schemas-microsoft-com:vml” xml:lang="nl"
[globalVar = GP:L = 1]
page.config.language = en
page.config.locale_all = en_EN
page.config.htmlTag_langKey = en-EN
page.config.sys_language_uid = 1
[globalVar = GP:L = 1] && [browser = msie]
page.config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xmlns:v=”urn:schemas-microsoft-com:vml” xml:lang="en"
[globalVar = GP:L = 2]
page.config.language = de
page.config.locale_all = de_DE
page.config.htmlTag_langKey = de-DE
page.config.sys_language_uid = 2
[globalVar = GP:L = 2] && [browser = msie]
page.config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xmlns:v=”urn:schemas-microsoft-com:vml” xml:lang="de"
In Order to be able to translate content in the backend into e.g. english you need to
Go to your Root page (ID=0), select the list module and create a
'Website Language' Record 'english'.
Go to the page you want to translate and create a record called
'Alternative Page Language'. Choose 'english' as Language.
You should now see a translation option in the discribed dropdown.
Repeat for as many pages and languages as you need.
Edit: You can see how this is done in this (german) video: http://www.youtube.com/watch?v=62ZuTYRKq5U

Language Switcher TYPO3

I'm trying to create a language switch with personal images that makes possible to change the website language in the frontend (I already defined the languages and the alternative language pages). I'm using a snippet from TYPO3 Core Documentation, but it's not working for me, so I must be doing something wrong...I added a marker in my template called LANGUAGE, which corresponds to a DIV in the top right corner of the main container, where would appear some representative flags of the languages available for that page.
Here it is my TS code in the Template:
config.linkVars = L , type
config.sys_language_uid = 0
config.language = en
config.locale_all = en_EN
[globalVar = GP:L =0]
config.sys_language_uid = 0
config.language = en
config.locale_all = en_EN
config.htmlTag_langKey = en
[global]
[globalVar = GP:L =1]
config.sys_language_uid = 1
config.language = pt
config.locale_all = pt_PT
config.htmlTag_langKey = pt
[global]
[globalVar = GP:L =2]
config.sys_language_uid = 2
config.language = fr
config.locale_all = fr_FR
config.htmlTag_langKey = fr
[global]
[globalVar = GP:L =3]
config.sys_language_uid = 3
config.language = de
config.locale_all = de_DE
config.htmlTag_langKey = de
[global]
page.10.marks.LANGUAGE {
lib.langMenu = HMENU
lib.langMenu {
special = language
special.value = 0,1,2,3
special.normalWhenNoLanguage = 0
1 = GMENU
1.NO {
XY = [5.w]+4, [5.h]+4
backColor = white
5 = IMAGE
5.file = fileadmin/Template/images/english.png || fileadmin/Template/images/portuguese.png || fileadmin/Template/images/french.png || fileadmin/Template/images/german.png
5.offset = 2,2
}
}
}
Yes, this can't work because you're defining a lib element inside a mark. You must nest your code differently:
lib.langMenu = HMENU
lib.langMenu {
[all your stuff from the lang menu]
}
and then
page.10.marks.LANGUAGE < lib.langMenu
By the way, if you also define the states USERDEF1 and USERDEF2 and use doNotShowLink = 1, then the link to a language isn't rendered if the page is not available in this language. This can be very helpful when not all your content is translated and you don't want to use fallback:
USERDEF1 = 1
USERDEF1.doNotShowLink = 1
USERDEF2 < .USERDEF1

Setting sys_language_overlay = hideNonTranslated hides translated content elements on root page (inversed behaviour)

I've setup a multilanguage (german [default], english, japanese) TYPO3 project with Templavoila and want to hide non translated content elements. Therefore I defined sys_language_overlay = hideNonTranslated. Generally this does work well but has an unexpected side effect on the root/homepage. If the overlay mode it set to hideNonTranslated no content will show up on the homepage at all while non translated content is hidden on all subpages as expected.
Below is my typoscript showing the language setup.
config{
sys_language_overlay = hideNonTranslated
sys_language_mode = strict
linkVars = L
uniqueLinkVars = 1
tx_cooluri_enable = 1
redirectOldLinksToNew = 1
}
// ger
[globalVar = GP:L = 0]
config{
sys_language_uid = 0
language = de
locale_all = de_DE.UTF-8
htmlTag_langKey = de-DE.utf8
}
[global]
// en
[globalVar = GP:L = 1]
config{
sys_language_uid = 1
language = en
locale_all = en_US.UTF-8
htmlTag_langKey = en-US.utf8
}
[global]
// jp
[globalVar = GP:L = 2]
config{
sys_language_uid = 2
language = jp
locale_all = jp_JP.utf8
htmlTag_langKey = jp-JP.utf8
}
[global]
How could I track down what causes that issue. What do I have to change in order to get the expected behaviour?
I really can't tell what's wrong with my setup. So any input is highly appreciated.
So I found the "issue".
It was caused by a small difference in the page layout on the homepage in comparison to subpages. The homepage uses additional flexible content elements provided by Templavoila. These have to be configured to appear in all languages by setting the language field inside the fce to [All] instead of Default.