Function _n

  • Similar to _ but may switch between different translations based on a numeric parameter n. This function is designed to be used with a gettext-style translation provider where translation keys are used as source translation strings. More complex rules can be implemented by the translation provider registered with registerTranslationProvider.

    Parameters

    • msgid: string

      Translation key or default translation depending on how the translation provider is set up.

    • msgidPlural: string

      A second translation key that can be used as default fallback when n is not 1 or -1. More complex rules can be implemented by the translation provider.

    • parameters: Record<string, ParameterValue> & {
          n: number | Cell<number>;
      }

      An optional object containing parameters for use in the translation string. Values may be cells.

    Returns Cell<string>

    A cell containing the translated string. The cell updates if any cell parameters change or a language change event is emitted by the translation provider.