mirror of
https://github.com/BradNut/personal-website-sveltekit
synced 2025-09-08 23:20:18 +00:00
Adding inlang paraglide js for i18n.
This commit is contained in:
parent
1b11815b02
commit
5241572b76
8 changed files with 774 additions and 3 deletions
5
.vscode/extensions.json
vendored
Normal file
5
.vscode/extensions.json
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"inlang.vs-code-extension"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "NODE_OPTIONS=\"--inspect\" vite dev --host",
|
"dev": "NODE_OPTIONS=\"--inspect\" vite dev --host",
|
||||||
"build": "vite build",
|
"build": "paraglide-js compile --project ./project.inlang && vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"test": "npm run test:integration && npm run test:unit",
|
"test": "npm run test:integration && npm run test:unit",
|
||||||
"test:ui": "svelte-kit sync && playwright test --ui",
|
"test:ui": "svelte-kit sync && playwright test --ui",
|
||||||
|
|
@ -13,13 +13,16 @@
|
||||||
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
||||||
"format": "prettier --plugin-search-dir . --write .",
|
"format": "prettier --plugin-search-dir . --write .",
|
||||||
"test:integration": "playwright test",
|
"test:integration": "playwright test",
|
||||||
"test:unit": "vitest"
|
"test:unit": "vitest",
|
||||||
|
"postinstall": "paraglide-js compile --project ./project.inlang"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify-icons/material-symbols": "^1.2.58",
|
"@iconify-icons/material-symbols": "^1.2.58",
|
||||||
"@iconify-icons/mdi": "^1.2.48",
|
"@iconify-icons/mdi": "^1.2.48",
|
||||||
"@iconify-icons/radix-icons": "^1.2.9",
|
"@iconify-icons/radix-icons": "^1.2.9",
|
||||||
"@iconify-icons/simple-icons": "^1.2.74",
|
"@iconify-icons/simple-icons": "^1.2.74",
|
||||||
|
"@inlang/paraglide-js": "1.2.0",
|
||||||
|
"@inlang/paraglide-js-adapter-vite": "^1.2.2",
|
||||||
"@melt-ui/pp": "^0.1.4",
|
"@melt-ui/pp": "^0.1.4",
|
||||||
"@playwright/test": "^1.40.1",
|
"@playwright/test": "^1.40.1",
|
||||||
"@resvg/resvg-js": "^2.6.0",
|
"@resvg/resvg-js": "^2.6.0",
|
||||||
|
|
|
||||||
737
pnpm-lock.yaml
737
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
1
project.inlang/project_id
Normal file
1
project.inlang/project_id
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
7429e1a0928554a4e7f039079040878ef319a0166bed295bc9383189405b4b6c
|
||||||
19
project.inlang/settings.json
Normal file
19
project.inlang/settings.json
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://inlang.com/schema/project-settings",
|
||||||
|
"sourceLanguageTag": "en",
|
||||||
|
"languageTags": [
|
||||||
|
"en"
|
||||||
|
],
|
||||||
|
"modules": [
|
||||||
|
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js",
|
||||||
|
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@latest/dist/index.js",
|
||||||
|
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js",
|
||||||
|
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js",
|
||||||
|
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-valid-js-identifier@latest/dist/index.js",
|
||||||
|
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js",
|
||||||
|
"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@latest/dist/index.js"
|
||||||
|
],
|
||||||
|
"plugin.inlang.messageFormat": {
|
||||||
|
"pathPattern": "./messages/{languageTag}.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
0
src/messages/en.json
Normal file
0
src/messages/en.json
Normal file
|
|
@ -22,7 +22,8 @@ const config = {
|
||||||
kit: {
|
kit: {
|
||||||
adapter: adapter(),
|
adapter: adapter(),
|
||||||
alias: {
|
alias: {
|
||||||
$root: './src'
|
$root: './src',
|
||||||
|
$paraglide: './src/paraglide'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { sveltekit } from '@sveltejs/kit/vite';
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
|
import { paraglide } from '@inlang/paraglide-js-adapter-vite';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import type { UserConfig } from 'vite';
|
import type { UserConfig } from 'vite';
|
||||||
import { imagetools } from '@zerodevx/svelte-img/vite';
|
import { imagetools } from '@zerodevx/svelte-img/vite';
|
||||||
|
|
@ -6,6 +7,10 @@ import { imagetools } from '@zerodevx/svelte-img/vite';
|
||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [
|
plugins: [
|
||||||
sveltekit(),
|
sveltekit(),
|
||||||
|
paraglide({
|
||||||
|
project: './project.inlang',
|
||||||
|
outdir: './src/paraglide'
|
||||||
|
}),
|
||||||
imagetools({
|
imagetools({
|
||||||
// By default, directives are `?width=480;1024;1920&format=avif;webp;jpg`
|
// By default, directives are `?width=480;1024;1920&format=avif;webp;jpg`
|
||||||
// Now we change it to generate 5 variants instead - `avif/jpg` formats at `640/1280` + LQIP (Now as:run)
|
// Now we change it to generate 5 variants instead - `avif/jpg` formats at `640/1280` + LQIP (Now as:run)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue