`imports.format` replacement.
This issue serves as an initial exploration of how we might deprecate imports.format
with string templates (pending xgettext
support).
Rough Proposal
import { domain, msgid } from 'gettext';
const { pgettext, ngettext, gettext, _ } = domain('gnome-dogs');
globalThis._ = _;
globalThis.msgid = msgid;
globalThis.gettext = gettext;
globalThis.ngettext = gettext;
globalThis.pgettext = pgettext;
Code | Translation String |
---|---|
|
msgid "My dog is named ${0}." |
|
msgid "I have ${0} dog." msgid_plural "I have ${0} dogs." |
|
msgid "My dog has ${0} fur and is named ${1}." |
Edited by Evan Welsh