resource() Function

Function

resource( key )

Retrieves a string of translated text appropriate for the current user, according to their language preference, by matching a given key with text.

Parameters

Keyword Type Description

key

Text

The item paired with each desired translation in your resource bundle.

Returns

Text

Usage considerations

If no matching translation is available for the user's locale, the key itself is returned.

Examples

You can experiment with this function in the test box below.

Test Input

resource("city") returns ciudad for es_MX and ville for fr_CA

Open in Github Built: Fri, Oct 22, 2021 (11:11:24 AM)

On This Page

FEEDBACK