From c0249d39abe5de93a7e0b119a79a52afc235f9a8 Mon Sep 17 00:00:00 2001 From: Timofei Iatsenko Date: Mon, 20 Feb 2023 18:11:07 +0100 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Martin Chrástek Apply suggestions from code review Co-authored-by: Andrii Bodnar <29282228+andrii-bodnar@users.noreply.github.com> Update website/docs/ref/macro.md Co-authored-by: Martin Chrástek Update website/docs/ref/macro.md Co-authored-by: Martin Chrástek Update website/docs/ref/macro.md Co-authored-by: Martin Chrástek Update website/docs/ref/macro.md Co-authored-by: Martin Chrástek Update website/docs/ref/macro.md Co-authored-by: Martin Chrástek Update website/docs/ref/macro.md Co-authored-by: Martin Chrástek Update website/docs/ref/macro.md Co-authored-by: Martin Chrástek --- packages/macro/test/jsx-trans.ts | 2 +- website/docs/ref/macro.md | 11 ++++++++--- website/docs/tutorials/react-patterns.md | 7 ++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/macro/test/jsx-trans.ts b/packages/macro/test/jsx-trans.ts index b03e6ea7d..106f5a265 100644 --- a/packages/macro/test/jsx-trans.ts +++ b/packages/macro/test/jsx-trans.ts @@ -48,7 +48,7 @@ const cases: TestCase[] = [ `, }, { - name: "Preserve custom ID (template expression)", + name: "Preserve custom ID (template expression)", input: ` import { Trans } from '@lingui/macro'; Hello World; diff --git a/website/docs/ref/macro.md b/website/docs/ref/macro.md index 722b5829f..89ea1398c 100644 --- a/website/docs/ref/macro.md +++ b/website/docs/ref/macro.md @@ -230,7 +230,8 @@ const msg = /*i18n*/{ ```jsx Attachment {name} saved -// ↓ ↓ ↓ ↓ ↓ ↓, +// ↓ ↓ ↓ ↓ ↓ ↓ + Attachment {name} saved.; // ↓ ↓ ↓ ↓ ↓ ↓ + import { Trans } from "@lingui/react"; ; ``` @@ -757,6 +759,7 @@ import { Trans } from "@lingui/macro"; Refresh inbox; // ↓ ↓ ↓ ↓ ↓ ↓ + import { Trans } from "@lingui/react"; ; ``` @@ -769,6 +772,7 @@ import { Trans } from "@lingui/macro"; right; // ↓ ↓ ↓ ↓ ↓ ↓ + import { Trans } from "@lingui/react"; ; ; @@ -829,6 +833,7 @@ import { Plural } from "@lingui/macro"; ; // ↓ ↓ ↓ ↓ ↓ ↓ + import { Trans } from "@lingui/react"; ; ``` diff --git a/website/docs/tutorials/react-patterns.md b/website/docs/tutorials/react-patterns.md index d524536ce..64e3551c7 100644 --- a/website/docs/tutorials/react-patterns.md +++ b/website/docs/tutorials/react-patterns.md @@ -23,15 +23,15 @@ function render() { You don't need anything special to use [`Trans`](/docs/ref/macro.md#trans) inside your app (except of wrapping the root component in [`I18nProvider`](/docs/ref/react.md#i18nprovider)). -## Choosing between Generated and Explicit ID +## Choosing between generated and explicit ID -The both approaches has they pros and cons. We recommend using generated ids as it scales and gives better developer experience. +Both approaches have their pros and cons. We recommend using generated IDs as it scales and gives better developer experience. ### Using ID generated from message #### With [`Trans`](/docs/ref/macro.md#trans) -In the examples above, the content of [`Trans`](/docs/ref/macro.md#trans) is transformed into message in MessageFormat syntax. By default, this message is used for generating ID. Considering the example above, catalog would be fulfilled by these entries: +In the example code above, the content of [`Trans`](/docs/ref/macro.md#trans) is transformed into message in MessageFormat syntax. By default, this message is used for generating ID. Considering the example above, catalog would be fulfilled by these entries: ```js const catalog = [ @@ -72,6 +72,7 @@ import { Trans } from "@lingui/macro"; right; // ↓ ↓ ↓ ↓ ↓ ↓ + import { Trans } from "@lingui/react"; ; ;