Skip to main content

npgettext

Translates a plural message with the specified context.

info

Shorthand for L10n.npgettext.

Signature

npgettext(
context: string,
message: string,
messagePlural: string,
count: number,
...arguments: string[]
): string

Parameters

NameTypeOptionalDescription
contextstringNoSpecifies the translation context.
messagestringNoSpecifies the message to translate.
messagePluralstringNoSpecifies the plural message to translate.
countnumberNoSpecifies the count for the plural (can be reference in the message with %1).
argumentsstring[]YesOptional string arguments which can be referenced in the message using the percent sign followed by the argument index %n. The count value is automatically included as the first argument (%1).

Return value

Returns the translated message.