Skip to content

fillPlaceholders

Fills a translated string's numbered placeholders ({0}, {1}, …) with args, so each language can put them where its word order needs them. A placeholder used more than once is filled each time; one without a matching argument (missing, undefined, or null) is left as written.

Parameters

import {fillPlaceholders} from "@d3plus/locales";
textrequiredstring

The translated string.

argsrequiredArray.<unknown>

The values for {0}, {1}, and so on.