Skip to content

ogdch/ckanext-fluent

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ckanext-fluent

This extension provides a way to store and return multilingul fields in CKAN datasets, resources, organizations and groups.

Add the fluent plugin to your ckan.plugins configuration settings and use ckanext-scheming or a custom form plugin to use the provided validators to store multilingual text in extra fields.

The easiest way to use fluent multilingual text fields is with ckanext-scheming. Add ckanext.fluent:presets.json to your scheming.presets configuration settings:

scheming.presets = ckanext.scheming:presets.json
                   ckanext.fluent:presets.json

A fluent multilingual field in a scheming schema will look something like::

{
  "field_name": "books",
  "preset": "fluent_text",
  "label": {
    "en": "Books",
    "fr": "Livres"
  },
  "form_languages": ["en", "fr"]
}

This new extra field "books" will appear as multiple fields in the dataset form, one for each language specified in form_languages by the form snippet.

Example of fluent form snippet

When displayed, each language with text entered will appear separately by the display snippet, eg.:

Example of fluent display snippet

When the dataset is accessed from the API the language values appear and are updated as an object, eg.:

{
  "...": "...",
  "books": {
    "en": "Franklin",
    "fr": "Benjamin"
  },
  "...": "..."
}

About

Multilingual fields for CKAN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 74.3%
  • HTML 25.7%