refactor: change v1 to import own copy of i18n

This commit is contained in:
2026-09-12 19:31:59 +05:00
parent de2a229545
commit 939038ffc0
24 changed files with 39 additions and 39 deletions
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { downloadBlob, encode } from "$lib/core/io"; import { downloadBlob, encode } from "$lib/core/io";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import type { OutputFormat } from "$lib/v1/registry"; import type { OutputFormat } from "$lib/v1/registry";
import Button from "./ui/Button.svelte"; import Button from "./ui/Button.svelte";
+1 -1
View File
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { Snippet } from "svelte"; import type { Snippet } from "svelte";
import { isSupportedImage, unsupportedImageError } from "$lib/core/io"; import { isSupportedImage, unsupportedImageError } from "$lib/core/io";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
interface Props { interface Props {
onFile: (file: File) => void; onFile: (file: File) => void;
+1 -1
View File
@@ -4,7 +4,7 @@
isSupportedImage, isSupportedImage,
unsupportedImageError, unsupportedImageError,
} from "$lib/core/io"; } from "$lib/core/io";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
interface Props { interface Props {
onFile: (file: File) => void; onFile: (file: File) => void;
+3 -3
View File
@@ -1,8 +1,8 @@
<script lang="ts"> <script lang="ts">
import type { ImageInfo } from "$lib/core/analyze"; import type { ImageInfo } from "$lib/core/analyze";
import { LOCALE_TAGS } from "$lib/i18n/dict"; import { LOCALE_TAGS } from "$lib/v1/i18n/dict";
import { getLocale } from "$lib/i18n/locale.svelte"; import { getLocale } from "$lib/v1/i18n/locale.svelte";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
interface Props { interface Props {
info: ImageInfo | null; info: ImageInfo | null;
+2 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { optionLabel, paramLabel } from "$lib/i18n/tool-strings"; import { optionLabel, paramLabel } from "$lib/v1/i18n/tool-strings";
import type { ParamDef, ToolEntry } from "$lib/v1/registry"; import type { ParamDef, ToolEntry } from "$lib/v1/registry";
import CheckboxField from "./ui/CheckboxField.svelte"; import CheckboxField from "./ui/CheckboxField.svelte";
import ColorField from "./ui/ColorField.svelte"; import ColorField from "./ui/ColorField.svelte";
+2 -2
View File
@@ -7,8 +7,8 @@
unsupportedImageError, unsupportedImageError,
} from "$lib/core/io"; } from "$lib/core/io";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { toolDescription, toolTitle } from "$lib/i18n/tool-strings"; import { toolDescription, toolTitle } from "$lib/v1/i18n/tool-strings";
import { import {
defaultParams, defaultParams,
getTool, getTool,
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { toolTitle } from "$lib/i18n/tool-strings"; import { toolTitle } from "$lib/v1/i18n/tool-strings";
import { outputOf, sanitizeParams, type ToolEntry } from "$lib/v1/registry"; import { outputOf, sanitizeParams, type ToolEntry } from "$lib/v1/registry";
import { TOOL_ICONS } from "$lib/v1/tools/tool-icons"; import { TOOL_ICONS } from "$lib/v1/tools/tool-icons";
import DownloadButton from "../DownloadButton.svelte"; import DownloadButton from "../DownloadButton.svelte";
@@ -1,13 +1,13 @@
<script lang="ts"> <script lang="ts">
import { LOCALE_TAGS } from "$lib/i18n/dict"; import { LOCALE_TAGS } from "$lib/v1/i18n/dict";
import { getLocale } from "$lib/i18n/locale.svelte"; import { getLocale } from "$lib/v1/i18n/locale.svelte";
import { normalizeForSearch, scoreDoc } from "$lib/i18n/matching"; import { normalizeForSearch, scoreDoc } from "$lib/v1/i18n/matching";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { import {
toolDescription, toolDescription,
toolSearchDoc, toolSearchDoc,
toolTitle, toolTitle,
} from "$lib/i18n/tool-strings"; } from "$lib/v1/i18n/tool-strings";
import { isChainable, TOOLS } from "$lib/v1/registry"; import { isChainable, TOOLS } from "$lib/v1/registry";
import ToolCard from "./ToolCard.svelte"; import ToolCard from "./ToolCard.svelte";
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { ImageInfo } from "$lib/core/analyze"; import type { ImageInfo } from "$lib/core/analyze";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { outputOf, sanitizeParams, type ToolEntry } from "$lib/v1/registry"; import { outputOf, sanitizeParams, type ToolEntry } from "$lib/v1/registry";
import { TOOL_ICONS } from "$lib/v1/tools/tool-icons"; import { TOOL_ICONS } from "$lib/v1/tools/tool-icons";
import type { Snippet } from "svelte"; import type { Snippet } from "svelte";
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import ParamsCard from "../tool/ParamsCard.svelte"; import ParamsCard from "../tool/ParamsCard.svelte";
import ResultCard from "../tool/ResultCard.svelte"; import ResultCard from "../tool/ResultCard.svelte";
import SourceCard from "../tool/SourceCard.svelte"; import SourceCard from "../tool/SourceCard.svelte";
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import DropZone from "../DropZone.svelte"; import DropZone from "../DropZone.svelte";
import Preview from "../Preview.svelte"; import Preview from "../Preview.svelte";
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import type { ParamDef, ToolEntry } from "$lib/v1/registry"; import type { ParamDef, ToolEntry } from "$lib/v1/registry";
import ParamForm from "../ParamForm.svelte"; import ParamForm from "../ParamForm.svelte";
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { ImageInfo } from "$lib/core/analyze"; import type { ImageInfo } from "$lib/core/analyze";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { outputOf, type ToolEntry } from "$lib/v1/registry"; import { outputOf, type ToolEntry } from "$lib/v1/registry";
import DownloadButton from "../DownloadButton.svelte"; import DownloadButton from "../DownloadButton.svelte";
import InfoPanel from "../InfoPanel.svelte"; import InfoPanel from "../InfoPanel.svelte";
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import DropOverlay from "../DropOverlay.svelte"; import DropOverlay from "../DropOverlay.svelte";
import DropZone from "../DropZone.svelte"; import DropZone from "../DropZone.svelte";
import Preview from "../Preview.svelte"; import Preview from "../Preview.svelte";
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import Button from "../ui/Button.svelte"; import Button from "../ui/Button.svelte";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
interface Props { interface Props {
onSubmit: (text: string) => void; onSubmit: (text: string) => void;
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { downloadBlob } from "$lib/core/io"; import { downloadBlob } from "$lib/core/io";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { getMergedDict } from "$lib/i18n/locale.svelte"; import { getMergedDict } from "$lib/v1/i18n/locale.svelte";
interface Props { interface Props {
text: string; text: string;
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import Field from "./Field.svelte"; import Field from "./Field.svelte";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
interface Props { interface Props {
id: string; id: string;
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import Field from "./Field.svelte"; import Field from "./Field.svelte";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
interface Props { interface Props {
id: string; id: string;
+1 -1
View File
@@ -14,7 +14,7 @@ import {
import { looksLikePng, base64ToBytes, stripDataUri } from "../../core/textio"; import { looksLikePng, base64ToBytes, stripDataUri } from "../../core/textio";
import { clonePixelImage, type PixelImage } from "../../core/types"; import { clonePixelImage, type PixelImage } from "../../core/types";
import { encode } from "../../core/io"; import { encode } from "../../core/io";
import { t } from "../../i18n/t"; import { t } from "../i18n/t";
import { num, str } from "../registry-helpers"; import { num, str } from "../registry-helpers";
type MaskToolSpec = { type MaskToolSpec = {
+3 -3
View File
@@ -1,9 +1,9 @@
<script lang="ts"> <script lang="ts">
import { resolve } from "$app/paths"; import { resolve } from "$app/paths";
import favicon from "$lib/assets/favicon.svg"; import favicon from "$lib/assets/favicon.svg";
import { LOCALES, type Locale } from "$lib/i18n/dict"; import { LOCALES, type Locale } from "$lib/v1/i18n/dict";
import { getLocale, initLocale, setLocale } from "$lib/i18n/locale.svelte"; import { getLocale, initLocale, setLocale } from "$lib/v1/i18n/locale.svelte";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { getTheme, initTheme, setTheme } from "$lib/theme.svelte"; import { getTheme, initTheme, setTheme } from "$lib/theme.svelte";
import { onMount } from "svelte"; import { onMount } from "svelte";
import "../../app_v1.css"; import "../../app_v1.css";
+2 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { toolTitle } from "$lib/i18n/tool-strings"; import { toolTitle } from "$lib/v1/i18n/tool-strings";
import ToolPage from "$lib/v1/components/ToolPage.svelte"; import ToolPage from "$lib/v1/components/ToolPage.svelte";
import ToolSearch from "$lib/v1/components/search/ToolSearch.svelte"; import ToolSearch from "$lib/v1/components/search/ToolSearch.svelte";
import Button from "$lib/v1/components/ui/Button.svelte"; import Button from "$lib/v1/components/ui/Button.svelte";
+2 -2
View File
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { resolve } from "$app/paths"; import { resolve } from "$app/paths";
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { toolDescription, toolTitle } from "$lib/i18n/tool-strings"; import { toolDescription, toolTitle } from "$lib/v1/i18n/tool-strings";
import { CATEGORIES } from "$lib/v1/categories"; import { CATEGORIES } from "$lib/v1/categories";
import ToolCard from "$lib/v1/components/search/ToolCard.svelte"; import ToolCard from "$lib/v1/components/search/ToolCard.svelte";
import { TOOLS } from "$lib/v1/registry"; import { TOOLS } from "$lib/v1/registry";
+2 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { toolDescription, toolTitle } from "$lib/i18n/tool-strings"; import { toolDescription, toolTitle } from "$lib/v1/i18n/tool-strings";
import ToolPage from "$lib/v1/components/ToolPage.svelte"; import ToolPage from "$lib/v1/components/ToolPage.svelte";
import { getTool } from "$lib/v1/registry"; import { getTool } from "$lib/v1/registry";
+1 -1
View File
@@ -1,4 +1,4 @@
import { t } from "$lib/i18n/t"; import { t } from "$lib/v1/i18n/t";
import { getTool, TOOLS } from "$lib/v1/registry"; import { getTool, TOOLS } from "$lib/v1/registry";
import { error } from "@sveltejs/kit"; import { error } from "@sveltejs/kit";
import type { EntryGenerator, PageLoad } from "./$types"; import type { EntryGenerator, PageLoad } from "./$types";