Feature #20014
closedPage TS option to disable available languages
0%
Description
There is no option to disable a given set of languages to be unavailable in a given subtree. One may already disable languages based on BE groups but not based on a page subtree.
This patch adds an option disableLanguages to pageTS mod.SHARED that allows a set of languages to be removed from the translation page language selector.
Beware: this patch does not work if TemplaVoilĂ is used as TV creates the language selector on its own. Another patch for TV is available with bug report #9465.
I have a site with multiple languages active, let's say French, German, Italian and English. The situation I have is that I want some languages to be deactivated on some subtrees:
root
|-- page1 (no French here)
| |-- page1.1
| `-- page1.2
|-- page2 (no German here)
| |-- page2.1
| `-- page2.2
`-- page3 (no Italian here)
|-- page3.1
`-- page3.2
What I've done with this patch is that I allow disabling (aka removing from the list of possible new translation languages) a comma-separated list of language UID using the standard mod.SHARED pageTS that is already used to set the flag and the name of the default language:
mod.SHARED {
defaultLanguageFlag = en.gif
defaultLanguageLabel = English
disableLanguages = 2
}
This way, I may remove French, German or Italian from the drop-down list of not-yet-available translations in the page list.
This allows me an additional thing as I may now with a bit TS tricking choose another default language for each of these pages 1, 2 and 3. I create four languages in sys_languages, English included, although it is the default language and as such does not need it's own sys_language record. Now I arbitrarily set mod.SHARED.defaultLanguageLabel = Français and set the flag accordingly for this. The editor sees that when he is on page1, the default language is French. Great! But in the drop-down list of translations, I still need to remove the "French" translation as the text was already entered as default language content. And I need the fourth record English in sys_language to allow the default French text to be translated to English.
The rest is just a matter of changing the sys_language_uid in TypoScript and using either sys_language_uid = 0 or 4 (in my case) for the English language if default language is English or another language.
(issue imported from #M10432)
Files
Updated by Bernhard Eckl over 11 years ago
- Target version deleted (
0)
This is not complete, if I edit a content element I still can choose the disabled language (l18n parent field). How about a condition which checks disableLanguages and shows only the others in the dropdown menu?
Updated by Chris topher over 11 years ago
- Subject changed from Page TS option to disable avaiable languages to Page TS option to disable available languages
- Status changed from Resolved to New
Updated by Mathias Schreiber almost 10 years ago
- Category set to Backend User Interface
- Target version set to 7.4 (Backend)
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Benni Mack about 9 years ago
- Assignee deleted (
Steffen Kamper) - Target version changed from 7.5 to 8 LTS
Updated by Tymoteusz Motylewski about 8 years ago
- Status changed from New to Closed
created a proper bug report.
This feature can be closed now.