-
Notifications
You must be signed in to change notification settings - Fork 7
Plugin multilang_resources
multilang_resources
plugin provides per-language resources functionality. It allows to specify for which UI language resource will be shown.
Typical use case is when a dataset have resources which contain the same data, but are translated for several languages and each language has separate file. In regular CKAN installation, dataset would have long list of resources visible for any user:
Resource - english.doc
Resource - italian.doc
Resource - french.doc
..
Multilang resources plugin allows to short down that list for user and display resources that are valid only for user's UI language, so user using English language will see only Resource - english.doc
, user with Italian will see only Resource - italian.doc
and so on...
To enable this plugin you need to change config .ini:
- add it to
ckan.plugins
list, aftermultilang
plugin:
ckan.plugins = .. multilang multilang_resources
- set 'ckanext.multilang.localized_resources' to
true
ckanext.multilang.localized_resources = true
Note This plugin implements IDatasetForm
interface, meaning it can't be used with any other plugin that implements this interface. One exception here is dcatapit_pkg
plugin, which can be used along with multilang_resources
. In this case, dcatapit extension takes over implementation of interface reusing methods from multilang_resources
plugin.
Plugin will use languages defined in CKAN deployment, and use available locales.
After enabling plugin, in resource edit form you can specify for which language resource should be displayed by selecting it from Language
dropdown:
Resources which will have language specified will be shown for selected languages only. Resources which don't have language specified (or All languages
was selected), will be displayed for all users, independently from the language selected in UI.