Skip to main content


Translates a plural message.


Shorthand for L10n._n.


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


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.


import { _n } from "@tripetto/builder";

// Outputs `1 car` to the console.
console.log(_n("1 car", "%1 cars", 1));

// Outputs `2 cars` to the console.
console.log(_n("1 car", "%1 cars", 2));