DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
GRiDDS Language Menu¶
Created: | 2010-02-18T17:33:18 |
---|---|
Changed by: | Tobias Blaser |
Changed: | 2013-07-16T18:41:30 |
Classification: | grds_language_menu |
Keywords: | GRiDDS, language menu, region, language, menu |
Author: | GRiDDS GmbH |
Email: | contact@gridds.com |
Info 4: | |
Language: | en |
GRiDDS Language Menu - grds_language_menu
GRiDDS Language Menu¶
Extension Key: grds_language_menu
Language: en
Keywords: GRiDDS, language menu, region, language, menu, iso, translation, language redirect
Copyright 2000-2012, GRiDDS GmbH, <contact@gridds.com>
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
- a GNU/GPL CMS/Framework available from www.typo3.org
Table of Contents¶
`Introduction 3 <#__RefHeading__11990_1177646034>`_
Not available translations for this page are shown in a different way. 4
`Users manual 5 <#__RefHeading__12000_1177646034>`_
Include GRiDDS Language Menu by Typoscript 6
Include GRiDDS Language Menu as page content plugin 6
Set the storage page id or set it by Typoscript. 7
Subtree with own Regions and Languages 7
`Administration 8 <#__RefHeading__12024_1177646034>`_
`Configuration 9 <#__RefHeading__12028_1177646034>`_
`Tutorial (installation example) 12 <#__RefHeading__12032_1177646034>`_
Page part template example (Fluid) 12
`Extend GRiDDS Language Menu 14 <#__RefHeading__3612_1594867431>`_
`Known problems 15 <#__RefHeading__12048_1177646034>`_
`To-Do list 16 <#__RefHeading__12050_1177646034>`_
`ChangeLog 16 <#__RefHeading__12052_1177646034>`_
Introduction¶
What does it do?¶
What does it do?¶
GRiDDS Language Menu allows you to create regions and relate languages to them. The plugin shows a menu in the frontend with the languages, grouped by regions.
What problems solves GRiDDS Language Menu?¶
- If you have e.g. a language “english” for worldwide and a seperate language “english” for the us market, you are able to show your users a region “USA” and a region “Worldwide” with the related english- version.
- If you have subtrees in your pagetree, you can show different regions in conclusion with different language relations in every tree.
- You can override the language abbrevation and title.
- You can map languages to any other or to the default language.
- You can redirect languages to other pages (intern) or websites (extern), e.q. To use it with multiple page trees for languages.
- GRiDDS Language Menu uses the TYPO3 website languages and involves the sys_language_mode.
Target Group¶
This Extension is usefully for websites, with languages and regions, f.e. Market regions.
Technical aspects¶
GRiDDS Language Menu is based on Extbase/Fluid. GRiDDS Language Menu maps the tables pages, pages_language_overlay, sys_language and static_languages.
GRiDDS Language Menu uses jQuery to show the menu. GRiDDS Language Menu brings jQuery with it and protects itself against conflicts with other JS frameworks. Of course, the menu will run with deactivated javascript too.
Important to know¶
- GRiDDS Language Menu doesn't have own language objects and uses the TYPO3 website language elements instead. GRiDDS Language Menu isn't an alternative to the TYPO3 languages, it's a supplement.
- The included jQuery library can disturb other extensions if they use
JS frameworks which are using the “$”. GRiDDS Language Menu uses
“jQuery” instead of “$”, so you can set
jQuery.noConflict();
to solve this problem or you can remove the scripts by Typoscript with this line:page.includeJS.jquery > // for the included jQuerypage.includeJS.languageMenuMobile > // for the included script based on jQuery
- You can remove our styles if you want to begin the menu style from
scratch:
page.includeCSS.menu >
Users manual¶
Installation¶
Install the extension, include the static TS template “GRiDDS Language Menu” to your root template.
Prepairing languages¶
Be sure, there are some website languages on your rootpage.
Create an additionaly website language for representing the default language:
This is needed, because the TYPO3 doesn't know your default language as website language.
Create Regions records¶
Change to the page where you want to create the regions. We recommend to using the page where your root template is placed or a unique sysfolder. This isn't required, alternately you can also just use a page id.
Create a new “Region” record:
Choose “Language” “All”, input the name and the abbrevation of your region. Set a flag and choose your required languages.
Save and create some other region records.
Include GRiDDS Language Menu by Typoscript¶
First, set the storage page id in the root template. This is the page, where you have created your regions.
plugin.tx\_grdslanguagemenu.persistence.storagePid = 112
Then include the plugin in your template like you do it with other plugins:
lib.language <
plugin.tx\_grdslanguagemenu.widgets.languageMenuWidget
Map default language¶
TYPO3 doesn't relate the default language with a website language. To relate the earlier created language to the default language, you have to configurate this in your TS setup:
plugin.tx\_grdslanguagemenu {settings {languageParamOverride
{L17.
lang
= 0}}}
This overrides the language parameter for the language with the id 17 with the id 0.
**Important! The Syntax changed since the version**
**2.1**
**from “**
**L17 = 0**
**” to
“**
**L17.lang = 0**
**”.**
Include GRiDDS Language Menu as page content plugin¶
Choose Plugins → GRiDDS language Menu
¶
Set the storage page id or set it by Typoscript.
¶
Don't forget to set the language visibility in the tab “Language” at the bottom (Recommended “All”).
Subtree with own Regions and Languages¶
Set on the root page of the subtree the storage page id (Recommended to the same page) and create region records on this page.
The included menu on the pages in this subtree will show you the records from the setted subtree-storage-page-id.
Administration¶
Translate the menu¶
Menu label and “page not translated” message¶
plugin.tx\_grdslanguagemenu {
\_LOCAL\_LANG {
it {
tx\_grdslanguagemenu-list.changeLanguage = Cambia la lingua
tx\_grdslanguagemenu-list.pageNotTranslated = Pagina non e
tradotto in questa lingua
}
}
Translate the languages¶
To get the same translation for every language, set only the default. To get different translations for every own language, set the locallang for every language. Please note: When e.g. a chinese user on the english page is searching his language, it's more comfortable for him, to write this in his language, as example "中国的”instead of “chinese”.
plugin.tx\_grdslanguagemenu {
\_LOCAL\_LANG {
default {
region {
ww = Whole World
}
language {
abbr {
L1 = GLOB
}
title {
L1 = Globish
}
}
}
}
}
Configuration¶
Reference¶
Typoscript Settings¶
languageParamOverride.L{id}.lang¶
Property
languageParamOverride.L{id}.lang
Data type
int
Description
Map a language to another
Syntax:
L+id.lang = id
Example:
plugin.tx\_grdslanguagemenu {
settings {
languageParamOverride {
L17.
lang
= 0
}
}
}
Maps the language with the id 17 to the language with id 0. This means, in the menu is shown the title and the abbrevation from the language 17 but the page visibility from the language 0 and the language link links to the language 0.
**Important! The Syntax changed since the version**
**2.1**
**from “**
**L17 = 0**
**” to
“**
**L17.lang = 0**
**”.**
Default
languageParamOverride.L{id}.pid¶
Property
languageParamOverride.L{id}.pid
Data type
int
Description
Redirect a language to another page. This is useful, if you have multiple pagetrees in your page with different languages.
Syntax:
L+id.pid = pid
Example:
plugin.tx\_grdslanguagemenu {
settings {
languageParamOverride {
L17.
pid
=
83
}
}
}
Redirects the user to the page 83.
Important:
This setting has no effect, if combinate it with external = 1
.
Default
languageParamOverride.L{id}.external¶
Property
languageParamOverride.L{id}.external
Data type
bool
Description
Activates the external redirecting.
Syntax:
L+id.external = 1
Example:
plugin.tx\_grdslanguagemenu {
settings {
languageParamOverride {
L17.
external
=
1
}
}
}
Important:
Use this setting only in combination with ext
Target.
Default
languageParamOverride.L{id}.extTarget¶
Property
languageParamOverride.L{id}.extTarget
Data type
url
Description
Redirect a language to an external page.
Syntax:
L+id.extTarget = www.domain.tld
Example:
plugin.tx\_grdslanguagemenu {
settings {
languageParamOverride {
L17.
extTarget
=
www.google.com
}
}
}
Important:
Use this setting only in combination with ext
ernal =
1.
Otherwise there is no effect.
Default
languageParamOverride.L{id}.target¶
Property
languageParamOverride.L{id}.target
Data type
Description
Specify how external redirects are opened in the browser.
Syntax:
L+id.target = _blank / _self / ...
Example:
plugin.tx\_grdslanguagemenu {
settings {
languageParamOverride {
L17.
target
=
\_blank
}
}
}
Opens the external redirect in a new window/tab.
Important:
Use this setting only in combination with ext
ernal =
1
and
extTarget.
Otherwise there is no
effect.
Default
useTsTranslation¶
Property
useTsTranslation
Data type
boolean
Description
Enable/disables the typoscript translation for regions and languages.
Example:
plugin.tx\_grdslanguagemenu {
settings {
useTsTranslation = 0
}
}
Default
1
pathIconArrow¶
Property
pathIconArrow
Data type
file
Description
Defines the icon on the language menu.
Example:
plugin.tx\_grdslanguagemenu {
Settings {
pathIconArrow =
EXT:grds\_language\_menu/Resources/Public/Icons/icon-triangle.png
}
}
Default
EXT:grds_language_menu/Resources/Public/Icons/icon-triangle.png
**Important:**
**When you specify not existing pageId's
or not existing languages, you will get special effects, especially in
combination with coolUri!**
**Persistence**
¶
Persistence.storagePid¶
a
Persistence.storagePid
b
c
The storage page id where the region records are stored.
Example:
plugin.tx\_grdslanguagemenu {
persistence
{
storagePid = 38
}
}
d
**Order of setting interpretation and output generation**
¶
Locallang¶
language.abbr.L{id}¶
Property
language.abbr.L{id}
language.title.L{id}
Data type
String
string
Description
Overrids the language abbrevation (from static_languages) with the given value.
Syntax:
L+id = EN
Example:
plugin.tx\_grdslanguagemenu {
\_LOCAL\_LANG {
default {
language {
abbr {
L14 = CN-SIMP
}
title {
L14 =
中国的
}
}
}
}
}
Default
region.{abbr}¶
Property
region.{abbr}
Data type
string
Description
Overrides the region name with the given. You can use this to translate the regions instead of creating records in every language.
Example:
plugin.tx\_grdslanguagemenu {
\_LOCAL\_LANG {
de {
region {
ww = Weltweit
}
}
}
}
Default
Example¶
plugin.tx_grdslanguagemenu {
settings {
languageParamOverride {
L17.lang = 0 #override language 17 with 0
L12 {pid=25 # redirect language 1 2 allways to page 25
}
L5 {external = 1 # activate external redirect extTarget = www.superlanguagemenu.com #redirect language 5 to www.superlanguagemenu.com target = _blank # open the redirect in a new window/tab
}
}
}
_LOCAL_LANG {
default {
language {
abbr {
L14 = CN-SIMP #override the chinese abbrevation “ZH” with “CN- SIMP”
}
title {
L14 =:code:中国的
#override the chinese title “
Chinese ” with “ **中国的**
**”**
}
}
}
de {
region {
ww = Weltweit #translate the region ww (“Worldwide”) to “Weltweit” (de)
}
language {
title {
L17 = Deutsch #translate the language 17 (“German”) to “Deutsch” (de)
L1 = Englisch
L2 = Französisch
L4 = Spanisch
L5 = Italienisch
L6 = Niederländisch
L7 = Schwedisch
L8 = Norwegisch
L9 = Dänisch
L10 = Finnisch
L14 = Chinesisch
L16 = Englisch
}
}
}
it {
tx_grdslanguagemenu-list.changeLanguage = Cambia la lingua
tx_grdslanguagemenu-list.pageNotTranslated = Pagina non e tradotto in questa lingua
}
}
}
Tutorial (installation example)¶
Page part template example (Fluid)¶
<divclass="page"id="page">
<divclass="header"id="header">
<!-- include cObject -->
<f:cObjecttyposcriptObjectPath="lib.header">
</div>
...
</div>
Root Template (TS)¶
lib.header = COA
lib.header.10 <
plugin.tx\_grdslanguagemenu.widgets.languageMenuWidget
plugin.tx\_grdslanguagemenu.persistence.storagePid = 1
Languages (rootpage)¶
Region records (page 1)¶
Region “Worldwide”¶
Typoscript setup¶
plugin.tx_grdslanguagemenu {
settings {
languageParamOverride {
L17.lang = 0
}
}
}
Locallang (TS)¶
plugin.tx_grdslanguagemenu {
_LOCAL_LANG {
de {
region {
ww = Weltweit
}
language {
title {
L1 = Englisch
L2 = Französisch
L4 = Spanisch
L5 = Italienisch
L6 = Niederländisch
L7 = Schwedisch
L8 = Norwegisch
L9 = Dänisch
L10 = Finnisch
L14 = Chinesisch
L16 = Englisch
L17 = Deutsch
}
}
}
it {
tx_grdslanguagemenu-list.changeLanguage = Cambia la lingua
tx_grdslanguagemenu-list.pageNotTranslated = Pagina non e tradotto in questa lingua
}
}
}
Extend GRiDDS Language Menu¶
Add simple functionality¶
The easiest way to extend the GRiDDS Language Menu with simple functionality is to write an own extension with some new ViewHelpers.Include the ViewHelpers by namespace declaration to the region-list template of the GRiDDS Language Menu extension:
{namespace myExt=Tx\_MyExt\_ViewHelper}
<myExt:newViewHelper param="..
." ...
/>
Add complexe functionality¶
If you want to add more than simple functionality, it's necessary to write an own extension and map and extend the region table with an own model.
Known problems¶
To-Do list¶
- Bug: When you include the menu twice on the same page, jQuery opens/closes both menus by clicking on one.
- Feature: Possibility, to redirect the language links of a region to another page/tree (for mixed multi-languages-singletree and single- languages-multitree concepted pages).
ChangeLog¶
1.0.0¶
Version
1.0.0
Changes
Initial Release
2.0.0¶
Version
2.0.0
Changes
Release
2.1.0¶
Version
2.1.0
Changes
Set list action cachable, add possibility to set menu arrow icon by typoscript, remove problem with constants.txt
2.3¶
Version
2.3
Changes
Change language setting 'L{id} = id' to 'L{id}.lang = id' and add possibility to redirect languages to internal pages or external websites.
18