diff --git a/README.md b/README.md index df00520..17d4d1f 100644 --- a/README.md +++ b/README.md @@ -340,16 +340,38 @@ Similarly `` *emphasizes* a particular piece of text (browsers show this vis Example: -```json +```javascript { - "myMessage": "This is bold but not all that important." + myMessage: "This is bold but not all that important." } ``` +#### Advanced Formatting + +More advanced formatting can be achieved by providing replacement methods for custom tags, which are similar to arguments: + ```javascript -localizer.localizeHTML('myMessage'); +{ + goHome: "Go home" +} ``` +Then, import `localizeMarkup`: +```javascript +import { localizeMarkup } from '@brightspace-ui/intl/lib/localize.js'; +``` + +and provide a tag replacement method: +```javascript +localizer.localizeHTML('goHome', { + homeLink: chunks => localizeMarkup`${chunks}` +}); +``` +In addition to the Basic Formatting elements, these additional elements may also be used in replacement methods: + +* `` +* `` + ### `onResourcesChange` Provide an `onResourcesChange` callback function to perform tasks when the document language is changed and updated resources are available: