We need tables with localization and language overlay.
The extension tt_news is a good example:
tt_news is a localized table with the fields:
Illustration 2: The table tt_news in phpMyAdmin with localization fields.
Extend your TYPO3 installation with languages.
Illustration 4: TYPO3 installation with two language records.
In our example above we have
a default language (there is no record in the table "Website Language"). The default is German and has the uid 0.
Englisch (uid 1) and
Französisch (uid 2)
Create a page and add the plugin Browser. Translate the page to English and French.
You need a translated page, if you want to display Browser results in a non default language.
You need a translated plugin Browser only, if you like to use a different header in a non default language.
Illustration 5: The page "Nachrichten" is translated into English and French. Every translated page contains the Browser plugin.
The starting point of the plugin Browser is the folder with your news.
The sysfolder with your records (in this case: news) has to be translated too. Otherwise you can't store a record in another language than the default language.
Illustration 6: The sysfolder "Nachrichten" is translated into English and French.
The illustration below displays a localized local table: tt_news has translated records.
Illustration 7: Sysfolder with the records in the list view.
The content of your sysfolder should be look like the illustration above.
The alternative page language records.
The first news is translated into English but not into French.
You can translate (localize) the news into French by clicking the French icon.
The second news isn't translated in any language.
The illustration below displays the foreign table with a language overload field: tt_news_cat has translated categories.
Illustration 8: Sysfolder with the categories in the list view.
Please note:
The Browser enables language overlay phrases with a language prefix like
en:Lead Story|fr:Accroche
This is an enhancement of the common language overlay phrases without an language prefix.
If you like to use the common way without language prefixes please configure:
plugin.tx_browser_pi1.advanced.localization.TCA.value.langPrefix = 0
You find the whole TypoScript code in
res/setup.txt
You can copy it into your page template.
The page with the browser plugin needs an TypoScript template.
Include the include static template from the browser.
Configure in the field [setup] the:
language configuration
a language menu
the Browser configuration
If your are uisng more than the default language, you have to configure the behavior of each language.
config {
linkVars = L
metaCharset = UTF-8
sys_language_uid = 0
sys_language_mode = strict
sys_language_overlay = 0
language = de
locale_all = de_DE
htmlTag_langKey = de
}
[globalVar = GP:L = 1]
config {
sys_language_uid = 1
sys_language_mode = content_fallback
sys_language_overlay = 1
language = en
locale_all = en_GB
htmlTag_langKey = en
}
[global]
[globalVar = GP:L = 2]
config {
sys_language_uid = 2
sys_language_mode = strict
sys_language_overlay = hideNonTranslated
language = fr
locale_all = fr_FR
htmlTag_langKey = fr
}
[global]
The code
// If we have single view, the menu should have the record uid
temp.addParams = COA
temp.addParams {
10 = TEXT
10 { tx_browser_pi1[showUid]
dataWrap = &tx_browser_pi1[showUid]={GPvar:tx_browser_pi1|showUid}
if.isTrue.data = GPvar:tx_browser_pi1|showUid
}
}
// The language menu
temp.nav_language = HMENU
temp.nav_language {
special = language
special.value = 0,1,2
special.normalWhenNoLanguage = 1
1 = TMENU
1{
NO {
linkWrap = <span> | </span> || <span class="last"> | </span>
linkWrap = <li class="no">|</li>||<li class="no">|</li>||<li class="no last">|</li>
stdWrap.override = Deutsch || English || Französisch
additionalParams {
cObject < temp.addParams
}
}
ACT = 1
ACT {
doNotLinkIt = 1
linkWrap = <span class="act"> | </span> || <span class="act last"> | </span>
linkWrap = <li class="act">|</li>||<li class="act">|</li>||<li class="act last">|</li>
stdWrap.override = Deutsch || English || Französisch
}
wrap = <ul class="navi-ul">|</ul>
}
}
// Add the language menu to your page object
// Adapt this to your page object
page.10.subparts.navi {
10 < temp.nav_language
22 >
}
// Adapt this to your page object
// Two list views and two single views
plugin.tx_browser_pi1. views {
list.1.select = tt_news.title, tt_news_cat.title
list.1.select = tt_news.title, tt_news.image
single.1.select = tt_news.title, tt_news.author, tt_news_cat.title, tt_news.short, \ tt_news.datetime
single.1.select = tt_news.title, tt_news.bodytext, tt_news.image, tt_news.imagecaption, \ tt_news.imagealttext, tt_news.imagetitletext, tt_news_cat.title
marker.my_title {
value = My News List
lang.de = Meine Nachrichten Liste
lang.fr = Nouvelles Tableau
wrap = <h2>|</h2>
}
}
Illustration 9: Page "Nachrichten" in the Backend.
Page
The page "Nachrichten" with
three Browser plugins,
two alternative page language records and
the template.
We call the template in the syntax:
type_page-name_template-uid
example: +page_nachrichten_382
Template with Setup
Illustration 10: Template with the code in the setup field.
Illustration 11: Include static template from the Browser.
We have different results in the frontend - depending on the language configuration.
Illustration 12: List View in German | Illustration 13: List View in Englisch | Illustration 14: List View in French | |
German (default language) All records are in German. | English Records are displayed, which are translated into English. If they aren't translated, they are displayed in the default language German. | French Records are displayed only, if they are translated into French. | |
TypoScript config { sys_language_uid = 0 sys_language_mode = strict sys_language_overlay = 0 language = de locale_all = de_DE htmlTag_langKey = de } | TypoScript config { sys_language_uid = 1 sys_language_mode = \ content_fallback sys_language_overlay = 1 language = en locale_all = en_GB htmlTag_langKey = en } | TypoScript config { sys_language_uid = 2 sys_language_mode = strict sys_language_overlay = \ hideNonTranslated language = fr locale_all = fr_FR htmlTag_langKey = fr } |
If you want to know more about
sys_language_uid
sys_language_mode
sys_language_overlay
please read the section "What's the definition off?" in the FAQ below.












