Skip to main content

Interface: DataLocaleProvider

Defined in: src/editor/dataLocaleProvider.ts:15

Provides the methods to format the graph data according to the current language.

See

DefaultDataLocaleFormatter

Methods

formatEntityLabel()

formatEntityLabel(entity, language): string

Defined in: src/editor/dataLocaleProvider.ts:34

Formats a graph entity label.

Parameters

ParameterTypeDescription

entity

ElementModel

entity to format label for

language

string

target language code

Returns

string


formatEntityTypeList()

formatEntityTypeList(entity, language): string

Defined in: src/editor/dataLocaleProvider.ts:41

Formats a graph entity types into a list.

Parameters

ParameterTypeDescription

entity

ElementModel

entity to format type list for

language

string

target language code

Returns

string


formatIri()

formatIri(iri): string

Defined in: src/editor/dataLocaleProvider.ts:27

Formats an IRI (unique identifier) for a graph content item.

Parameters

ParameterType

iri

string

Returns

string


prepareAnchor()

prepareAnchor(targetIri): Pick<React.ComponentProps<"a">, "draggable" | "href" | "target" | "rel" | "onClick">

Defined in: src/editor/dataLocaleProvider.ts:45

Provides props for an anchor (<a> link) to a resource IRI.

Parameters

ParameterType

targetIri

string

Returns

Pick<React.ComponentProps<"a">, "draggable" | "href" | "target" | "rel" | "onClick">


resolveAssetUrl()

resolveAssetUrl(assetIri, options): Promise<string>

Defined in: src/editor/dataLocaleProvider.ts:52

Asynchronously resolves an IRI/URL to referenced data asset for display or download, e.g. an image (thumbnail) or a downloadable file.

Parameters

ParameterType

assetIri

string

options

{ signal?: AbortSignal; }

options.signal?

AbortSignal

Returns

Promise<string>


selectEntityImageUrl()

selectEntityImageUrl(entity): undefined | string

Defined in: src/editor/dataLocaleProvider.ts:23

Selects a preferred image URL for an entity.

Parameters

ParameterType

entity

ElementModel

Returns

undefined | string


selectEntityLabel()

selectEntityLabel(entity): readonly Literal[]

Defined in: src/editor/dataLocaleProvider.ts:19

Selects a preferred set of localized labels for an entity.

Parameters

ParameterType

entity

ElementModel

Returns

readonly Literal[]