Skip to content

Commit

Permalink
add documentation for multilang-support
Browse files Browse the repository at this point in the history
  • Loading branch information
stefina committed Oct 12, 2018
1 parent 095bce7 commit 31dc044
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,40 @@ This makes it very easy to display the fields in the current language.
To disable this behavior, you can set the following config value in your ini file (default: True):

ckanext.dcat.translate_keys = False

## Multilingual RDF support
To add multilingual values from RDF to ckan, the function `_object_value` can be called with optional parameter `multilang=true` (defaults to `false`)).
If `_object_value` is called with the `multilang=true`-parameter, but no language-attribute is found, the value will be added as Literal with the default language (en).

Example RDF:
```xml
<dct:title xml:lang="en">Dataset Title (EN)</dct:title>
<dct:title xml:lang="de">Dataset Title (DE)</dct:title>
<dct:title xml:lang="fr">Dataset Title (FR)</dct:title>
```
```json
{
"title":
{
"en": "Dataset Title (EN)",
"de": "Dataset Title (DE)",
"fr": "Dataset Title (FR)"
}
}
```

Example with missing language in RDF:
```xml
<dct:title>Dataset Title</dct:title>
```
```json
{
"title":
{
"en": "Dataset Title"
}
}
```

## Structured data

Expand Down

0 comments on commit 31dc044

Please # to comment.