.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ==================== 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 |img-1| |img-2| GRiDDS Language Menu - grds\_language\_menu .. _GRiDDS-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, 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: Table of Contents ----------------- `GRiDDS Language Menu 1 <#__RefHeading__11988_1177646034>`_ **`Introduction 3 <#__RefHeading__11990_1177646034>`_** `What does it do? 3 <#__RefHeading__11992_1177646034>`_ `Screenshots 3 <#__RefHeading__11994_1177646034>`_ `3 <#__RefHeading__11996_1177646034>`_ `Not available translations for this page are shown in a different way. 4 <#__RefHeading__14692_1177646034>`_ `4 <#__RefHeading__14694_1177646034>`_ `4 <#__RefHeading__11998_1177646034>`_ **`Users manual 5 <#__RefHeading__12000_1177646034>`_** `Installation 5 <#__RefHeading__12002_1177646034>`_ `Prepairing languages 5 <#__RefHeading__12004_1177646034>`_ `Create Regions records 5 <#__RefHeading__12006_1177646034>`_ `Include GRiDDS Language Menu by Typoscript 6 <#__RefHeading__12008_1177646034>`_ `Map default language 6 <#__RefHeading__12010_1177646034>`_ `Include GRiDDS Language Menu as page content plugin 6 <#__RefHeading__12012_1177646034>`_ `7 <#__RefHeading__12014_1177646034>`_ `Set the storage page id or set it by Typoscript. 7 <#__RefHeading__12016_1177646034>`_ `7 <#__RefHeading__12018_1177646034>`_ `Don't forget to set the language visibility in the tab “Language” at the bottom (Recommended “All”). 7 <#__RefHeading__12020_1177646034>`_ `Subtree with own Regions and Languages 7 <#__RefHeading__12022_1177646034>`_ **`Administration 8 <#__RefHeading__12024_1177646034>`_** `Translate the menu 8 <#__RefHeading__12026_1177646034>`_ **`Configuration 9 <#__RefHeading__12028_1177646034>`_** `Reference 9 <#__RefHeading__12030_1177646034>`_ **`Tutorial (installation example) 12 <#__RefHeading__12032_1177646034>`_** `Page part template example (Fluid) 12 <#__RefHeading__12034_1177646034>`_ `Root Template (TS) 12 <#__RefHeading__12036_1177646034>`_ `Languages (rootpage) 12 <#__RefHeading__12038_1177646034>`_ `Region records (page 1) 12 <#__RefHeading__12040_1177646034>`_ `Region “Worldwide” 13 <#__RefHeading__12042_1177646034>`_ `Typoscript setup 13 <#__RefHeading__12044_1177646034>`_ `Locallang (TS) 13 <#__RefHeading__12046_1177646034>`_ **`Extend GRiDDS Language Menu 14 <#__RefHeading__3612_1594867431>`_** `Add simple functionality 14 <#__RefHeading__3614_1594867431>`_ `Add complexe functionality 14 <#__RefHeading__3616_1594867431>`_ **`Known problems 15 <#__RefHeading__12048_1177646034>`_** **`To-Do list 16 <#__RefHeading__12050_1177646034>`_** **`ChangeLog 16 <#__RefHeading__12052_1177646034>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ .. _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: 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: Target Group """""""""""" This Extension is usefully for websites, with languages and regions, f.e. Market regions. .. _Technical-aspects: 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: 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 :code:`jQuery.noConflict();` to solve this problem or you can remove the scripts by Typoscript with this line: :code:`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: :code:`page.includeCSS.menu >` .. _Screenshots: Screenshots ^^^^^^^^^^^ |img-3| |img-4| Not available translations for this page are shown in a different way. |img-5| |img-6| |img-7| .. _Users-manual: Users manual ------------ .. _Installation: Installation ^^^^^^^^^^^^ Install the extension, include the static TS template “GRiDDS Language Menu” to your root template. .. _Prepairing-languages: Prepairing languages ^^^^^^^^^^^^^^^^^^^^ Be sure, there are some website languages on your rootpage. |img-8| Create an additionaly website language for representing the default language: |img-9| This is needed, because the TYPO3 doesn't know your default language as website language. .. _Create-Regions-records: 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: |img-5| Choose “Language” “All”, input the name and the abbrevation of your region. Set a flag and choose your required languages. |img-6| Save and create some other region records. .. _Include-GRiDDS-Language-Menu-by-Typoscript: 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. :code:`plugin.tx\_grdslanguagemenu.persistence.storagePid = 112` Then include the plugin in your template like you do it with other plugins: :code:`lib.language < plugin.tx\_grdslanguagemenu.widgets.languageMenuWidget` |img-10| .. _Map-default-language: 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: :code:`plugin.tx\_grdslanguagemenu {settings {languageParamOverride {L17.` :code:`lang` :code:`= 0}}}` This overrides the language parameter for the language with the id 17 with the id 0. :code:`**Important! The Syntax changed since the version**` :code:`**2.1**` :code:`**from “**` :code:`**L17 = 0**` :code:`**” to “**` :code:`**L17.lang = 0**` :code:`**”.**` |img-11| .. _Include-GRiDDS-Language-Menu-as-page-content-plugin: Include GRiDDS Language Menu as page content plugin ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Choose Plugins → GRiDDS language Menu .. _img-12: |img-12| ^^^^^^^^ Set the storage page id or set it by Typoscript. .. _img-13: |img-13| ^^^^^^^^ Don't forget to set the language visibility in the tab “Language” at the bottom (Recommended “All”). .. _Subtree-with-own-Regions-and-Languages: 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. |img-14| .. _Administration: Administration -------------- .. _Translate-the-menu: Translate the menu ^^^^^^^^^^^^^^^^^^ .. _Menu-label-and-page-not-translated-message: Menu label and “page not translated” message """""""""""""""""""""""""""""""""""""""""""" :code:`plugin.tx\_grdslanguagemenu {` :code:`\_LOCAL\_LANG {` :code:`it {` :code:`tx\_grdslanguagemenu-list.changeLanguage = Cambia la lingua` :code:`tx\_grdslanguagemenu-list.pageNotTranslated = Pagina non e tradotto in questa lingua` :code:`}` :code:`}` .. _Translate-the-languages: 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”. :code:`plugin.tx\_grdslanguagemenu {` :code:`\_LOCAL\_LANG {` :code:`default {` :code:`region {` :code:`ww = Whole World` :code:`}` :code:`language {` :code:`abbr {` :code:`L1 = GLOB` :code:`}` :code:`title {` :code:`L1 = Globish` :code:`}` :code:`}` :code:`}` :code:`}` :code:`}` |img-15| .. _Configuration: Configuration ------------- .. _Reference: Reference ^^^^^^^^^ .. _Typoscript-Settings: Typoscript Settings """"""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _languageParamOverride-L-id-lang: languageParamOverride.L{id}.lang ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property languageParamOverride.L{id}.lang Data type int Description Map a language to another **Syntax:** L+id.lang = id **Example:** :code:`plugin.tx\_grdslanguagemenu {` :code:`settings {` :code:`languageParamOverride {` :code:`L17.` :code:`lang` :code:`= 0` :code:`}` :code:`}` :code:`}` 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. :code:`**Important! The Syntax changed since the version**` :code:`**2.1**` :code:`**from “**` :code:`**L17 = 0**` :code:`**” to “**` :code:`**L17.lang = 0**` :code:`**”.**` Default .. _languageParamOverride-L-id-pid: languageParamOverride.L{id}.pid ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row 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:** :code:`plugin.tx\_grdslanguagemenu {` :code:`settings {` :code:`languageParamOverride {` :code:`L17.` :code:`pid` :code:`=` :code:`83` :code:`}` :code:`}` :code:`}` Redirects the user to the page 83. **Important:** This setting has no effect, if combinate it with :code:`external = 1` . Default .. _languageParamOverride-L-id-external: languageParamOverride.L{id}.external ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property languageParamOverride.L{id}.external Data type bool Description Activates the external redirecting. **Syntax:** L+id.external = 1 **Example:** :code:`plugin.tx\_grdslanguagemenu {` :code:`settings {` :code:`languageParamOverride {` :code:`L17.` :code:`external` :code:`=` :code:`1` :code:`}` :code:`}` :code:`}` **Important:** Use this setting only in combination with :code:`ext` :code:`Target.` Default .. _languageParamOverride-L-id-extTarget: languageParamOverride.L{id}.extTarget ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property languageParamOverride.L{id}.extTarget Data type url Description Redirect a language to an external page. **Syntax:** L+id.extTarget = www.domain.tld **Example:** :code:`plugin.tx\_grdslanguagemenu {` :code:`settings {` :code:`languageParamOverride {` :code:`L17.` :code:`extTarget` :code:`=` :code:`www.google.com` :code:`}` :code:`}` :code:`}` **Important:** Use this setting only in combination with :code:`ext` :code:`ernal = 1.` :code:`Otherwise there is no effect.` Default .. _languageParamOverride-L-id-target: languageParamOverride.L{id}.target ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property languageParamOverride.L{id}.target Data type Description Specify how external redirects are opened in the browser. **Syntax:** L+id.target = \_blank / \_self / ... **Example:** :code:`plugin.tx\_grdslanguagemenu {` :code:`settings {` :code:`languageParamOverride {` :code:`L17.` :code:`target` :code:`=` :code:`\_blank` :code:`}` :code:`}` :code:`}` Opens the external redirect in a new window/tab. **Important:** Use this setting only in combination with :code:`ext` :code:`ernal = 1` :code:`and` :code:`extTarget.` :code:`Otherwise there is no effect.` Default .. _useTsTranslation: useTsTranslation ~~~~~~~~~~~~~~~~ .. container:: table-row Property useTsTranslation Data type boolean Description Enable/disables the typoscript translation for regions and languages. **Example:** :code:`plugin.tx\_grdslanguagemenu {` :code:`settings {` :code:`useTsTranslation = 0` :code:`}` :code:`}` Default 1 .. _pathIconArrow: pathIconArrow ~~~~~~~~~~~~~ .. container:: table-row Property pathIconArrow Data type file Description Defines the icon on the language menu. **Example:** :code:`plugin.tx\_grdslanguagemenu {` :code:`Settings {` :code:`pathIconArrow = EXT:grds\_language\_menu/Resources/Public/Icons/icon-triangle.png` :code:`}` :code:`}` Default EXT:grds\_language\_menu/Resources/Public/Icons/icon-triangle.png .. ###### END~OF~TABLE ###### :code:`**Important:**` :code:`**When you specify not existing pageId's or not existing languages, you will get special effects, especially in combination with coolUri!**` .. _code-Persistence: :code:`**Persistence**` """"""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _Persistence-storagePid: Persistence.storagePid ~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row a Persistence.storagePid b c The storage page id where the region records are stored. **Example:** :code:`plugin.tx\_grdslanguagemenu {` :code:`persistence` :code:`{` :code:`storagePid = 38` :code:`}` :code:`}` d .. ###### END~OF~TABLE ###### .. _code-Order-of-setting-interpretation-and-output-generation: :code:`**Order of setting interpretation and output generation**` """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |img-16| .. _Locallang: Locallang """"""""" .. ### BEGIN~OF~TABLE ### .. _language-abbr-L-id: language.abbr.L{id} ~~~~~~~~~~~~~~~~~~~ .. container:: table-row 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:** :code:`plugin.tx\_grdslanguagemenu {` :code:`\_LOCAL\_LANG {` :code:`default {` :code:`language {` :code:`abbr {` :code:`L14 = CN-SIMP` :code:`}` :code:`title {` :code:`L14 =` :code:`中国的` :code:`}` :code:`}` :code:`}` :code:`}` :code:`}` Default .. _region-abbr: region.{abbr} ~~~~~~~~~~~~~ .. container:: table-row 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:** :code:`plugin.tx\_grdslanguagemenu {` :code:`\_LOCAL\_LANG {` :code:`de {` :code:`region {` :code:`ww = Weltweit` :code:`}` :code:`}` :code:`}` :code:`}` Default .. ###### END~OF~TABLE ###### .. _Example: 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 “** :code:`**中国的**` :code:`**”**` } } } 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: Tutorial (installation example) ------------------------------- .. _Page-part-template-example-Fluid: Page part template example (Fluid) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... .. _Root-Template-TS: Root Template (TS) ^^^^^^^^^^^^^^^^^^ :code:`lib.header = COA` :code:`lib.header.10 < plugin.tx\_grdslanguagemenu.widgets.languageMenuWidget` :code:`plugin.tx\_grdslanguagemenu.persistence.storagePid = 1` .. _Languages-rootpage: Languages (rootpage) ^^^^^^^^^^^^^^^^^^^^ |img-8| .. _Region-records-page-1: Region records (page 1) ^^^^^^^^^^^^^^^^^^^^^^^ |img-7| .. _Region-Worldwide: Region “Worldwide” ^^^^^^^^^^^^^^^^^^ |img-6| .. _Typoscript-setup: Typoscript setup ^^^^^^^^^^^^^^^^ plugin.tx\_grdslanguagemenu { settings { languageParamOverride { L17.lang = 0 } } } .. _Locallang-TS: 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: Extend GRiDDS Language Menu --------------------------- .. _Add-simple-functionality: 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: :code:`{namespace myExt=Tx\_MyExt\_ViewHelper}` :code:` .. _Add-complexe-functionality: 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: Known problems -------------- .. _To-Do-list: 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: ChangeLog --------- .. ### BEGIN~OF~TABLE ### .. _1-0-0: 1.0.0 ^^^^^ .. container:: table-row Version 1.0.0 Changes Initial Release .. _2-0-0: 2.0.0 ^^^^^ .. container:: table-row Version 2.0.0 Changes Release .. _2-1-0: 2.1.0 ^^^^^ .. container:: table-row 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: 2.3 ^^^ .. container:: table-row 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. .. ###### END~OF~TABLE ###### |img-2| 18 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. |img-2| image:: img-2.png .. :border: 0 .. :height: 21 .. :hspace: 9 .. :id: Grafik2 .. :name: Grafik2 .. :width: 87 .. |img-3| image:: img-3.png .. :align: bottom .. :border: 0 .. :height: 135 .. :id: Grafik11 .. :name: Grafik11 .. :width: 224 .. |img-4| image:: img-4.png .. :align: bottom .. :border: 0 .. :height: 135 .. :id: Grafik12 .. :name: Grafik12 .. :width: 222 .. |img-5| image:: img-5.png .. :align: bottom .. :border: 0 .. :height: 47 .. :id: Grafik19 .. :name: Grafik19 .. :width: 256 .. |img-6| image:: img-6.png .. :align: bottom .. :border: 0 .. :height: 367 .. :id: Grafik10 .. :name: Grafik10 .. :width: 669 .. |img-7| image:: img-7.png .. :align: bottom .. :border: 0 .. :height: 139 .. :id: Grafik13 .. :name: Grafik13 .. :width: 644 .. |img-8| image:: img-8.png .. :align: bottom .. :border: 0 .. :height: 276 .. :id: Grafik1 .. :name: Grafik1 .. :width: 669 .. |img-9| image:: img-9.png .. :align: bottom .. :border: 0 .. :height: 181 .. :id: Grafik3 .. :name: Grafik3 .. :width: 669 .. |img-10| image:: img-10.png .. :align: bottom .. :border: 0 .. :height: 56 .. :id: Grafik7 .. :name: Grafik7 .. :width: 207 .. |img-11| image:: img-11.png .. :align: bottom .. :border: 0 .. :height: 55 .. :id: Grafik8 .. :name: Grafik8 .. :width: 207 .. |img-12| image:: img-12.png .. :align: bottom .. :border: 0 .. :height: 105 .. :id: Grafik14 .. :name: Grafik14 .. :width: 538 .. |img-13| image:: img-13.png .. :align: bottom .. :border: 0 .. :height: 195 .. :id: Grafik15 .. :name: Grafik15 .. :width: 537 .. |img-14| image:: img-14.png .. :align: bottom .. :border: 0 .. :height: 400 .. :id: Grafik20 .. :name: Grafik20 .. :width: 669 .. |img-15| image:: img-15.png .. :align: bottom .. :border: 0 .. :height: 61 .. :id: Grafik9 .. :name: Grafik9 .. :width: 163 .. |img-16| image:: img-16.png .. :align: left .. :border: 0 .. :height: 333 .. :id: graphics1 .. :name: graphics1 .. :width: 493