diff --git a/website/package-lock.json b/website/package-lock.json index 98874351..7a2418ae 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -31,7 +31,6 @@ "png.js": "^0.2.1", "sanitize-html": "^2.13.0", "sortablejs": "^1.15.3", - "svelte-i18n": "^4.0.0", "svelte-sonner": "^0.3.28", "tailwind-merge": "^2.5.2", "tailwind-variants": "^0.2.1" @@ -739,261 +738,6 @@ "tslib": "^2.4.0" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", - "cpu": [ - "ppc64" - ], - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", - "cpu": [ - "loong64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", - "cpu": [ - "mips64el" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", - "cpu": [ - "ppc64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", - "cpu": [ - "riscv64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", - "cpu": [ - "s390x" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@esbuild/netbsd-arm64": { "version": "0.25.4", "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.4.tgz", @@ -1011,21 +755,6 @@ "node": ">=18" } }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@esbuild/openbsd-arm64": { "version": "0.25.4", "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.4.tgz", @@ -1043,81 +772,6 @@ "node": ">=18" } }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -1218,50 +872,6 @@ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.8.tgz", "integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==" }, - "node_modules/@formatjs/ecma402-abstract": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.0.0.tgz", - "integrity": "sha512-rRqXOqdFmk7RYvj4khklyqzcfQl9vEL/usogncBHRZfZBDOwMGuSRNFl02fu5KGHXdbinju+YXyuR+Nk8xlr/g==", - "dependencies": { - "@formatjs/intl-localematcher": "0.5.4", - "tslib": "^2.4.0" - } - }, - "node_modules/@formatjs/fast-memoize": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.0.tgz", - "integrity": "sha512-hnk/nY8FyrL5YxwP9e4r9dqeM6cAbo8PeU9UjyXojZMNvVad2Z06FAVHyR3Ecw6fza+0GH7vdJgiKIVXTMbSBA==", - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@formatjs/icu-messageformat-parser": { - "version": "2.7.8", - "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.7.8.tgz", - "integrity": "sha512-nBZJYmhpcSX0WeJ5SDYUkZ42AgR3xiyhNCsQweFx3cz/ULJjym8bHAzWKvG5e2+1XO98dBYC0fWeeAECAVSwLA==", - "dependencies": { - "@formatjs/ecma402-abstract": "2.0.0", - "@formatjs/icu-skeleton-parser": "1.8.2", - "tslib": "^2.4.0" - } - }, - "node_modules/@formatjs/icu-skeleton-parser": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.2.tgz", - "integrity": "sha512-k4ERKgw7aKGWJZgTarIcNEmvyTVD9FYh0mTrrBMHZ1b8hUu6iOJ4SzsZlo3UNAvHYa+PnvntIwRPt1/vy4nA9Q==", - "dependencies": { - "@formatjs/ecma402-abstract": "2.0.0", - "tslib": "^2.4.0" - } - }, - "node_modules/@formatjs/intl-localematcher": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.4.tgz", - "integrity": "sha512-zTwEpWOzZ2CiKcB93BLngUX59hQkuZjT2+SAQEscSm52peDW/getsawMcWF1rGRpMCX6D7nSJA3CzJ8gn13N/g==", - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", @@ -3640,21 +3250,6 @@ "safe-buffer": "^5.0.1" } }, - "node_modules/cli-color": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.4.tgz", - "integrity": "sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA==", - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.64", - "es6-iterator": "^2.0.3", - "memoizee": "^0.4.15", - "timers-ext": "^0.1.7" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/clone-response": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", @@ -3897,18 +3492,6 @@ "node": ">=4" } }, - "node_modules/d": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", - "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", - "dependencies": { - "es5-ext": "^0.10.64", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.12" - } - }, "node_modules/debug": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", @@ -4336,97 +3919,12 @@ "node": ">= 0.4" } }, - "node_modules/es5-ext": { - "version": "0.10.64", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", - "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", - "hasInstallScript": true, - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, "node_modules/es6-promise": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", "integrity": "sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==", "dev": true }, - "node_modules/es6-symbol": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz", - "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==", - "dependencies": { - "d": "^1.0.2", - "ext": "^1.7.0" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -4620,20 +4118,6 @@ "dev": true, "license": "MIT" }, - "node_modules/esniff": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -4709,15 +4193,6 @@ "individual": "^3.0.0" } }, - "node_modules/event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", - "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, "node_modules/eventemitter3": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", @@ -4741,14 +4216,6 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "dependencies": { - "type": "^2.7.2" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -5103,11 +4570,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globalyzer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", - "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==" - }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -5128,11 +4590,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globrex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", - "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==" - }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -5467,17 +4924,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "node_modules/intl-messageformat": { - "version": "10.5.14", - "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.5.14.tgz", - "integrity": "sha512-IjC6sI0X7YRjjyVH9aUgdftcmZK7WXdHeil4KwbjDnRWjnVitKpAx3rr6t6di1joFp5188VqKcobOPA6mCLG/w==", - "dependencies": { - "@formatjs/ecma402-abstract": "2.0.0", - "@formatjs/fast-memoize": "2.2.0", - "@formatjs/icu-messageformat-parser": "2.7.8", - "tslib": "^2.4.0" - } - }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -5635,11 +5081,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-promise": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", - "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==" - }, "node_modules/is-reference": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", @@ -5948,14 +5389,6 @@ "node": ">=10" } }, - "node_modules/lru-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", - "integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==", - "dependencies": { - "es5-ext": "~0.10.2" - } - }, "node_modules/lucide-static": { "version": "0.460.0", "resolved": "https://registry.npmjs.org/lucide-static/-/lucide-static-0.460.0.tgz", @@ -6123,24 +5556,6 @@ "svelte": "^3.56.0 || ^4.0.0 || ^5.0.0-next.120" } }, - "node_modules/memoizee": { - "version": "0.4.17", - "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.17.tgz", - "integrity": "sha512-DGqD7Hjpi/1or4F/aYAspXKNm5Yili0QDAFAY4QYvpqpgiY6+1jOfqpmByzjxbWd/T9mChbCArXAbDAsTm5oXA==", - "dependencies": { - "d": "^1.0.2", - "es5-ext": "^0.10.64", - "es6-weak-map": "^2.0.3", - "event-emitter": "^0.3.5", - "is-promise": "^2.2.2", - "lru-queue": "^0.1.0", - "next-tick": "^1.1.0", - "timers-ext": "^0.1.7" - }, - "engines": { - "node": ">=0.12" - } - }, "node_modules/meow": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", @@ -6339,6 +5754,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, "engines": { "node": ">=4" } @@ -6398,11 +5814,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" - }, "node_modules/node-releases": { "version": "2.0.19", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", @@ -7645,6 +7056,7 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dev": true, "dependencies": { "mri": "^1.1.0" }, @@ -8374,35 +7786,6 @@ "svelte": "^3.19.0 || ^4.0.0" } }, - "node_modules/svelte-i18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/svelte-i18n/-/svelte-i18n-4.0.1.tgz", - "integrity": "sha512-jaykGlGT5PUaaq04JWbJREvivlCnALtT+m87Kbm0fxyYHynkQaxQMnIKHLm2WeIuBRoljzwgyvz0Z6/CMwfdmQ==", - "license": "MIT", - "dependencies": { - "cli-color": "^2.0.3", - "deepmerge": "^4.2.2", - "esbuild": "^0.19.2", - "estree-walker": "^2", - "intl-messageformat": "^10.5.3", - "sade": "^1.8.1", - "tiny-glob": "^0.2.9" - }, - "bin": { - "svelte-i18n": "dist/cli.js" - }, - "engines": { - "node": ">= 16" - }, - "peerDependencies": { - "svelte": "^3 || ^4 || ^5" - } - }, - "node_modules/svelte-i18n/node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" - }, "node_modules/svelte-parse-markup": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/svelte-parse-markup/-/svelte-parse-markup-0.1.5.tgz", @@ -8676,27 +8059,6 @@ "node": ">=0.6.0" } }, - "node_modules/timers-ext": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.8.tgz", - "integrity": "sha512-wFH7+SEAcKfJpfLPkrgMPvvwnEtj8W4IurvEyrKsDleXnKLCDw71w8jltvfLa8Rm4qQxxT4jmDBYbJG/z7qoww==", - "dependencies": { - "es5-ext": "^0.10.64", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/tiny-glob": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", - "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", - "dependencies": { - "globalyzer": "0.1.0", - "globrex": "^0.1.2" - } - }, "node_modules/tinyqueue": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", @@ -9211,11 +8573,6 @@ "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", "dev": true }, - "node_modules/type": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", - "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==" - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/website/package.json b/website/package.json index 072a392a..89b48e42 100644 --- a/website/package.json +++ b/website/package.json @@ -74,7 +74,6 @@ "png.js": "^0.2.1", "sanitize-html": "^2.13.0", "sortablejs": "^1.15.3", - "svelte-i18n": "^4.0.0", "svelte-sonner": "^0.3.28", "tailwind-merge": "^2.5.2", "tailwind-variants": "^0.2.1" diff --git a/website/src/lib/components/AlgoliaDocSearch.svelte b/website/src/lib/components/AlgoliaDocSearch.svelte index afb909e9..95290559 100644 --- a/website/src/lib/components/AlgoliaDocSearch.svelte +++ b/website/src/lib/components/AlgoliaDocSearch.svelte @@ -2,7 +2,7 @@ import docsearch from '@docsearch/js'; import '@docsearch/css'; import { onMount } from 'svelte'; - import { _, locale, waitLocale } from 'svelte-i18n'; + import { _, locale, isLoadingLocale } from '$lib/i18n'; let mounted = false; @@ -13,7 +13,7 @@ indexName: 'gpx', container: '#docsearch', searchParameters: { - facetFilters: ['lang:' + ($locale ?? 'en')], + facetFilters: ['lang:' + $locale], }, placeholder: $_('docs.search.search'), disableUserPersonalization: true, @@ -48,8 +48,8 @@ mounted = true; }); - $: if (mounted && $locale) { - waitLocale().then(initDocsearch); + $: if (mounted && $locale && !$isLoadingLocale) { + initDocsearch(); } diff --git a/website/src/lib/components/ElevationProfile.svelte b/website/src/lib/components/ElevationProfile.svelte index c7f6c33f..9c7b08c8 100644 --- a/website/src/lib/components/ElevationProfile.svelte +++ b/website/src/lib/components/ElevationProfile.svelte @@ -20,7 +20,7 @@ Construction, } from 'lucide-svelte'; import { getSlopeColor, getSurfaceColor, getHighwayColor } from '$lib/assets/colors'; - import { _ } from 'svelte-i18n'; + import { _, df } from '$lib/i18n'; import { getCadenceWithUnits, getConvertedDistance, @@ -39,7 +39,6 @@ import type { GPXStatistics } from 'gpx'; import { settings } from '$lib/db'; import { mode } from 'mode-watcher'; - import { df } from '$lib/utils'; export let gpxStatistics: Writable; export let slicedGPXStatistics: Writable<[GPXStatistics, number, number] | undefined>; @@ -177,7 +176,7 @@ } if (point.time) { - labels.push(` ${$_('quantities.time')}: ${df.format(point.time)}`); + labels.push(` ${$_('quantities.time')}: ${$df.format(point.time)}`); } return labels; diff --git a/website/src/lib/components/Export.svelte b/website/src/lib/components/Export.svelte index 8d1bfe7b..29220a40 100644 --- a/website/src/lib/components/Export.svelte +++ b/website/src/lib/components/Export.svelte @@ -22,7 +22,7 @@ Thermometer, SquareActivity, } from 'lucide-svelte'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; import { selection } from './file-list/Selection'; import { get } from 'svelte/store'; import { GPXStatistics } from 'gpx'; diff --git a/website/src/lib/components/Footer.svelte b/website/src/lib/components/Footer.svelte index 7b04d77f..19e5ee9a 100644 --- a/website/src/lib/components/Footer.svelte +++ b/website/src/lib/components/Footer.svelte @@ -3,7 +3,7 @@ import LanguageSelect from '$lib/components/LanguageSelect.svelte'; import Logo from '$lib/components/Logo.svelte'; import { AtSign, BookOpenText, Heart, Home, Map } from 'lucide-svelte'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { getURLForLanguage } from '$lib/utils'; diff --git a/website/src/lib/components/GPXStatistics.svelte b/website/src/lib/components/GPXStatistics.svelte index d47a76be..d2876019 100644 --- a/website/src/lib/components/GPXStatistics.svelte +++ b/website/src/lib/components/GPXStatistics.svelte @@ -5,7 +5,7 @@ import { MoveDownRight, MoveUpRight, Ruler, Timer, Zap } from 'lucide-svelte'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; import type { GPXStatistics } from 'gpx'; import type { Writable } from 'svelte/store'; import { settings } from '$lib/db'; diff --git a/website/src/lib/components/Help.svelte b/website/src/lib/components/Help.svelte index abeb1814..04fa5f85 100644 --- a/website/src/lib/components/Help.svelte +++ b/website/src/lib/components/Help.svelte @@ -1,6 +1,6 @@ diff --git a/website/src/lib/components/LanguageSelect.svelte b/website/src/lib/components/LanguageSelect.svelte index b6cecd6d..4ecf793e 100644 --- a/website/src/lib/components/LanguageSelect.svelte +++ b/website/src/lib/components/LanguageSelect.svelte @@ -4,7 +4,7 @@ import { languages } from '$lib/languages'; import { getURLForLanguage } from '$lib/utils'; import { Languages } from 'lucide-svelte'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; let selected = { value: '', diff --git a/website/src/lib/components/Map.svelte b/website/src/lib/components/Map.svelte index 5b217abf..f3df0921 100644 --- a/website/src/lib/components/Map.svelte +++ b/website/src/lib/components/Map.svelte @@ -10,7 +10,7 @@ import { Button } from '$lib/components/ui/button'; import { map } from '$lib/stores'; import { settings } from '$lib/db'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; import { PUBLIC_MAPBOX_TOKEN } from '$env/static/public'; import { page } from '$app/stores'; diff --git a/website/src/lib/components/Menu.svelte b/website/src/lib/components/Menu.svelte index 5faa96b1..fd6fa306 100644 --- a/website/src/lib/components/Menu.svelte +++ b/website/src/lib/components/Menu.svelte @@ -74,7 +74,7 @@ import { allowedPastes, ListFileItem, ListTrackItem } from '$lib/components/file-list/FileList'; import Export from '$lib/components/Export.svelte'; import { mode, setMode, systemPrefersMode } from 'mode-watcher'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { languages } from '$lib/languages'; import { getURLForLanguage } from '$lib/utils'; @@ -450,7 +450,7 @@ {$_('menu.language')} - + {#each Object.entries(languages) as [lang, label]} {label} diff --git a/website/src/lib/components/ModeSwitch.svelte b/website/src/lib/components/ModeSwitch.svelte index 6ebe3531..a681315f 100644 --- a/website/src/lib/components/ModeSwitch.svelte +++ b/website/src/lib/components/ModeSwitch.svelte @@ -2,7 +2,7 @@ import { Button } from '$lib/components/ui/button'; import { Moon, Sun } from 'lucide-svelte'; import { mode, setMode, systemPrefersMode } from 'mode-watcher'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; export let size = '20'; diff --git a/website/src/lib/components/Nav.svelte b/website/src/lib/components/Nav.svelte index 1a414cdb..6dc6e223 100644 --- a/website/src/lib/components/Nav.svelte +++ b/website/src/lib/components/Nav.svelte @@ -4,7 +4,7 @@ import AlgoliaDocSearch from '$lib/components/AlgoliaDocSearch.svelte'; import ModeSwitch from '$lib/components/ModeSwitch.svelte'; import { BookOpenText, Home, Map } from 'lucide-svelte'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { getURLForLanguage } from '$lib/utils'; diff --git a/website/src/lib/components/Shortcut.svelte b/website/src/lib/components/Shortcut.svelte index 2588866c..8a2af7df 100644 --- a/website/src/lib/components/Shortcut.svelte +++ b/website/src/lib/components/Shortcut.svelte @@ -1,7 +1,7 @@ diff --git a/website/src/lib/components/embedding/EmbeddingPlayground.svelte b/website/src/lib/components/embedding/EmbeddingPlayground.svelte index f64b4f79..8997cf97 100644 --- a/website/src/lib/components/embedding/EmbeddingPlayground.svelte +++ b/website/src/lib/components/embedding/EmbeddingPlayground.svelte @@ -15,7 +15,7 @@ Milestone, Video, } from 'lucide-svelte'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; import { allowedEmbeddingBasemaps, getCleanedEmbeddingOptions, diff --git a/website/src/lib/components/embedding/OpenIn.svelte b/website/src/lib/components/embedding/OpenIn.svelte index bf6d8518..9081615a 100644 --- a/website/src/lib/components/embedding/OpenIn.svelte +++ b/website/src/lib/components/embedding/OpenIn.svelte @@ -2,7 +2,7 @@ import { Button } from '$lib/components/ui/button'; import Logo from '$lib/components/Logo.svelte'; import { getURLForLanguage } from '$lib/utils'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; export let files: string[]; export let ids: string[]; diff --git a/website/src/lib/components/file-list/FileList.svelte b/website/src/lib/components/file-list/FileList.svelte index 70de33cf..944be85d 100644 --- a/website/src/lib/components/file-list/FileList.svelte +++ b/website/src/lib/components/file-list/FileList.svelte @@ -8,7 +8,7 @@ import { copied, pasteSelection, selectAll, selection } from './Selection'; import { ClipboardPaste, FileStack, Plus } from 'lucide-svelte'; import Shortcut from '$lib/components/Shortcut.svelte'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; import { createFile } from '$lib/stores'; export let orientation: 'vertical' | 'horizontal'; diff --git a/website/src/lib/components/file-list/FileListNode.svelte b/website/src/lib/components/file-list/FileListNode.svelte index ce02017d..9eb71a14 100644 --- a/website/src/lib/components/file-list/FileListNode.svelte +++ b/website/src/lib/components/file-list/FileListNode.svelte @@ -21,7 +21,7 @@ type ListItem, type ListTrackItem, } from './FileList'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; import { selection } from './Selection'; export let node: diff --git a/website/src/lib/components/file-list/FileListNodeContent.svelte b/website/src/lib/components/file-list/FileListNodeContent.svelte index 712c9733..1c238b94 100644 --- a/website/src/lib/components/file-list/FileListNodeContent.svelte +++ b/website/src/lib/components/file-list/FileListNodeContent.svelte @@ -23,7 +23,7 @@ } from './FileList'; import { selection } from './Selection'; import { isMac } from '$lib/utils'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; export let node: | Map> diff --git a/website/src/lib/components/file-list/FileListNodeLabel.svelte b/website/src/lib/components/file-list/FileListNodeLabel.svelte index 208ceb31..56eefce5 100644 --- a/website/src/lib/components/file-list/FileListNodeLabel.svelte +++ b/website/src/lib/components/file-list/FileListNodeLabel.svelte @@ -50,7 +50,7 @@ map, } from '$lib/stores'; import { GPXTreeElement, Track, type AnyGPXTreeElement, Waypoint, GPXFile } from 'gpx'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; import MetadataDialog from './MetadataDialog.svelte'; import StyleDialog from './StyleDialog.svelte'; import { waypointPopup } from '$lib/components/gpx-layer/GPXLayerPopup'; diff --git a/website/src/lib/components/file-list/MetadataDialog.svelte b/website/src/lib/components/file-list/MetadataDialog.svelte index 4f50e12d..922cb907 100644 --- a/website/src/lib/components/file-list/MetadataDialog.svelte +++ b/website/src/lib/components/file-list/MetadataDialog.svelte @@ -8,7 +8,7 @@ import { Save } from 'lucide-svelte'; import { ListFileItem, ListTrackItem, type ListItem } from './FileList'; import { GPXTreeElement, Track, type AnyGPXTreeElement, Waypoint, GPXFile } from 'gpx'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; import { editMetadata } from '$lib/stores'; export let node: GPXTreeElement | Waypoint[] | Waypoint; diff --git a/website/src/lib/components/file-list/StyleDialog.svelte b/website/src/lib/components/file-list/StyleDialog.svelte index f0c6d749..a738b580 100644 --- a/website/src/lib/components/file-list/StyleDialog.svelte +++ b/website/src/lib/components/file-list/StyleDialog.svelte @@ -9,7 +9,7 @@ import { ListFileItem, ListTrackItem, type ListItem } from './FileList'; import { selection } from './Selection'; import { editStyle, gpxLayers } from '$lib/stores'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; export let item: ListItem; export let open = false; diff --git a/website/src/lib/components/gpx-layer/CopyCoordinates.svelte b/website/src/lib/components/gpx-layer/CopyCoordinates.svelte index 051f7f28..8fce503d 100644 --- a/website/src/lib/components/gpx-layer/CopyCoordinates.svelte +++ b/website/src/lib/components/gpx-layer/CopyCoordinates.svelte @@ -1,7 +1,7 @@ @@ -31,7 +30,7 @@ {#if trackpoint.item.time}
- {df.format(trackpoint.item.time)} + {$df.format(trackpoint.item.time)}
{/if} diff --git a/website/src/lib/components/toolbar/tools/Clean.svelte b/website/src/lib/components/toolbar/tools/Clean.svelte index 32052f4f..db6ef88c 100644 --- a/website/src/lib/components/toolbar/tools/Clean.svelte +++ b/website/src/lib/components/toolbar/tools/Clean.svelte @@ -11,7 +11,7 @@ import * as RadioGroup from '$lib/components/ui/radio-group'; import { Button } from '$lib/components/ui/button'; import Help from '$lib/components/Help.svelte'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { onDestroy, onMount } from 'svelte'; import { getURLForLanguage, resetCursor, setCrosshairCursor } from '$lib/utils'; import { Trash2 } from 'lucide-svelte'; diff --git a/website/src/lib/components/toolbar/tools/Elevation.svelte b/website/src/lib/components/toolbar/tools/Elevation.svelte index eba87b34..43a987f9 100644 --- a/website/src/lib/components/toolbar/tools/Elevation.svelte +++ b/website/src/lib/components/toolbar/tools/Elevation.svelte @@ -5,7 +5,7 @@ import { MountainSnow } from 'lucide-svelte'; import { dbUtils } from '$lib/db'; import { map } from '$lib/stores'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { getURLForLanguage } from '$lib/utils'; $: validSelection = $selection.size > 0; diff --git a/website/src/lib/components/toolbar/tools/Extract.svelte b/website/src/lib/components/toolbar/tools/Extract.svelte index 7f2dcc88..58056810 100644 --- a/website/src/lib/components/toolbar/tools/Extract.svelte +++ b/website/src/lib/components/toolbar/tools/Extract.svelte @@ -11,7 +11,7 @@ } from '$lib/components/file-list/FileList'; import Help from '$lib/components/Help.svelte'; import { dbUtils, getFile } from '$lib/db'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { getURLForLanguage } from '$lib/utils'; $: validSelection = diff --git a/website/src/lib/components/toolbar/tools/Merge.svelte b/website/src/lib/components/toolbar/tools/Merge.svelte index 91dfea06..84f21e90 100644 --- a/website/src/lib/components/toolbar/tools/Merge.svelte +++ b/website/src/lib/components/toolbar/tools/Merge.svelte @@ -13,7 +13,7 @@ import { Label } from '$lib/components/ui/label/index.js'; import { Checkbox } from '$lib/components/ui/checkbox'; import * as RadioGroup from '$lib/components/ui/radio-group'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { dbUtils, getFile } from '$lib/db'; import { Group } from 'lucide-svelte'; import { getURLForLanguage } from '$lib/utils'; diff --git a/website/src/lib/components/toolbar/tools/Reduce.svelte b/website/src/lib/components/toolbar/tools/Reduce.svelte index 5763084e..0960cf78 100644 --- a/website/src/lib/components/toolbar/tools/Reduce.svelte +++ b/website/src/lib/components/toolbar/tools/Reduce.svelte @@ -10,7 +10,7 @@ } from '$lib/components/file-list/FileList'; import Help from '$lib/components/Help.svelte'; import { Filter } from 'lucide-svelte'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import WithUnits from '$lib/components/WithUnits.svelte'; import { dbUtils, fileObservers } from '$lib/db'; import { map } from '$lib/stores'; diff --git a/website/src/lib/components/toolbar/tools/Time.svelte b/website/src/lib/components/toolbar/tools/Time.svelte index 821ad5d9..8fada452 100644 --- a/website/src/lib/components/toolbar/tools/Time.svelte +++ b/website/src/lib/components/toolbar/tools/Time.svelte @@ -16,7 +16,7 @@ import { CalendarDate, type DateValue } from '@internationalized/date'; import { CalendarClock, CirclePlay, CircleStop, CircleX, Timer, Zap } from 'lucide-svelte'; import { tick } from 'svelte'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { get } from 'svelte/store'; import { selection } from '$lib/components/file-list/Selection'; import { diff --git a/website/src/lib/components/toolbar/tools/Waypoint.svelte b/website/src/lib/components/toolbar/tools/Waypoint.svelte index 96c734fa..270c5579 100644 --- a/website/src/lib/components/toolbar/tools/Waypoint.svelte +++ b/website/src/lib/components/toolbar/tools/Waypoint.svelte @@ -12,7 +12,7 @@ import * as Select from '$lib/components/ui/select'; import { selection } from '$lib/components/file-list/Selection'; import { Waypoint } from 'gpx'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { ListWaypointItem } from '$lib/components/file-list/FileList'; import { dbUtils, fileObservers, getFile, settings, type GPXFileWithStatistics } from '$lib/db'; import { get } from 'svelte/store'; diff --git a/website/src/lib/components/toolbar/tools/routing/Routing.svelte b/website/src/lib/components/toolbar/tools/routing/Routing.svelte index f4bc61e6..7c53f7e3 100644 --- a/website/src/lib/components/toolbar/tools/routing/Routing.svelte +++ b/website/src/lib/components/toolbar/tools/routing/Routing.svelte @@ -26,7 +26,7 @@ import { dbUtils, getFile, getFileIds, settings } from '$lib/db'; import { brouterProfiles, routingProfileSelectItem } from './Routing'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { RoutingControls } from './RoutingControls'; import mapboxgl from 'mapbox-gl'; import { fileObservers } from '$lib/db'; diff --git a/website/src/lib/components/toolbar/tools/routing/Routing.ts b/website/src/lib/components/toolbar/tools/routing/Routing.ts index e658e1a1..cb2a8467 100644 --- a/website/src/lib/components/toolbar/tools/routing/Routing.ts +++ b/website/src/lib/components/toolbar/tools/routing/Routing.ts @@ -2,7 +2,7 @@ import type { Coordinates } from 'gpx'; import { TrackPoint, distance } from 'gpx'; import { derived, get, writable } from 'svelte/store'; import { settings } from '$lib/db'; -import { _, isLoading, locale } from 'svelte-i18n'; +import { _, locale, isLoadingLocale } from '$lib/i18n'; import { getElevation } from '$lib/utils'; const { routing, routingProfile, privateRoads } = settings; @@ -22,7 +22,7 @@ export const routingProfileSelectItem = writable({ label: '', }); -derived([routingProfile, locale, isLoading], ([profile, l, i]) => [profile, l, i]).subscribe( +derived([routingProfile, locale, isLoadingLocale], ([profile, l, i]) => [profile, l, i]).subscribe( ([profile, l, i]) => { if ( !i && diff --git a/website/src/lib/components/toolbar/tools/routing/RoutingControlPopup.svelte b/website/src/lib/components/toolbar/tools/routing/RoutingControlPopup.svelte index a695fe5d..9e887f1f 100644 --- a/website/src/lib/components/toolbar/tools/routing/RoutingControlPopup.svelte +++ b/website/src/lib/components/toolbar/tools/routing/RoutingControlPopup.svelte @@ -5,7 +5,7 @@ import { canChangeStart } from './RoutingControls'; import { CirclePlay, Trash2 } from 'lucide-svelte'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; export let element: HTMLElement; diff --git a/website/src/lib/components/toolbar/tools/routing/RoutingControls.ts b/website/src/lib/components/toolbar/tools/routing/RoutingControls.ts index 2f7fcd13..1380323f 100644 --- a/website/src/lib/components/toolbar/tools/routing/RoutingControls.ts +++ b/website/src/lib/components/toolbar/tools/routing/RoutingControls.ts @@ -3,7 +3,7 @@ import { get, writable, type Readable } from 'svelte/store'; import mapboxgl from 'mapbox-gl'; import { route } from './Routing'; import { toast } from 'svelte-sonner'; -import { _ } from 'svelte-i18n'; +import { _ } from '$lib/i18n'; import { dbUtils, settings, type GPXFileWithStatistics } from '$lib/db'; import { getOrderedSelection, selection } from '$lib/components/file-list/Selection'; import { diff --git a/website/src/lib/components/toolbar/tools/scissors/Scissors.svelte b/website/src/lib/components/toolbar/tools/scissors/Scissors.svelte index edc53636..a6f2dd83 100644 --- a/website/src/lib/components/toolbar/tools/scissors/Scissors.svelte +++ b/website/src/lib/components/toolbar/tools/scissors/Scissors.svelte @@ -17,7 +17,7 @@ import { Separator } from '$lib/components/ui/separator'; import { gpxStatistics, map, slicedGPXStatistics, splitAs } from '$lib/stores'; import { get } from 'svelte/store'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { onDestroy, tick } from 'svelte'; import { Crop } from 'lucide-svelte'; import { dbUtils } from '$lib/db'; diff --git a/website/src/lib/components/toolbar/tools/scissors/SplitControls.ts b/website/src/lib/components/toolbar/tools/scissors/SplitControls.ts index aa8ac8fd..dcb6dc0a 100644 --- a/website/src/lib/components/toolbar/tools/scissors/SplitControls.ts +++ b/website/src/lib/components/toolbar/tools/scissors/SplitControls.ts @@ -8,7 +8,7 @@ import { } from '$lib/components/file-list/Selection'; import { ListTrackSegmentItem } from '$lib/components/file-list/FileList'; import { currentTool, gpxStatistics, Tool } from '$lib/stores'; -import { _ } from 'svelte-i18n'; +import { _ } from '$lib/i18n'; import { Scissors } from 'lucide-static'; export class SplitControls { diff --git a/website/src/lib/i18n.ts b/website/src/lib/i18n.ts new file mode 100644 index 00000000..91efd6b6 --- /dev/null +++ b/website/src/lib/i18n.ts @@ -0,0 +1,56 @@ +import { derived, writable, get } from 'svelte/store'; + +export const locale = writable(''); + +type Dictionary = { + [key: string]: string | Dictionary; +}; +export const dictionary = writable({}); + +export const isLoadingInitialLocale = writable(true); +export const isLoadingLocale = writable(true); + +locale.subscribe((lang) => { + if (lang !== '') { + if (!get(isLoadingLocale)) { + isLoadingLocale.set(true); + } + import(`../locales/${lang}.json`).then((module) => { + dictionary.set(module.default); + if (get(isLoadingInitialLocale)) { + isLoadingInitialLocale.set(false); + } + if (get(isLoadingLocale)) { + isLoadingLocale.set(false); + } + }); + } +}); + +export const _ = derived(dictionary, ($dictionary) => { + return (key: string) => { + const keys = key.split('.'); + let value: string | Dictionary = $dictionary; + + for (const k of keys) { + if (value && typeof value === 'object' && k in value) { + value = value[k]; + } else { + return key; + } + } + + return typeof value === 'string' ? value : key; + }; +}); + +function getDateFormatter(locale: string) { + return new Intl.DateTimeFormat(locale, { + dateStyle: 'medium', + timeStyle: 'medium', + }); +} + +export const df = derived(locale, ($locale) => { + return getDateFormatter($locale === '' ? 'en-US' : $locale); +}); diff --git a/website/src/lib/stores.ts b/website/src/lib/stores.ts index 739aff42..9b83671f 100644 --- a/website/src/lib/stores.ts +++ b/website/src/lib/stores.ts @@ -3,7 +3,7 @@ import { writable, get, type Writable, derived } from 'svelte/store'; import mapboxgl from 'mapbox-gl'; import { GPXFile, buildGPX, parseGPX, GPXStatistics, type Coordinates } from 'gpx'; import { tick } from 'svelte'; -import { _ } from 'svelte-i18n'; +import { _ } from '$lib/i18n'; import type { GPXLayer } from '$lib/components/gpx-layer/GPXLayer'; import { dbUtils, fileObservers, getFile, getStatistics, settings } from './db'; import { diff --git a/website/src/lib/units.ts b/website/src/lib/units.ts index d0909746..97f53d9e 100644 --- a/website/src/lib/units.ts +++ b/website/src/lib/units.ts @@ -1,6 +1,6 @@ import { get } from 'svelte/store'; import { settings } from '$lib/db'; -import { _ } from 'svelte-i18n'; +import { _ } from '$lib/i18n'; const { distanceUnits, velocityUnits, temperatureUnits } = settings; diff --git a/website/src/lib/utils.ts b/website/src/lib/utils.ts index 27efd6a3..d825b853 100644 --- a/website/src/lib/utils.ts +++ b/website/src/lib/utils.ts @@ -6,13 +6,11 @@ import { get } from 'svelte/store'; import { map } from './stores'; import { base } from '$app/paths'; import { languages } from '$lib/languages'; -import { locale } from 'svelte-i18n'; import { TrackPoint, Waypoint, type Coordinates, crossarcDistance, distance } from 'gpx'; import mapboxgl from 'mapbox-gl'; import tilebelt from '@mapbox/tilebelt'; import { PUBLIC_MAPBOX_TOKEN } from '$env/static/public'; import PNGReader from 'png.js'; -import type { DateFormatter } from '@internationalized/date'; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); @@ -219,7 +217,7 @@ export function isSafari() { return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); } -export function getURLForLanguage(lang: string | null | undefined, path: string): string { +export function getURLForLanguage(lang: string, path: string): string { let newPath = path.replace(base, ''); let languageInPath = newPath.split('/')[1]; @@ -227,13 +225,6 @@ export function getURLForLanguage(lang: string | null | undefined, path: string) languageInPath = 'en'; } - if (lang === null || lang === undefined) { - lang = get(locale); - if (lang === null || lang === undefined) { - lang = 'en'; - } - } - if (newPath === '/' && lang !== 'en') { newPath = ''; } @@ -254,15 +245,3 @@ export function getURLForLanguage(lang: string | null | undefined, path: string) } } } - -function getDateFormatter(locale: string) { - return new Intl.DateTimeFormat(locale, { - dateStyle: 'medium', - timeStyle: 'medium', - }); -} - -export let df: DateFormatter = getDateFormatter('en'); -locale.subscribe((l) => { - df = getDateFormatter(l ?? 'en'); -}); diff --git a/website/src/routes/+layout.js b/website/src/routes/+layout.js deleted file mode 100644 index 63b65839..00000000 --- a/website/src/routes/+layout.js +++ /dev/null @@ -1,13 +0,0 @@ -export const prerender = true; - -import { languages } from '$lib/languages'; -import { register, init } from 'svelte-i18n'; - -Object.keys(languages).forEach((lang) => { - register(lang, () => import(`../locales/${lang}.json`)); -}); - -init({ - fallbackLocale: 'en', - initialLocale: 'en', -}); diff --git a/website/src/routes/+layout.svelte b/website/src/routes/+layout.svelte index cab9a38c..c54f2556 100644 --- a/website/src/routes/+layout.svelte +++ b/website/src/routes/+layout.svelte @@ -1,7 +1,7 @@
diff --git a/website/src/routes/[[language]]/+page.svelte b/website/src/routes/[[language]]/+page.svelte index d872faf4..5e89b042 100644 --- a/website/src/routes/[[language]]/+page.svelte +++ b/website/src/routes/[[language]]/+page.svelte @@ -15,7 +15,7 @@ Route, Scale, } from 'lucide-svelte'; - import { _, locale } from 'svelte-i18n'; + import { _, locale } from '$lib/i18n'; import { getURLForLanguage } from '$lib/utils'; import { exampleGPXFile } from '$lib/assets/example'; import { writable } from 'svelte/store'; diff --git a/website/src/routes/[[language]]/app/+page.svelte b/website/src/routes/[[language]]/app/+page.svelte index c1a8e6f1..4acbcd22 100644 --- a/website/src/routes/[[language]]/app/+page.svelte +++ b/website/src/routes/[[language]]/app/+page.svelte @@ -18,7 +18,7 @@ import { languages } from '$lib/languages'; import { getURLForLanguage } from '$lib/utils'; import { getURLForGoogleDriveFile } from '$lib/components/embedding/Embedding'; - import { _ } from 'svelte-i18n'; + import { _ } from '$lib/i18n'; const { treeFileView, diff --git a/website/src/routes/[[language]]/help/+layout.svelte b/website/src/routes/[[language]]/help/+layout.svelte index 8054cef7..b5f492e8 100644 --- a/website/src/routes/[[language]]/help/+layout.svelte +++ b/website/src/routes/[[language]]/help/+layout.svelte @@ -1,7 +1,7 @@