From 85d91c64b5b3ec31df8acecd68a1fa6a68d57ff9 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Wed, 30 Mar 2022 21:47:45 +0200 Subject: feat(renderer): Renderer translations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add react-i18n to make us able to use i18next translations in the renderer process just like we do in the main process. Translations are hot-reloaded automatically. Signed-off-by: Kristóf Marussy --- packages/shared/src/schemas/Translation.ts | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/shared/src/schemas/Translation.ts (limited to 'packages/shared/src/schemas/Translation.ts') diff --git a/packages/shared/src/schemas/Translation.ts b/packages/shared/src/schemas/Translation.ts new file mode 100644 index 0000000..ab513b5 --- /dev/null +++ b/packages/shared/src/schemas/Translation.ts @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2022 Kristóf Marussy + * + * This file is part of Sophie. + * + * Sophie is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { z } from 'zod'; + +export const Translation = /* @__PURE__ */ (() => + z.object({ + language: z.string().nonempty(), + namespace: z.string().nonempty(), + }))(); + +/* + eslint-disable-next-line @typescript-eslint/no-redeclare -- + Intentionally naming the type the same as the schema definition. +*/ +export type Translation = z.infer; -- cgit v1.2.3-54-g00ecf