Skip to content

Instantly share code, notes, and snippets.

@nemrosim
Last active March 27, 2022 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemrosim/4ff7c2538ba206a91d97da7576d75f8a to your computer and use it in GitHub Desktop.
Save nemrosim/4ff7c2538ba206a91d97da7576d75f8a to your computer and use it in GitHub Desktop.
import React from "react";
-import { Plural } from "@lingui/macro";
+import { Plural, plural } from "@lingui/macro";
export const JSXPlurals: React.FC = () => {
const amountList = [ 0, 1, 2, 5, 100 ]
+ const jsMacrosExample = (amount: number) => plural(amount, {
+ one: "You got {amount} item (one)",
+ many: 'You got {amount} items (many)',
+ other: 'You got {amount} items (other)'
+ })
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment