mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2025-12-12 13:56:16 +00:00
feat: i18n
This commit is contained in:
5
.typesafe-i18n.json
Normal file
5
.typesafe-i18n.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/typesafe-i18n@5.25.1/schema/typesafe-i18n.json",
|
||||
"baseLocale": "en",
|
||||
"adapter": "svelte"
|
||||
}
|
||||
@@ -56,6 +56,7 @@ const config: IconsConfig = {
|
||||
"dark_mode",
|
||||
"light_mode",
|
||||
"palette",
|
||||
"translate",
|
||||
],
|
||||
codePoints: {
|
||||
speed: "e9e4",
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/**
|
||||
* @type {import('@inlang/core/config').DefineConfig}
|
||||
*/
|
||||
export async function defineConfig(env) {
|
||||
const {default: pluginYaml} = await env.$import(
|
||||
"https://cdn.jsdelivr.net/gh/felixhaeberle/inlang-plugin-yaml@2.0.1/dist/index.js",
|
||||
)
|
||||
const {default: sdkPlugin} = await env.$import(
|
||||
"https://cdn.jsdelivr.net/npm/@inlang/sdk-js-plugin@0.10.1/dist/index.js",
|
||||
)
|
||||
|
||||
return {
|
||||
referenceLanguage: "en",
|
||||
plugins: [
|
||||
sdkPlugin({
|
||||
languageNegotiation: {
|
||||
strategies: [{type: "localStorage"}],
|
||||
},
|
||||
}),
|
||||
pluginYaml({
|
||||
pathPattern: "./languages/{language}.yml",
|
||||
}),
|
||||
],
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
title: amaCC1ng
|
||||
@@ -1 +0,0 @@
|
||||
title: amaCC1ng
|
||||
489
package-lock.json
generated
489
package-lock.json
generated
@@ -11,7 +11,6 @@
|
||||
"devDependencies": {
|
||||
"@fontsource-variable/material-symbols-rounded": "^5.0.4",
|
||||
"@fontsource-variable/noto-sans-mono": "^5.0.4",
|
||||
"@inlang/sdk-js": "^0.10.1",
|
||||
"@material/material-color-utilities": "^0.2.7",
|
||||
"@modyfi/vite-plugin-yaml": "^1.0.4",
|
||||
"@sveltejs/adapter-static": "^2.0.2",
|
||||
@@ -26,6 +25,7 @@
|
||||
"fontkit": "^2.0.2",
|
||||
"glob": "^10.3.1",
|
||||
"jsdom": "^22.1.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.8.0",
|
||||
"prettier-plugin-svelte": "^2.10.1",
|
||||
"sass": "^1.63.6",
|
||||
@@ -40,6 +40,7 @@
|
||||
"svelte-preprocess": "^5.0.4",
|
||||
"tippy.js": "^6.3.7",
|
||||
"ts-node": "^10.9.1",
|
||||
"typesafe-i18n": "^5.25.1",
|
||||
"typescript": "^5.0.0",
|
||||
"vite": "^4.3.6",
|
||||
"vite-plugin-mkcert": "^1.16.0",
|
||||
@@ -1954,31 +1955,6 @@
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild-plugins/node-modules-polyfill": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild-plugins/node-modules-polyfill/-/node-modules-polyfill-0.2.2.tgz",
|
||||
"integrity": "sha512-LXV7QsWJxRuMYvKbiznh+U1ilIop3g2TeKRzUxOG5X3YITc8JyyTa90BmLwqqv0YnX4v32CSlG+vsziZp9dMvA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"rollup-plugin-node-polyfills": "^0.2.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"esbuild": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild-plugins/node-modules-polyfill/node_modules/escape-string-regexp": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
|
||||
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz",
|
||||
@@ -2343,50 +2319,6 @@
|
||||
"integrity": "sha512-CC5p/9/OF3hep8EsSD0UKYMCaA58nqjm4vRKnwvmvHZPA9jFif6q1lRkmI2nx8C30UkdVA1L7JvOUmCUu+RgNA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@inlang-git/fs": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@inlang-git/fs/-/fs-0.0.4.tgz",
|
||||
"integrity": "sha512-VGBV8N6wJpb1xHA9dR5qETxaAeDENhN9+KIicNFSazk3OUNjrn/L237+FEXuQyfzwkIsC4T0Mx+qbc0w1/4pqQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"js-base64": "^3.7.5",
|
||||
"outmatch": "^0.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@inlang/core": {
|
||||
"version": "0.9.2",
|
||||
"resolved": "https://registry.npmjs.org/@inlang/core/-/core-0.9.2.tgz",
|
||||
"integrity": "sha512-NF6jeEMO3HHhkOVCDM0AvWWF36KXXPUm5C4H0IamLQl05dzo0vdk6x8P3eTX4wopEHc0slgE0+I2myvuZQE6dg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
||||
"@inlang-git/fs": "^0.0.4",
|
||||
"deepmerge-ts": "^5.1.0",
|
||||
"ts-dedent": "^2.2.0",
|
||||
"zod": "^3.21.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.15.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@inlang/sdk-js": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@inlang/sdk-js/-/sdk-js-0.10.1.tgz",
|
||||
"integrity": "sha512-AfJ3xss2WKn8h0xEUw33737hWV6YtA21twi+npdawUovVBTCDJP0d5TPggpsZZjYaEJywn24ZkCM7KnBCtRmaw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@inlang/core": "*",
|
||||
"ts-morph": "^19.0.0",
|
||||
"typescript": "^5.1.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@sveltejs/kit": "^1.0.0",
|
||||
"svelte": "^3.54.0 || ^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/cliui": {
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
||||
@@ -2949,57 +2881,6 @@
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@ts-morph/common": {
|
||||
"version": "0.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.20.0.tgz",
|
||||
"integrity": "sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fast-glob": "^3.2.12",
|
||||
"minimatch": "^7.4.3",
|
||||
"mkdirp": "^2.1.6",
|
||||
"path-browserify": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@ts-morph/common/node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@ts-morph/common/node_modules/minimatch": {
|
||||
"version": "7.4.6",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz",
|
||||
"integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/@ts-morph/common/node_modules/mkdirp": {
|
||||
"version": "2.1.6",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz",
|
||||
"integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"mkdirp": "dist/cjs/src/bin.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/@tsconfig/node10": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
|
||||
@@ -4083,12 +3964,6 @@
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/code-block-writer": {
|
||||
"version": "12.0.0",
|
||||
"resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-12.0.0.tgz",
|
||||
"integrity": "sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/code-red": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.3.tgz",
|
||||
@@ -4708,15 +4583,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/deepmerge-ts": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-5.1.0.tgz",
|
||||
"integrity": "sha512-eS8dRJOckyo9maw9Tu5O5RUi/4inFLrnoLkBe3cPfDMx3WZioXtmOew4TXQaxq7Rhl4xjDtR7c6x8nNTxOvbFw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/define-properties": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz",
|
||||
@@ -6687,12 +6553,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/js-base64": {
|
||||
"version": "3.7.5",
|
||||
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz",
|
||||
"integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/js-tokens": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.1.tgz",
|
||||
@@ -6806,6 +6666,12 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/json-parse-better-errors": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
|
||||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/json-parse-even-better-errors": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
|
||||
@@ -6932,6 +6798,43 @@
|
||||
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/load-json-file": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
|
||||
"integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
"parse-json": "^4.0.0",
|
||||
"pify": "^3.0.0",
|
||||
"strip-bom": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/load-json-file/node_modules/parse-json": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
|
||||
"integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"error-ex": "^1.3.1",
|
||||
"json-parse-better-errors": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/load-json-file/node_modules/pify": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/local-pkg": {
|
||||
"version": "0.4.3",
|
||||
"resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz",
|
||||
@@ -7210,6 +7113,15 @@
|
||||
"integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/memorystream": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
|
||||
"integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/meow": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz",
|
||||
@@ -7425,6 +7337,12 @@
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/nice-try": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
|
||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.12",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz",
|
||||
@@ -7506,6 +7424,139 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all": {
|
||||
"version": "4.1.5",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz",
|
||||
"integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"chalk": "^2.4.1",
|
||||
"cross-spawn": "^6.0.5",
|
||||
"memorystream": "^0.3.1",
|
||||
"minimatch": "^3.0.4",
|
||||
"pidtree": "^0.3.0",
|
||||
"read-pkg": "^3.0.0",
|
||||
"shell-quote": "^1.6.1",
|
||||
"string.prototype.padend": "^3.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"npm-run-all": "bin/npm-run-all/index.js",
|
||||
"run-p": "bin/run-p/index.js",
|
||||
"run-s": "bin/run-s/index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/cross-spawn": {
|
||||
"version": "6.0.5",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
||||
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"nice-try": "^1.0.4",
|
||||
"path-key": "^2.0.1",
|
||||
"semver": "^5.5.0",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.8"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/hosted-git-info": {
|
||||
"version": "2.8.9",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
|
||||
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/normalize-package-data": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
|
||||
"integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"hosted-git-info": "^2.1.4",
|
||||
"resolve": "^1.10.0",
|
||||
"semver": "2 || 3 || 4 || 5",
|
||||
"validate-npm-package-license": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/path-key": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/path-type": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
|
||||
"integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"pify": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/pify": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/read-pkg": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
|
||||
"integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"load-json-file": "^4.0.0",
|
||||
"normalize-package-data": "^2.3.2",
|
||||
"path-type": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/semver": {
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/shebang-command": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
||||
"integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"shebang-regex": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/shebang-regex": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
||||
"integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nwsapi": {
|
||||
"version": "2.2.7",
|
||||
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz",
|
||||
@@ -7578,12 +7629,6 @@
|
||||
"integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/outmatch": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/outmatch/-/outmatch-0.7.0.tgz",
|
||||
"integrity": "sha512-w1ybiTBffGiwxOO7JJBVVOsIiWwzcfSl/D80amWAU2UDe1o9/SySOUzAwDuN3+jGKQRs0UCDTS8rndFiroJgVQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
||||
@@ -7683,12 +7728,6 @@
|
||||
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/path-browserify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
|
||||
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/path-exists": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||
@@ -7812,6 +7851,18 @@
|
||||
"url": "https://github.com/sponsors/jonschlinkert"
|
||||
}
|
||||
},
|
||||
"node_modules/pidtree": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz",
|
||||
"integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"pidtree": "bin/pidtree.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/pify": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
@@ -8427,57 +8478,6 @@
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-plugin-inject": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz",
|
||||
"integrity": "sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==",
|
||||
"deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"estree-walker": "^0.6.1",
|
||||
"magic-string": "^0.25.3",
|
||||
"rollup-pluginutils": "^2.8.1"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-plugin-inject/node_modules/estree-walker": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz",
|
||||
"integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/rollup-plugin-inject/node_modules/magic-string": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz",
|
||||
"integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"sourcemap-codec": "^1.4.8"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-plugin-node-polyfills": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz",
|
||||
"integrity": "sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"rollup-plugin-inject": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-pluginutils": {
|
||||
"version": "2.8.2",
|
||||
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
|
||||
"integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"estree-walker": "^0.6.1"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-pluginutils/node_modules/estree-walker": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz",
|
||||
"integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/rrweb-cssom": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz",
|
||||
@@ -8660,6 +8660,15 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/shell-quote": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz",
|
||||
"integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==",
|
||||
"dev": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
|
||||
@@ -8953,6 +8962,23 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/string.prototype.padend": {
|
||||
"version": "3.1.4",
|
||||
"resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.4.tgz",
|
||||
"integrity": "sha512-67otBXoksdjsnXXRUq+KMVTdlVRZ2af422Y0aTyTjVaoQkGr3mxl2Bc5emi7dOQ3OGVVQQskmLEWwFXwommpNw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"define-properties": "^1.1.4",
|
||||
"es-abstract": "^1.20.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/string.prototype.trim": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz",
|
||||
@@ -9037,6 +9063,15 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-bom": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
|
||||
"integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-comments": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-comments/-/strip-comments-2.0.1.tgz",
|
||||
@@ -9745,25 +9780,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-dedent": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.2.0.tgz",
|
||||
"integrity": "sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.10"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-morph": {
|
||||
"version": "19.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-19.0.0.tgz",
|
||||
"integrity": "sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@ts-morph/common": "~0.20.0",
|
||||
"code-block-writer": "^12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-node": {
|
||||
"version": "10.9.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz",
|
||||
@@ -9866,6 +9882,22 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/typesafe-i18n": {
|
||||
"version": "5.25.1",
|
||||
"resolved": "https://registry.npmjs.org/typesafe-i18n/-/typesafe-i18n-5.25.1.tgz",
|
||||
"integrity": "sha512-mee0wqW8KQBnrE9LNO0TgKwEAh3iJ5qc356WkA8grtau9E3HKL1EEeWBe2WotaGR7wkjjPcjfkTFeBF+9opV1Q==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"typesafe-i18n": "cli/typesafe-i18n.mjs"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ivanhofer"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=3.5.1"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.1.6",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz",
|
||||
@@ -11008,15 +11040,6 @@
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "3.21.4",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz",
|
||||
"integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==",
|
||||
"dev": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"dev": "npm-run-all --parallel vite typesafe-i18n",
|
||||
"vite": "vite dev",
|
||||
"build": "vite build",
|
||||
"test": "vitest run --coverage",
|
||||
"preview": "vite preview",
|
||||
@@ -12,13 +13,13 @@
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
||||
"minify-icons": "ts-node-esm src/tools/minify-icon-font.ts",
|
||||
"lint": "prettier --plugin-search-dir . --check .",
|
||||
"format": "prettier --plugin-search-dir . --write ."
|
||||
"format": "prettier --plugin-search-dir . --write .",
|
||||
"typesafe-i18n": "typesafe-i18n"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@theaninova/prettier-config": "^1.0.0",
|
||||
"@types/w3c-web-serial": "^1.0.3",
|
||||
"@vite-pwa/sveltekit": "^0.2.5",
|
||||
"@inlang/sdk-js": "^0.10.1",
|
||||
"@fontsource-variable/noto-sans-mono": "^5.0.4",
|
||||
"@fontsource-variable/material-symbols-rounded": "^5.0.4",
|
||||
"stylelint": "^15.9.0",
|
||||
@@ -42,6 +43,8 @@
|
||||
"svelte-check": "^3.4.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.0.0",
|
||||
"typesafe-i18n": "^5.25.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"vitest": "^0.33.0",
|
||||
"vite": "^4.3.6",
|
||||
"vite-plugin-pwa": "^0.16.4",
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
/* This file was created by inlang.
|
||||
It is needed in order to circumvent a current limitation of SvelteKit. See https://github.com/inlang/inlang/issues/647
|
||||
You can remove this comment and modify the file as you like. We just need to make sure it exists.
|
||||
Please do not delete it (inlang will recreate it if needed). */
|
||||
1
src/i18n/.gitignore
vendored
Normal file
1
src/i18n/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
i18n-*.ts
|
||||
53
src/i18n/de/index.ts
Normal file
53
src/i18n/de/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type {Translation} from "../i18n-types"
|
||||
|
||||
const de = {
|
||||
TITLE: "amaCC1ng",
|
||||
backup: {
|
||||
TITLE: "Sicherungskopie",
|
||||
DISCLAIMER:
|
||||
"Sicherungskopien verlassen unter keinen Umständen diesen Computer und werden nie mit uns geteilt oder auf Server hochgeladen.",
|
||||
DOWNLOAD: "Kopie Speichern",
|
||||
RESTORE: "Wiederherstellen",
|
||||
},
|
||||
deviceManager: {
|
||||
TITLE: "Gerät",
|
||||
AUTO_CONNECT: "Automatisch Verbinden",
|
||||
CONNECT: "Verbinden",
|
||||
DISCONNECT: "Entfernen",
|
||||
TERMINAL: "Konsole",
|
||||
bootMenu: {
|
||||
TITLE: "Bootmenü",
|
||||
REBOOT: "Neustarten",
|
||||
BOOTLOADER: "Bootloader",
|
||||
},
|
||||
},
|
||||
browserWarning: {
|
||||
TITLE: "Warnung",
|
||||
INFO_SERIAL_PREFIX:
|
||||
"Der aktuell genutzte Browser wird aufgrund der speziellen Voraussetzung für Kommunikation über die ",
|
||||
INFO_SERIAL_INFIX: "serielle Schnittstelle",
|
||||
INFO_SERIAL_SUFFIX: " nicht unterstützt.",
|
||||
INFO_BROWSER_PREFIX:
|
||||
"Auch wenn alle Chromium-basieren Desktop Browser diese Voraussetzung grundsätzlich erfüllen, haben einige Browser ",
|
||||
INFO_BROWSER_INFIX: "wie zum Beispiel Brave",
|
||||
INFO_BROWSER_SUFFIX: " sich bewusst dazu entschieden die API zu deaktivieren.",
|
||||
DOWNLOAD_CHROMIUM: "Chromium herunterladen",
|
||||
OTHER_OPTIONS: "Andere häufig genutzte Alternativen",
|
||||
},
|
||||
configure: {
|
||||
chords: {
|
||||
TITLE: "Akkorde",
|
||||
search: {
|
||||
PLACEHOLDER: "{0} Akkord{{|e}} durchsuchen",
|
||||
},
|
||||
},
|
||||
layout: {
|
||||
TITLE: "Layout",
|
||||
},
|
||||
settings: {
|
||||
TITLE: "Einstellungen",
|
||||
},
|
||||
},
|
||||
} satisfies Translation
|
||||
|
||||
export default de
|
||||
51
src/i18n/en/index.ts
Normal file
51
src/i18n/en/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type {BaseTranslation} from "../i18n-types"
|
||||
|
||||
const en = {
|
||||
TITLE: "amaCC1ng",
|
||||
backup: {
|
||||
TITLE: "Local Backup",
|
||||
DISCLAIMER: "Backups remain on your computer and are never shared with us or uploaded to our servers.",
|
||||
DOWNLOAD: "Download Backup",
|
||||
RESTORE: "Restore",
|
||||
},
|
||||
deviceManager: {
|
||||
TITLE: "Device",
|
||||
AUTO_CONNECT: "Auto-connect",
|
||||
CONNECT: "Connect",
|
||||
DISCONNECT: "Disconnect",
|
||||
TERMINAL: "Terminal",
|
||||
bootMenu: {
|
||||
TITLE: "Boot Menu",
|
||||
REBOOT: "Reboot",
|
||||
BOOTLOADER: "Bootloader",
|
||||
},
|
||||
},
|
||||
browserWarning: {
|
||||
TITLE: "Warning",
|
||||
INFO_SERIAL_PREFIX: "Your current browser is not supported due to this site's unique requirement for ",
|
||||
INFO_SERIAL_INFIX: "serial connections",
|
||||
INFO_SERIAL_SUFFIX: ".",
|
||||
INFO_BROWSER_PREFIX:
|
||||
"Though all chromium-based desktop browsers fulfill this requirement, some derivations such as Brave ",
|
||||
INFO_BROWSER_INFIX: "have been known to disable the API intentionally",
|
||||
INFO_BROWSER_SUFFIX: ".",
|
||||
DOWNLOAD_CHROMIUM: "Download Chromium",
|
||||
OTHER_OPTIONS: "Other popular options include",
|
||||
},
|
||||
configure: {
|
||||
chords: {
|
||||
TITLE: "Chords",
|
||||
search: {
|
||||
PLACEHOLDER: "Search {0} chord{{|s}}",
|
||||
},
|
||||
},
|
||||
layout: {
|
||||
TITLE: "Layout",
|
||||
},
|
||||
settings: {
|
||||
TITLE: "Settings",
|
||||
},
|
||||
},
|
||||
} satisfies BaseTranslation
|
||||
|
||||
export default en
|
||||
11
src/i18n/formatters.ts
Normal file
11
src/i18n/formatters.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { FormattersInitializer } from 'typesafe-i18n'
|
||||
import type { Locales, Formatters } from './i18n-types'
|
||||
|
||||
export const initFormatters: FormattersInitializer<Locales, Formatters> = (locale: Locales) => {
|
||||
|
||||
const formatters: Formatters = {
|
||||
// add your formatter functions here
|
||||
}
|
||||
|
||||
return formatters
|
||||
}
|
||||
@@ -2,7 +2,6 @@ import {LineBreakTransformer} from "$lib/serial/line-break-transformer"
|
||||
import {serialLog} from "$lib/serial/connection"
|
||||
import type {Chord} from "$lib/serial/chord"
|
||||
import {parseChordActions, parsePhrase, stringifyChordActions, stringifyPhrase} from "$lib/serial/chord"
|
||||
import {dev} from "$app/environment"
|
||||
|
||||
export const VENDOR_ID = 0x239a
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
</script>
|
||||
|
||||
<h1>{$page.status}</h1>
|
||||
<pre>{$page.error.message}</pre>
|
||||
<pre>{$page.error?.message}</pre>
|
||||
|
||||
@@ -19,6 +19,14 @@
|
||||
import "tippy.js/dist/tippy.css"
|
||||
import tippy from "tippy.js"
|
||||
import {theme, userPreferences} from "$lib/preferences.js"
|
||||
import {setLocale} from "../i18n/i18n-svelte"
|
||||
import {loadLocale} from "../i18n/i18n-util.sync"
|
||||
import {detectLocale} from "../i18n/i18n-util"
|
||||
import type {Locales} from "../i18n/i18n-types"
|
||||
|
||||
const locale = ((browser && localStorage.getItem("locale")) as Locales) || detectLocale()
|
||||
loadLocale(locale)
|
||||
setLocale(locale)
|
||||
|
||||
if (browser) {
|
||||
tippy.setDefaultProps({
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
<script lang="ts">
|
||||
import {getSharableUrl, parseCompressed, stringifyCompressed} from "$lib/serial/serialization"
|
||||
import {parseCompressed, stringifyCompressed} from "$lib/serial/serialization"
|
||||
import {chords, layout} from "$lib/serial/connection"
|
||||
import {preference} from "$lib/preferences"
|
||||
import type {Chord} from "$lib/serial/chord"
|
||||
import type {CharaLayout} from "$lib/serialization/layout"
|
||||
import LL from "../i18n/i18n-svelte"
|
||||
|
||||
interface Backup {
|
||||
isCharaBackup: string
|
||||
chords: Chord[]
|
||||
layout: CharaLayout
|
||||
}
|
||||
|
||||
async function downloadBackup() {
|
||||
const downloadUrl = URL.createObjectURL(
|
||||
@@ -22,7 +31,7 @@
|
||||
async function restoreBackup(event: InputEvent) {
|
||||
const input = (event.target as HTMLInputElement).files![0]
|
||||
if (!input) return
|
||||
const backup = await parseCompressed(input)
|
||||
const backup = await parseCompressed<Backup>(input)
|
||||
if (backup.isCharaBackup !== "v1.0") throw new Error("Invalid Backup")
|
||||
if (backup.chords) {
|
||||
$chords = backup.chords
|
||||
@@ -34,14 +43,17 @@
|
||||
</script>
|
||||
|
||||
<section>
|
||||
<h2><label><input type="checkbox" use:preference={"backup"} />Local Backup</label></h2>
|
||||
<h2><label><input type="checkbox" use:preference={"backup"} />{$LL.backup.TITLE()}</label></h2>
|
||||
<p class="disclaimer">
|
||||
<i>Backups remain on your computer and are never shared or uploaded to our servers.</i>
|
||||
<i>{$LL.backup.DISCLAIMER()}</i>
|
||||
</p>
|
||||
<div class="save">
|
||||
<button class="primary" on:click={downloadBackup}><span class="icon">save</span> Download Backup</button>
|
||||
<button class="primary" on:click={downloadBackup}
|
||||
><span class="icon">save</span>{$LL.backup.DOWNLOAD()}</button
|
||||
>
|
||||
<label class="button"
|
||||
><input on:input={restoreBackup} type="file" /><span class="icon">settings_backup_restore</span> Restore</label
|
||||
><input on:input={restoreBackup} type="file" /><span class="icon">settings_backup_restore</span
|
||||
>{$LL.backup.RESTORE()}</label
|
||||
>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,23 +1,27 @@
|
||||
<script>
|
||||
import LL from "../i18n/i18n-svelte"
|
||||
</script>
|
||||
|
||||
<dialog open>
|
||||
<h1>Warning</h1>
|
||||
<h1>{$LL.browserWarning.TITLE()}</h1>
|
||||
<p>
|
||||
Your current browser is not supported due to this site's unique requirement for <a
|
||||
{$LL.browserWarning.INFO_SERIAL_PREFIX()}<a
|
||||
class="normal"
|
||||
target="_blank"
|
||||
href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API#browser_compatibility"
|
||||
>serial connections</a
|
||||
>. Though all <b>chromium-based desktop</b> browsers fulfill this requirement, some derivations such as
|
||||
Brave
|
||||
>{$LL.browserWarning.INFO_SERIAL_INFIX()}</a
|
||||
>{$LL.browserWarning.INFO_SERIAL_SUFFIX()}
|
||||
{$LL.browserWarning.INFO_BROWSER_PREFIX()}
|
||||
<a href="https://github.com/brave/brave-browser/issues/13902" target="_blank"
|
||||
>have been known to disable the API intentionally</a
|
||||
>.
|
||||
>{$LL.browserWarning.INFO_BROWSER_INFIX()}</a
|
||||
>{$LL.browserWarning.INFO_BROWSER_SUFFIX()}
|
||||
</p>
|
||||
<div>
|
||||
<a href="https://www.chromium.org/getting-involved/download-chromium/" target="_blank" class="chrome"
|
||||
>Download Chromium</a
|
||||
>{$LL.browserWarning.DOWNLOAD_CHROMIUM()}</a
|
||||
>
|
||||
</div>
|
||||
<h5>Other popular options include</h5>
|
||||
<h5>{$LL.browserWarning.OTHER_OPTIONS()}</h5>
|
||||
<div>
|
||||
<a href="https://www.google.com/chrome/" target="_blank" class="chrome">Chrome</a>
|
||||
<a href="https://www.microsoft.com/en-us/edge/download?form=MA13FJ" target="_blank" class="edge"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import {browser} from "$app/environment"
|
||||
import {slide, fade} from "svelte/transition"
|
||||
import {preference} from "$lib/preferences"
|
||||
import LL from "../i18n/i18n-svelte"
|
||||
|
||||
let terminal = false
|
||||
let powerDialog = false
|
||||
@@ -10,8 +11,8 @@
|
||||
|
||||
<section>
|
||||
<div class="row">
|
||||
<h2>Device</h2>
|
||||
<label>Auto-Connect<input type="checkbox" use:preference={"autoConnect"} /></label>
|
||||
<h2>{$LL.deviceManager.TITLE()}</h2>
|
||||
<label>{$LL.deviceManager.AUTO_CONNECT()}<input type="checkbox" use:preference={"autoConnect"} /></label>
|
||||
</div>
|
||||
|
||||
{#if $serialPort}
|
||||
@@ -32,22 +33,24 @@
|
||||
on:click={() => {
|
||||
$serialPort.forget()
|
||||
$serialPort = undefined
|
||||
}}><span class="icon">usb_off</span>Disconnect</button
|
||||
}}><span class="icon">usb_off</span>{$LL.deviceManager.DISCONNECT()}</button
|
||||
>
|
||||
{:else}
|
||||
<button class="error" on:click={() => initSerial(true)}><span class="icon">usb</span>Connect</button>
|
||||
<button class="error" on:click={() => initSerial(true)}
|
||||
><span class="icon">usb</span>{$LL.deviceManager.CONNECT()}</button
|
||||
>
|
||||
{/if}
|
||||
<div class="row" style="justify-content: flex-end">
|
||||
<a
|
||||
href="/terminal"
|
||||
title="Terminal"
|
||||
title={$LL.deviceManager.TERMINAL()}
|
||||
class="icon"
|
||||
disabled={$serialPort === undefined}
|
||||
on:click={() => (terminal = !terminal)}>terminal</a
|
||||
>
|
||||
<button
|
||||
class="icon"
|
||||
title="Boot Menu"
|
||||
title={$LL.deviceManager.bootMenu.TITLE()}
|
||||
disabled={$serialPort === undefined}
|
||||
on:click={() => (powerDialog = !powerDialog)}>settings_power</button
|
||||
>
|
||||
@@ -56,18 +59,18 @@
|
||||
{#if powerDialog}
|
||||
<div class="backdrop" transition:fade={{duration: 250}} on:click={() => (powerDialog = !powerDialog)} />
|
||||
<dialog open transition:slide={{duration: 250}}>
|
||||
<h3>Boot Menu</h3>
|
||||
<h3>{$LL.deviceManager.bootMenu.TITLE()}</h3>
|
||||
<button
|
||||
on:click={() => {
|
||||
$serialPort.reboot()
|
||||
$serialPort = undefined
|
||||
}}><span class="icon">restart_alt</span>Reboot</button
|
||||
}}><span class="icon">restart_alt</span>{$LL.deviceManager.bootMenu.REBOOT()}</button
|
||||
>
|
||||
<button
|
||||
on:click={() => {
|
||||
$serialPort.bootloader()
|
||||
$serialPort = undefined
|
||||
}}><span class="icon">rule_settings</span>Bootloader</button
|
||||
}}><span class="icon">rule_settings</span>{$LL.deviceManager.bootMenu.BOOTLOADER()}</button
|
||||
>
|
||||
</dialog>
|
||||
{/if}
|
||||
|
||||
18
src/routes/Languages.svelte
Normal file
18
src/routes/Languages.svelte
Normal file
@@ -0,0 +1,18 @@
|
||||
<script lang="ts">
|
||||
import {locales} from "../i18n/i18n-util"
|
||||
import type {Locales} from "../i18n/i18n-types"
|
||||
import {loadLocaleAsync} from "../i18n/i18n-util.async"
|
||||
import {setLocale} from "../i18n/i18n-svelte"
|
||||
|
||||
async function applyLocale(locale: Locales) {
|
||||
localStorage.setItem("locale", locale)
|
||||
await loadLocaleAsync(locale)
|
||||
setLocale(locale)
|
||||
}
|
||||
</script>
|
||||
|
||||
<ul>
|
||||
{#each locales as locale}
|
||||
<li><button on:click={() => applyLocale(locale)}>{locale}</button></li>
|
||||
{/each}
|
||||
</ul>
|
||||
@@ -10,7 +10,8 @@
|
||||
import {browser} from "$app/environment"
|
||||
import {userPreferences} from "$lib/preferences"
|
||||
import Theme from "./Theme.svelte"
|
||||
import {i} from "@inlang/sdk-js"
|
||||
import Languages from "./Languages.svelte"
|
||||
import LL from "../i18n/i18n-svelte"
|
||||
|
||||
const training = [
|
||||
{slug: "cpm", title: "CPM - Characters Per Minute", icon: "music_note"},
|
||||
@@ -29,7 +30,7 @@
|
||||
</script>
|
||||
|
||||
<nav>
|
||||
<a href="/" class="title">{i("title")}</a>
|
||||
<a href="/" class="title">{$LL.TITLE()}</a>
|
||||
|
||||
<div class="steps">
|
||||
{#each training as { slug, title, icon }}
|
||||
@@ -51,7 +52,7 @@
|
||||
<PwaStatus />
|
||||
{/await}
|
||||
{#if $serialPort}
|
||||
<button title="Backup & Restore" use:popup={BackupPopup} class="icon {$syncStatus}">
|
||||
<button title={$LL.backup.TITLE()} use:popup={BackupPopup} class="icon {$syncStatus}">
|
||||
{#if $syncStatus === "downloading"}
|
||||
backup
|
||||
{:else if $syncStatus === "uploading"}
|
||||
@@ -63,6 +64,7 @@
|
||||
{/if}
|
||||
</button>
|
||||
{/if}
|
||||
<button class="icon" use:popup={Languages}>translate</button>
|
||||
<button
|
||||
bind:this={connectButton}
|
||||
title="Devices"
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<script>
|
||||
import {page} from "$app/stores"
|
||||
import LL from "../../i18n/i18n-svelte"
|
||||
|
||||
const paths = [
|
||||
{href: "/config/chords/", title: "Chords", icon: "piano"},
|
||||
{href: "/config/layout/", title: "Layout", icon: "keyboard"},
|
||||
{href: "/config/settings/", title: "Settings", icon: "settings"},
|
||||
{href: "/config/chords/", title: $LL.configure.chords.TITLE(), icon: "piano"},
|
||||
{href: "/config/layout/", title: $LL.configure.layout.TITLE(), icon: "keyboard"},
|
||||
{href: "/config/settings/", title: $LL.configure.settings.TITLE(), icon: "settings"},
|
||||
]
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {chords, serialPort} from "$lib/serial/connection"
|
||||
import {chords} from "$lib/serial/connection"
|
||||
import {KEYMAP_CODES} from "$lib/serial/keymap-codes"
|
||||
import FlexSearch from "flexsearch"
|
||||
import type {Index} from "flexsearch"
|
||||
@@ -7,6 +7,8 @@
|
||||
import type {Chord} from "$lib/serial/chord"
|
||||
import tippy from "tippy.js"
|
||||
import {calculateChordCoverage} from "$lib/chords/coverage"
|
||||
import type {MouseEventHandler} from "svelte/elements"
|
||||
import LL from "../../../i18n/i18n-svelte"
|
||||
|
||||
$: searchIndex = $chords?.length > 0 ? buildIndex($chords) : undefined
|
||||
|
||||
@@ -28,11 +30,11 @@
|
||||
})
|
||||
}
|
||||
|
||||
function sort(event: InputEvent) {
|
||||
const sort: MouseEventHandler<HTMLButtonElement> = function (event) {
|
||||
tippy(event.target, {})
|
||||
}
|
||||
|
||||
$: items = searchFilter?.map(it => [$chords[it], it]) ?? $chords.map((it, i) => [it, i])
|
||||
$: items = searchFilter?.map(it => [$chords[it], it] as const) ?? $chords.map((it, i) => [it, i] as const)
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@@ -40,7 +42,11 @@
|
||||
</svelte:head>
|
||||
|
||||
{#if searchIndex}
|
||||
<input on:input={search} type="search" placeholder="Search {$chords.length} chords" />
|
||||
<input
|
||||
on:input={search}
|
||||
type="search"
|
||||
placeholder={$LL.configure.chords.search.PLACEHOLDER($chords.length)}
|
||||
/>
|
||||
{/if}
|
||||
<button class="icon" on:click={sort}>sort</button>
|
||||
<button class="icon">filter_list</button>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
/* This file was created by inlang.
|
||||
It is needed in order to circumvent a current limitation of SvelteKit. See https://github.com/inlang/inlang/issues/647
|
||||
You can remove this comment and modify the file as you like. We just need to make sure it exists.
|
||||
Please do not delete it (inlang will recreate it if needed). */
|
||||
@@ -4,7 +4,6 @@ import {sveltekit} from "@sveltejs/kit/vite"
|
||||
import {defineConfig} from "vite"
|
||||
import {SvelteKitPWA} from "@vite-pwa/sveltekit"
|
||||
import ViteYaml from "@modyfi/vite-plugin-yaml"
|
||||
import inlangPlugin from "@inlang/sdk-js/adapter-sveltekit"
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
@@ -13,7 +12,6 @@ export default defineConfig({
|
||||
},
|
||||
plugins: [
|
||||
ViteYaml(),
|
||||
inlangPlugin(),
|
||||
sveltekit(),
|
||||
SvelteKitPWA({
|
||||
kit: {
|
||||
|
||||
Reference in New Issue
Block a user