From 8a0f3dc53ea749f20b0321b3d4b37f7b8e7d2c59 Mon Sep 17 00:00:00 2001 From: David Di Biase <1168397+davedbase@users.noreply.github.com> Date: Sun, 3 May 2026 21:10:36 -0400 Subject: [PATCH 1/2] Ported to Solid 2.0 beta 10 --- .changeset/i18n-solid2-migration.md | 18 ++++++ packages/i18n/README.md | 96 +++++++++-------------------- packages/i18n/dev/index.tsx | 76 ++++++++--------------- packages/i18n/package.json | 4 +- packages/i18n/test/index.test.ts | 32 +++++----- packages/i18n/test/server.test.ts | 2 +- packages/i18n/test/setup.ts | 56 +++++++++++++++++ pnpm-lock.yaml | 31 +++++++++- 8 files changed, 179 insertions(+), 136 deletions(-) create mode 100644 .changeset/i18n-solid2-migration.md create mode 100644 packages/i18n/test/setup.ts diff --git a/.changeset/i18n-solid2-migration.md b/.changeset/i18n-solid2-migration.md new file mode 100644 index 000000000..b81882c6b --- /dev/null +++ b/.changeset/i18n-solid2-migration.md @@ -0,0 +1,18 @@ +--- +"@solid-primitives/i18n": major +--- + +Migrate to Solid.js v2.0 (beta.10) + +## Breaking Changes + +**Peer dependency**: `solid-js@^2.0.0-beta.10` is now required. + +### `@solid-primitives/i18n` + +- `createResource` is removed in Solid 2.0 — use `createMemo` with an async function for dynamic dictionary loading, or a synchronous `createMemo` for static dictionaries +- `Suspense` is replaced by `Loading` from `solid-js` for wrapping async dictionary reads +- `useTransition` is removed — use `isPending()` from `solid-js` to observe transition state +- `onMount` replaced by `onSettled` for post-hydration lifecycle callbacks +- `createEffect` now requires the split compute/apply form: `createEffect(compute, effect)` — single-argument usage is no longer supported +- The `jsx` entry in test dictionaries no longer returns JSX elements; the test helper `setup.tsx` is renamed to `setup.ts` with plain object returns diff --git a/packages/i18n/README.md b/packages/i18n/README.md index e59582d40..6ae021909 100644 --- a/packages/i18n/README.md +++ b/packages/i18n/README.md @@ -54,11 +54,12 @@ const fr_dict: Dict = { When using large dictionary files, JSON files are [faster to load](https://www.youtube.com/watch?v=ff4fgQxPaO0). Additionally, we recommend keeping a flat JSON structure so you don't need to flatten the object on the client for best performance. -### With `createResource` +### Dynamic loading -Example of using `@solid-primitives/i18n` with `createResource` to dynamically load directories for selected languages. +Use `createMemo` with an async function to load dictionaries on demand. The translator suspends inside a `` boundary until the dictionary resolves. ```tsx +import { type Component, createMemo, createSignal, Loading } from "solid-js"; import * as i18n from "@solid-primitives/i18n"; /* @@ -67,7 +68,7 @@ Assuming the dictionaries are in the following structure: en.ts fr.ts es.ts -And all exports a `dict` object +And all export a `dict` object */ // use `type` to not include the actual dictionary in the bundle @@ -85,86 +86,49 @@ async function fetchDictionary(locale: Locale): Promise { const App: Component = () => { const [locale, setLocale] = createSignal("en"); - const [dict] = createResource(locale, fetchDictionary); - - dict(); // => Dictionary | undefined - // (undefined when the dictionary is not loaded yet) - - const t = i18n.translator(dict); - - t("hello"); // => string | undefined + const dict = createMemo(async () => fetchDictionary(locale())); + const t = i18n.translator(dict, i18n.resolveTemplate); return ( - - - {dict => { - dict(); // => Dictionary (narrowed by Show) - - const t = i18n.translator(dict); - - t("hello"); // => string - - return ( -
-

Current locale: {locale()}

-
- - - -
- -

{t("hello", { name: "John" })}

-

{t("goodbye", { name: "John" })}

-

{t("food.meat")}

-
- ); - }} -
-
+ Loading...}> +
+

Current locale: {locale()}

+
+ + + +
+ +

{t("hello", { name: "John" })}

+

{t("goodbye", { name: "John" })}

+

{t("food.meat")}

+
+
); }; ``` -### With initial dictionary - -Instead of narrowing the current dictionary with `Show`, you can also provide an initial dictionary to `createResource`. - -```ts -// en dictionary will be included in the bundle -import { dict as en_dict } from "./i18n/en.js"; - -const [dict] = createResource(locale, fetchDictionary, { - initialValue: i18n.flatten(en_dict), -}); - -dict(); // => Dictionary -``` - ### With transitions -Since the dictionary is a resource, you can use solid's transitions when switching the locale. +Use `isPending()` to show visual feedback while a locale switch is in progress. ```tsx -const [dict] = createResource(locale, fetchDictionary); - -const [duringTransition, startTransition] = useTransition(); +import { createMemo, isPending, Loading } from "solid-js"; -function switchLocale(locale: Locale) { - startTransition(() => setLocale(locale)); -} +const dict = createMemo(async () => fetchDictionary(locale())); return ( -
- +
+ - +
); ``` ### Static dictionaries -If you don't need to load dictionaries dynamically, you can use `createMemo` instead of `createResource`. +If you don't need to load dictionaries dynamically, use `createMemo` with a synchronous function. ```tsx import * as en from "./i18n/en.js"; @@ -236,12 +200,12 @@ Translations in `root.ts` would be available in all modules. Translations in `lo // root.ts const [locale, setLocale] = createSignal("en"); -const [commonDict] = createResource(locale, fetchCommonDictionary); +const commonDict = createMemo(async () => fetchCommonDictionary(locale())); const t = i18n.translator(commonDict); // login/login.ts -const [loginDict] = createResource(locale, fetchLoginDictionary); +const loginDict = createMemo(async () => fetchLoginDictionary(locale())); // translator only for login module const loginT = i18n.translator(loginDict); @@ -250,7 +214,7 @@ t("welcome"); // => 'Welcome from common translations!' loginT("welcome"); // => 'Welcome from login translations!' ``` -Or combine multiple dictionaries into one. While prefixing the keys with the module name. +Or combine multiple dictionaries into one, prefixing the keys with the module name. ```ts const combined_dict = createMemo(() => ({ diff --git a/packages/i18n/dev/index.tsx b/packages/i18n/dev/index.tsx index a724c1511..d841b2d44 100644 --- a/packages/i18n/dev/index.tsx +++ b/packages/i18n/dev/index.tsx @@ -1,12 +1,4 @@ -import { - type Component, - createResource, - createSignal, - onMount, - Show, - Suspense, - useTransition, -} from "solid-js"; +import { type Component, createMemo, createSignal, isPending, Loading, onSettled } from "solid-js"; import * as i18n from "../src/index.js"; import * as en from "./en.js"; import * as es from "./es.js"; @@ -28,53 +20,37 @@ const App: Component = () => { const [locale, setLocale] = createSignal("en"); const [name, setName] = createSignal("User"); - const [dict] = createResource(locale, fetchDictionary); - - const [duringTransition, startTransition] = useTransition(); - - function switchLocale(locale: Locale) { - startTransition(() => setLocale(locale)); - } + const dict = createMemo(async () => fetchDictionary(locale())); + const t = i18n.translator(dict, i18n.resolveTemplate); return ( - - - {dict => { - const t = i18n.translator(dict, i18n.resolveTemplate); - - return ( -
-
-

- Current locale: {locale()} -

-
- - - -
- -
- -

{t("hello", { name: name() })}

-

{t("goodbye", { name: name() })}

-

{t("food.meat")}

-
-
- ); - }} - - +
+ +
+

+ Current locale: {locale()} +

+
+ + + +
+ +
+ +

{t("hello", { name: name() })}

+

{t("goodbye", { name: name() })}

+

{t("food.meat")}

+
+ +
); }; export default function () { const [is_mounted, set_mounted] = createSignal(false); - onMount(() => set_mounted(true)); + onSettled(() => set_mounted(true)); return <>{is_mounted() && }; } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 6f080144b..17d0b63db 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -58,9 +58,9 @@ "primitives" ], "peerDependencies": { - "solid-js": "^1.6.12" + "solid-js": "^2.0.0-beta.10" }, "devDependencies": { - "solid-js": "^1.9.7" + "solid-js": "2.0.0-beta.10" } } diff --git a/packages/i18n/test/index.test.ts b/packages/i18n/test/index.test.ts index 0fcf5d5dc..55e667374 100644 --- a/packages/i18n/test/index.test.ts +++ b/packages/i18n/test/index.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "vitest"; import * as i18n from "../src/index.js"; -import { createEffect, createResource, createRoot, createSignal } from "solid-js"; -import { Locale, en_dict, pl_dict } from "./setup.jsx"; +import { createEffect, createMemo, createRoot, createSignal, flush } from "solid-js"; +import { Locale, en_dict, pl_dict } from "./setup.js"; describe("dict", () => { test("flatten", () => { @@ -168,37 +168,39 @@ Object.entries({ }); describe("reactive", () => { - test("with translator", async () => { + test("with translator", () => { const [locale, setLocale] = createSignal("en"); let hello = ""; let to_usd = 0; const dispose = createRoot(dispose => { - const [dict] = createResource( - locale, - async locale => { - const dict = locale === "en" ? en_dict : pl_dict; - return i18n.flatten(dict); - }, - { initialValue: i18n.flatten(en_dict) }, + const dict = createMemo(() => + i18n.flatten(locale() === "en" ? en_dict : pl_dict), ); const t = i18n.translator(dict, i18n.resolveTemplate); const chained = i18n.chainedTranslator(en_dict, t); - createEffect(() => { - hello = t("hello", { name: "Tester", thing: "day" }); - to_usd = chained.data.currency["to.usd"](); - }); + createEffect( + () => ({ + hello: t("hello", { name: "Tester", thing: "day" }), + to_usd: chained.data.currency["to.usd"](), + }), + ({ hello: h, to_usd: u }) => { + hello = h; + to_usd = u; + }, + ); return dispose; }); + flush(); expect(hello).toBe("Hello Tester! How is your day?"); expect(to_usd).toBe(1); setLocale("pl"); - await Promise.resolve(); + flush(); expect(hello).toBe("Cześć Tester!"); expect(to_usd).toBe(0.27); diff --git a/packages/i18n/test/server.test.ts b/packages/i18n/test/server.test.ts index 135f8e068..9f8d9e872 100644 --- a/packages/i18n/test/server.test.ts +++ b/packages/i18n/test/server.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "vitest"; import * as i18n from "../src/index.js"; -import { en_dict } from "./setup.jsx"; +import { en_dict } from "./setup.js"; describe("template", () => { test("identity template resolver", () => { diff --git a/packages/i18n/test/setup.ts b/packages/i18n/test/setup.ts new file mode 100644 index 000000000..e13491dad --- /dev/null +++ b/packages/i18n/test/setup.ts @@ -0,0 +1,56 @@ +import * as i18n from "../src/index.js"; + +export class MyClass { + constructor(public name: string) {} +} + +export const en_dict = { + hello: i18n.template<{ name: string; thing: string }>("Hello {{name}}! How is your {{thing}}?"), + numbers: { + 1: "one", + 2: "two", + 3: "three", + }, + data: { + class: new MyClass("hello"), + currency: { + name: "dollar", + symbol: "$", + iso: "USD", + "to.usd": 1, // test dot notation + }, + users: [{ name: "John" }, { name: "Kate" }], + formatList(list: string[]) { + const last = list.pop(); + return `${list.join(", ")} and ${last}`; + }, + }, + jsx: (name: string) => ({ greeting: "Hi", name }), +}; + +export type Dict = typeof en_dict; +export type Locale = "en" | "pl"; + +export const pl_dict = { + hello: i18n.template("Cześć {{name}}!"), + numbers: { + 1: "jeden", + 2: "dwa", + 3: "trzy", + }, + data: { + class: new MyClass("cześć"), + currency: { + name: "złoty", + symbol: "zł", + iso: "PLN", + "to.usd": 0.27, + }, + users: [{ name: "Jan" }, { name: "Kasia" }, { name: "Tester" }], + formatList(list: string[]) { + const last = list.pop(); + return `${list.join(", ")} i ${last}`; + }, + }, + jsx: (name: string) => ({ greeting: "Cześć", name }), +} satisfies Dict; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 726871879..e80cf5906 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -421,8 +421,8 @@ importers: packages/i18n: devDependencies: solid-js: - specifier: ^1.9.7 - version: 1.9.7 + specifier: 2.0.0-beta.10 + version: 2.0.0-beta.10 packages/idle: devDependencies: @@ -2366,36 +2366,42 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] + libc: [glibc] '@parcel/watcher-linux-arm-musl@2.5.1': resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==} engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] + libc: [musl] '@parcel/watcher-linux-arm64-glibc@2.5.1': resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.5.1': resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [musl] '@parcel/watcher-linux-x64-glibc@2.5.1': resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [glibc] '@parcel/watcher-linux-x64-musl@2.5.1': resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [musl] '@parcel/watcher-wasm@2.3.0': resolution: {integrity: sha512-ejBAX8H0ZGsD8lSICDNyMbSEtPMWgDL0WFCt/0z7hyf5v8Imz4rAM8xY379mBsECkq/Wdqa5WEDLqtjZ+6NxfA==} @@ -2506,36 +2512,42 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-arm64-musl@1.0.0-rc.17': resolution: {integrity: sha512-b/CgbwAJpmrRLp02RPfhbudf5tZnN9nsPWK82znefso832etkem8H7FSZwxrOI9djcdTP7U6YfNhbRnh7djErg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17': resolution: {integrity: sha512-4EII1iNGRUN5WwGbF/kOh/EIkoDN9HsupgLQoXfY+D1oyJm7/F4t5PYU5n8SWZgG0FEwakyM8pGgwcBYruGTlA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17': resolution: {integrity: sha512-AH8oq3XqQo4IibpVXvPeLDI5pzkpYn0WiZAfT05kFzoJ6tQNzwRdDYQ45M8I/gslbodRZwW8uxLhbSBbkv96rA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': resolution: {integrity: sha512-cLnjV3xfo7KslbU41Z7z8BH/E1y5mzUYzAqih1d1MDaIGZRCMqTijqLv76/P7fyHuvUcfGsIpqCdddbxLLK9rA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-x64-musl@1.0.0-rc.17': resolution: {integrity: sha512-0phclDw1spsL7dUB37sIARuis2tAgomCJXAHZlpt8PXZ4Ba0dRP1e+66lsRqrfhISeN9bEGNjQs+T/Fbd7oYGw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': resolution: {integrity: sha512-0ag/hEgXOwgw4t8QyQvUCxvEg+V0KBcA6YuOx9g0r02MprutRF5dyljgm3EmR02O292UX7UeS6HzWHAl6KgyhA==} @@ -2672,56 +2684,67 @@ packages: resolution: {integrity: sha512-gTJ/JnnjCMc15uwB10TTATBEhK9meBIY+gXP4s0sHD1zHOaIh4Dmy1X9wup18IiY9tTNk5gJc4yx9ctj/fjrIw==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.43.0': resolution: {integrity: sha512-ZJ3gZynL1LDSIvRfz0qXtTNs56n5DI2Mq+WACWZ7yGHFUEirHBRt7fyIk0NsCKhmRhn7WAcjgSkSVVxKlPNFFw==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.43.0': resolution: {integrity: sha512-8FnkipasmOOSSlfucGYEu58U8cxEdhziKjPD2FIa0ONVMxvl/hmONtX/7y4vGjdUhjcTHlKlDhw3H9t98fPvyA==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.43.0': resolution: {integrity: sha512-KPPyAdlcIZ6S9C3S2cndXDkV0Bb1OSMsX0Eelr2Bay4EsF9yi9u9uzc9RniK3mcUGCLhWY9oLr6er80P5DE6XA==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loongarch64-gnu@4.43.0': resolution: {integrity: sha512-HPGDIH0/ZzAZjvtlXj6g+KDQ9ZMHfSP553za7o2Odegb/BEfwJcR0Sw0RLNpQ9nC6Gy8s+3mSS9xjZ0n3rhcYg==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-powerpc64le-gnu@4.43.0': resolution: {integrity: sha512-gEmwbOws4U4GLAJDhhtSPWPXUzDfMRedT3hFMyRAvM9Mrnj+dJIFIeL7otsv2WF3D7GrV0GIewW0y28dOYWkmw==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.43.0': resolution: {integrity: sha512-XXKvo2e+wFtXZF/9xoWohHg+MuRnvO29TI5Hqe9xwN5uN8NKUYy7tXUG3EZAlfchufNCTHNGjEx7uN78KsBo0g==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.43.0': resolution: {integrity: sha512-ruf3hPWhjw6uDFsOAzmbNIvlXFXlBQ4nk57Sec8E8rUxs/AI4HD6xmiiasOOx/3QxS2f5eQMKTAwk7KHwpzr/Q==} cpu: [riscv64] os: [linux] + libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.43.0': resolution: {integrity: sha512-QmNIAqDiEMEvFV15rsSnjoSmO0+eJLoKRD9EAa9rrYNwO/XRCtOGM3A5A0X+wmG+XRrw9Fxdsw+LnyYiZWWcVw==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.43.0': resolution: {integrity: sha512-jAHr/S0iiBtFyzjhOkAics/2SrXE092qyqEg96e90L3t9Op8OTzS6+IX0Fy5wCt2+KqeHAkti+eitV0wvblEoQ==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.43.0': resolution: {integrity: sha512-3yATWgdeXyuHtBhrLt98w+5fKurdqvs8B53LaoKD7P7H7FKOONLsBVMNl9ghPQZQuYcceV5CDyPfyfGpMWD9mQ==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.43.0': resolution: {integrity: sha512-wVzXp2qDSCOpcBCT5WRWLmpJRIzv23valvcTwMHEobkjippNf+C3ys/+wf07poPkeNix0paTNemB2XrHr2TnGw==} @@ -5208,24 +5231,28 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] lightningcss-linux-arm64-musl@1.32.0: resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [musl] lightningcss-linux-x64-gnu@1.32.0: resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [glibc] lightningcss-linux-x64-musl@1.32.0: resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [musl] lightningcss-win32-arm64-msvc@1.32.0: resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} From 50d3cf402ab107cc7ee2756ef274961a15beac1f Mon Sep 17 00:00:00 2001 From: David Di Biase <1168397+davedbase@users.noreply.github.com> Date: Sun, 3 May 2026 21:12:10 -0400 Subject: [PATCH 2/2] Formatting adjustment --- packages/i18n/dev/index.tsx | 2 +- packages/i18n/test/index.test.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/i18n/dev/index.tsx b/packages/i18n/dev/index.tsx index d841b2d44..e170077d6 100644 --- a/packages/i18n/dev/index.tsx +++ b/packages/i18n/dev/index.tsx @@ -26,7 +26,7 @@ const App: Component = () => { return (
-
+

Current locale: {locale()}

diff --git a/packages/i18n/test/index.test.ts b/packages/i18n/test/index.test.ts index 55e667374..21c0c0caa 100644 --- a/packages/i18n/test/index.test.ts +++ b/packages/i18n/test/index.test.ts @@ -174,9 +174,7 @@ describe("reactive", () => { let to_usd = 0; const dispose = createRoot(dispose => { - const dict = createMemo(() => - i18n.flatten(locale() === "en" ? en_dict : pl_dict), - ); + const dict = createMemo(() => i18n.flatten(locale() === "en" ? en_dict : pl_dict)); const t = i18n.translator(dict, i18n.resolveTemplate); const chained = i18n.chainedTranslator(en_dict, t);