When using page translations in Plone (v4) with LinguaPlone product (v4.1.2), links to all available languages selected in LinguaPlone settings (/<PORTAL>/@@language-controlpanel
) are generated. I wonder if it can be configured to link only to available translations for the page (excluding the current language from the links as well). I can't see any relevant options even in /<PORTAL>/portal_languages/manage_configForm
.
Asked
Active
Viewed 143 times
3

mykhal
- 19,175
- 11
- 72
- 80
2 Answers
4
you'll have to customize the plone.app.i18n.locales.languageselector
viewlet and adapt the available
method to only show those languages where there is a translation for (context.getTranslations
)
however, this will prevent visitors from switching to another language of the portal in case there is no translation to this language for the current context.

fRiSi
- 1,238
- 6
- 13
-
http://collective-docs.readthedocs.org/en/latest/i18n/translating_content.html#getting-content-items-in-another-languageHere is the relevant Python bit you need to put into your custom language selector: – Mikko Ohtamaa Jul 05 '12 at 14:21
1
You should use http://pypi.python.org/pypi/collective.portlet.lingualinks addon for that.
The global language switcher is in the head to display languages supported and should not be used to navigate between translated content.

toutpt
- 5,145
- 5
- 38
- 45