-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metadata Editor / support multilingual values in certain fields #1011
Metadata Editor / support multilingual values in certain fields #1011
Conversation
Affected libs:
|
📷 Screenshots are here! |
c03413e
to
44a2a7f
Compare
Also improve the process of writing DCAT, making sure relations exist to comply to the DCAT-AP model
44a2a7f
to
de3cc97
Compare
@@ -100,6 +98,9 @@ export class RecordFormComponent implements AfterViewInit { | |||
keywords: hasPrevious ? this.record.keywords : [], | |||
topics: hasPrevious ? this.record.topics : [], | |||
onlineResources: [], | |||
otherLanguages: [], | |||
defaultLanguage: 'en', | |||
overviews: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have adjusted these fixtures to make them correct; there were typing errors that were hidden because of the cast to CatalogRecord below
de3cc97
to
829b65f
Compare
defaultLanguage: LanguageCode | ||
): string { | ||
const dataset = getDatasetNode(dataStore, recordNode) | ||
const [title] = readLocalizedValue<RecordTranslations>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readLocalizedValue
is introduced in this PR and does two things:
- add any found translations to the
translations
object given to it - return both the default value and the translations array as a tuple:
[value, translations]
I took the opportunity to better document the datahub & editor apps! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @jahow, for the huge work and for reworking the doc! Not sure if I got everything, but as far as I can see PR LGTM.
@tkohr thank you for the review!! |
Description
This PR introduces support for reading and writing multilingual values in various fields of a catalog record:
These fields are currently:
The converters (both ISO and DCAT-AP) are now able to read and write translations alongside a field value.
Note: in the model, a record has a mandatory default language. Multilingual fields have a default value (in the default language). They can also have values in other languages, these values are called translations.
A record also have a field called
otherLanguages
which lists all languages in which translations have been found.The Metadata Editor currently only modifies the default values of multilingual fields; this means that translations should not be impacted at all by the app for now.
This PR has the important effect that multilingual fields will not lose their translations if modified in the editor; the translations can not be edited but at least they are preserved.
Architectural changes
none
Quality Assurance Checklist
breaking change
labelbackport <release branch>
label