From 49a4019aa1c6e756285c1ae569747e2f20b2a18e Mon Sep 17 00:00:00 2001 From: Timofei Iatsenko Date: Fri, 17 Mar 2023 10:54:18 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Andrii Bodnar --- website/docs/ref/loader.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/docs/ref/loader.md b/website/docs/ref/loader.md index 37a4db556..7e4b0ee3f 100644 --- a/website/docs/ref/loader.md +++ b/website/docs/ref/loader.md @@ -1,6 +1,6 @@ # Webpack Loader -Webpack loader which compiles catalogs on the fly. In summary, `lingui compile` command isn't required when using this loader +The Webpack loader compiles catalogs on the fly. In summary, the `lingui compile` command isn't needed when using this loader. ## Installation @@ -14,7 +14,8 @@ npm install --save-dev @lingui/loader Simply prepend `@lingui/loader!` in front of path to message catalog you want to import. Here's an example of dynamic import: -Extension is mandatory. +The extension is mandatory. + ```ts export async function dynamicActivate(locale: string) { const { messages } = await import(`@lingui/loader!./locales/${locale}/messages.po`) @@ -24,7 +25,7 @@ export async function dynamicActivate(locale: string) { ``` :::note -Catalogs with `.json` extension treated differently by Webpack. They loaded as ES module with default export, so your import should look like that: +Catalogs with the `.json` extension are treated differently by Webpack. They load as ES module with default export, so your import should look like this: ```ts const { messages } = (await import(`@lingui/loader!./locales/${locale}/messages.po`)).default