@comvi/core/icu
The ICU message compiler. It goes in as the compiler constructor option of a
@comvi/core instance, not through .use().
Exports
Section titled “Exports”- Values:
icuCompiler. - Types:
MessageCompiler.
icuCompiler
Section titled “icuCompiler”const icuCompiler: MessageCompilerPass it as compiler and ICU plural, select and selectordinal work in every catalog the
instance ingests, inline or loaded later. It is also re-exported by @comvi/react, @comvi/vue,
@comvi/svelte, @comvi/solid, @comvi/next, @comvi/next/client, @comvi/next/server and
@comvi/nuxt/i18n.
import { createI18n } from '@comvi/core';import { icuCompiler } from '@comvi/core/icu';
export const i18n = createI18n({ locale: 'en', compiler: icuCompiler, messages: { en: { items: '{count, plural, one {# item} other {# items}}' }, },});MessageCompiler
Section titled “MessageCompiler”The shape the compiler option takes, also exported from the @comvi/core root. Type a custom
compiler with it.
Read next
Section titled “Read next”- Pluralize with ICU: plural, select and selectordinal per framework.
- ICU reference: the grammar, what is not implemented, and the error texts.