Skip to content

Commit

Permalink
Add workaround Tabler Icons bug, update to Lingui 5
Browse files Browse the repository at this point in the history
- See: tabler/tabler-icons#1233
- Recompile translations
  • Loading branch information
SBence committed Dec 1, 2024
1 parent 6e1e292 commit db87a96
Show file tree
Hide file tree
Showing 13 changed files with 442 additions and 519 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ updates:
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]

- dependency-name: "@tabler/icons-react"
7 changes: 4 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ export default tseslint.config(
"lingui/no-unlocalized-strings": [
"error",
{
ignore: ["(Reac)|(Tally)"],
ignoreAttribute: ["download", "query"],
ignoreFunction: ["useMediaQuery"],
ignore: ["^(?![A-Z])\\S+$", "(Reac)|(Tally)"],
ignoreNames: ["download", "query"],
ignoreFunctions: ["useMediaQuery"],
useTsTypes: true,
},
],
"lingui/t-call-in-function": "error",
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,23 @@
},
"dependencies": {
"@emotion/react": "^11.13.5",
"@lingui/macro": "^4.14.1",
"@lingui/react": "^4.14.1",
"@lingui/macro": "^5.0.0",
"@lingui/react": "^5.0.0",
"@mantine/core": "^7.14.3",
"@mantine/hooks": "^7.14.3",
"@mantine/notifications": "^7.14.3",
"@reduxjs/toolkit": "^2.4.0",
"@tabler/icons-react": "~3.18.0",
"@types/uuid": "^10.0.0",
"@tabler/icons-react": "^3.18.0",
"clsx": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^9.0.4",
"uuid": "^10.0.0"
"uuid": "^11.0.3"
},
"devDependencies": {
"@eslint/js": "^9.15.0",
"@lingui/cli": "^4.14.1",
"@lingui/vite-plugin": "^4.14.1",
"@lingui/cli": "^5.0.0",
"@lingui/vite-plugin": "^5.0.0",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
Expand Down
2 changes: 1 addition & 1 deletion src/components/menu/MenuButton.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Trans } from "@lingui/react/macro";
import { Button, Menu } from "@mantine/core";
import { IconChevronDown } from "@tabler/icons-react";
import { useState } from "react";
import { useAppSelector } from "../../store/hooks";
import RemoveModal from "./RemoveModal";
import MenuItems from "./MenuItems";
import { Trans } from "@lingui/macro";

export default function MenuButton() {
const [menuOpened, setMenuOpened] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/menu/MenuItems.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Trans } from "@lingui/react/macro";
import { Menu, useMantineTheme } from "@mantine/core";
import { IconDatabaseExport, IconX } from "@tabler/icons-react";
import { Dispatch, SetStateAction } from "react";
import { useAppSelector } from "../../store/hooks";
import ColorSelector from "./ColorSelector";
import RestoreButton from "./RestoreButton";
import { Trans } from "@lingui/macro";

export default function MenuItems({
setMenuOpened,
Expand Down
3 changes: 2 additions & 1 deletion src/components/menu/RemoveModal.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Trans } from "@lingui/react/macro";
import { t } from "@lingui/core/macro";
import { Button, Group, Modal, Space, ThemeIcon, Title } from "@mantine/core";
import { notifications } from "@mantine/notifications";
import { IconTrash } from "@tabler/icons-react";
import { Dispatch, SetStateAction } from "react";
import { useAppDispatch } from "../../store/hooks";
import { removeAll } from "../../store/slices/countersSlice";
import { t, Trans } from "@lingui/macro";

export default function RemoveModal({
opened,
Expand Down
3 changes: 2 additions & 1 deletion src/components/menu/RestoreButton.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Trans } from "@lingui/react/macro";
import { t } from "@lingui/core/macro";
import { FileButton, Menu } from "@mantine/core";
import { notifications } from "@mantine/notifications";
import { IconDatabaseImport } from "@tabler/icons-react";
import { Dispatch, SetStateAction } from "react";
import { useAppDispatch, useAppSelector } from "../../store/hooks";
import { appendSet } from "../../store/slices/countersSlice";
import { t, Trans } from "@lingui/macro";
import safeLoadJson from "../../utils/safeLoadJson";
import isCounters from "../../types/predicates/isCounters";

Expand Down
28 changes: 14 additions & 14 deletions src/locales/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,52 @@ msgstr ""
msgid "Accent color"
msgstr ""

#: src/components/menu/MenuItems.tsx:36
#: src/components/menu/MenuItems.tsx:43
#: src/components/menu/MenuItems.tsx:40
#: src/components/menu/MenuItems.tsx:49
msgid "Backup"
msgstr ""

#: src/components/menu/RemoveModal.tsx:36
#: src/components/menu/RemoveModal.tsx:44
msgid "Cancel"
msgstr ""

#: src/components/menu/RestoreButton.tsx:24
#: src/components/menu/RestoreButton.tsx:37
#: src/components/menu/RestoreButton.tsx:27
#: src/components/menu/RestoreButton.tsx:43
msgid "Failed to restore backup."
msgstr ""

#: src/components/menu/RestoreButton.tsx:38
#: src/components/menu/RestoreButton.tsx:44
msgid "Invalid JSON file uploaded."
msgstr ""

#: src/components/menu/RestoreButton.tsx:25
#: src/components/menu/RestoreButton.tsx:28
msgid "Non-text file uploaded."
msgstr ""

#: src/components/menu/MenuButton.tsx:38
#: src/components/menu/MenuButton.tsx:37
msgid "Options"
msgstr ""

#: src/components/menu/RemoveModal.tsx:48
#: src/components/menu/RemoveModal.tsx:56
msgid "Remove"
msgstr ""

#: src/components/menu/MenuItems.tsx:56
#: src/components/menu/MenuItems.tsx:62
msgid "Remove all"
msgstr ""

#: src/components/menu/RemoveModal.tsx:30
#: src/components/menu/RemoveModal.tsx:33
msgid "Remove all counters?"
msgstr ""

#: src/components/menu/RemoveModal.tsx:44
#: src/components/menu/RemoveModal.tsx:52
msgid "Removed all counters."
msgstr ""

#: src/components/menu/RestoreButton.tsx:51
#: src/components/menu/RestoreButton.tsx:59
msgid "Restore"
msgstr ""

#: src/components/menu/RestoreButton.tsx:32
#: src/components/menu/RestoreButton.tsx:38
msgid "Successfully restored backup."
msgstr ""
2 changes: 1 addition & 1 deletion src/locales/en.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/*eslint-disable*/export const messages=JSON.parse("{\"lBdPxu\":\"Accent color\",\"rLgPvm\":\"Backup\",\"dEgA5A\":\"Cancel\",\"d6ZzsE\":\"Failed to restore backup.\",\"iqe0XG\":\"Invalid JSON file uploaded.\",\"W+i+Ya\":\"Non-text file uploaded.\",\"0zpgxV\":\"Options\",\"t/YqKh\":\"Remove\",\"VjbCv0\":\"Remove all\",\"qoSmOe\":\"Remove all counters?\",\"Oxsmom\":\"Removed all counters.\",\"yKu/3Y\":\"Restore\",\"R/vojL\":\"Successfully restored backup.\"}");
/*eslint-disable*/import type{Messages}from"@lingui/core";export const messages=JSON.parse("{\"lBdPxu\":[\"Accent color\"],\"rLgPvm\":[\"Backup\"],\"dEgA5A\":[\"Cancel\"],\"d6ZzsE\":[\"Failed to restore backup.\"],\"iqe0XG\":[\"Invalid JSON file uploaded.\"],\"W+i+Ya\":[\"Non-text file uploaded.\"],\"0zpgxV\":[\"Options\"],\"t/YqKh\":[\"Remove\"],\"VjbCv0\":[\"Remove all\"],\"qoSmOe\":[\"Remove all counters?\"],\"Oxsmom\":[\"Removed all counters.\"],\"yKu/3Y\":[\"Restore\"],\"R/vojL\":[\"Successfully restored backup.\"]}")as Messages;
28 changes: 14 additions & 14 deletions src/locales/hu.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,52 @@ msgstr ""
msgid "Accent color"
msgstr "Kiemelőszín"

#: src/components/menu/MenuItems.tsx:36
#: src/components/menu/MenuItems.tsx:43
#: src/components/menu/MenuItems.tsx:40
#: src/components/menu/MenuItems.tsx:49
msgid "Backup"
msgstr "Biztonsági mentés"

#: src/components/menu/RemoveModal.tsx:36
#: src/components/menu/RemoveModal.tsx:44
msgid "Cancel"
msgstr "Mégse"

#: src/components/menu/RestoreButton.tsx:24
#: src/components/menu/RestoreButton.tsx:37
#: src/components/menu/RestoreButton.tsx:27
#: src/components/menu/RestoreButton.tsx:43
msgid "Failed to restore backup."
msgstr "Visszaállítás sikertelen."

#: src/components/menu/RestoreButton.tsx:38
#: src/components/menu/RestoreButton.tsx:44
msgid "Invalid JSON file uploaded."
msgstr "A feltöltött fájl nem JSON formátumú."

#: src/components/menu/RestoreButton.tsx:25
#: src/components/menu/RestoreButton.tsx:28
msgid "Non-text file uploaded."
msgstr "A feltöltött fájl formátuma nem megfelelő."

#: src/components/menu/MenuButton.tsx:38
#: src/components/menu/MenuButton.tsx:37
msgid "Options"
msgstr "Beállítások"

#: src/components/menu/RemoveModal.tsx:48
#: src/components/menu/RemoveModal.tsx:56
msgid "Remove"
msgstr "Törlés"

#: src/components/menu/MenuItems.tsx:56
#: src/components/menu/MenuItems.tsx:62
msgid "Remove all"
msgstr "Összes törlése"

#: src/components/menu/RemoveModal.tsx:30
#: src/components/menu/RemoveModal.tsx:33
msgid "Remove all counters?"
msgstr "Törli az összes számlálót?"

#: src/components/menu/RemoveModal.tsx:44
#: src/components/menu/RemoveModal.tsx:52
msgid "Removed all counters."
msgstr "Összes számláló törölve."

#: src/components/menu/RestoreButton.tsx:51
#: src/components/menu/RestoreButton.tsx:59
msgid "Restore"
msgstr "Mentés visszaállítása"

#: src/components/menu/RestoreButton.tsx:32
#: src/components/menu/RestoreButton.tsx:38
msgid "Successfully restored backup."
msgstr "Sikeres visszaállítás."
2 changes: 1 addition & 1 deletion src/locales/hu.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/*eslint-disable*/export const messages=JSON.parse("{\"lBdPxu\":\"Kiemelőszín\",\"rLgPvm\":\"Biztonsági mentés\",\"dEgA5A\":\"Mégse\",\"d6ZzsE\":\"Visszaállítás sikertelen.\",\"iqe0XG\":\"A feltöltött fájl nem JSON formátumú.\",\"W+i+Ya\":\"A feltöltött fájl formátuma nem megfelelő.\",\"0zpgxV\":\"Beállítások\",\"t/YqKh\":\"Törlés\",\"VjbCv0\":\"Összes törlése\",\"qoSmOe\":\"Törli az összes számlálót?\",\"Oxsmom\":\"Összes számláló törölve.\",\"yKu/3Y\":\"Mentés visszaállítása\",\"R/vojL\":\"Sikeres visszaállítás.\"}");
/*eslint-disable*/import type{Messages}from"@lingui/core";export const messages=JSON.parse("{\"lBdPxu\":[\"Kiemelőszín\"],\"rLgPvm\":[\"Biztonsági mentés\"],\"dEgA5A\":[\"Mégse\"],\"d6ZzsE\":[\"Visszaállítás sikertelen.\"],\"iqe0XG\":[\"A feltöltött fájl nem JSON formátumú.\"],\"W+i+Ya\":[\"A feltöltött fájl formátuma nem megfelelő.\"],\"0zpgxV\":[\"Beállítások\"],\"t/YqKh\":[\"Törlés\"],\"VjbCv0\":[\"Összes törlése\"],\"qoSmOe\":[\"Törli az összes számlálót?\"],\"Oxsmom\":[\"Összes számláló törölve.\"],\"yKu/3Y\":[\"Mentés visszaállítása\"],\"R/vojL\":[\"Sikeres visszaállítás.\"]}")as Messages;
5 changes: 5 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ export default defineConfig({
},
}),
],
resolve: {
alias: {
"@tabler/icons-react": "@tabler/icons-react/dist/esm/icons/index.mjs",
},
},
});
Loading

0 comments on commit db87a96

Please sign in to comment.