Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n admin #1367

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions frontend/admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ See https://stackoverflow.com/a/76446465 for icon/static assets

Then you can launch alf.io normally and go to localhost:8080/admin/ -> all the components exported in the main.ts will be available.


## i18n

### extract i18n and generate locales

> npm run lit-localize-extract

### Then update the translated xlf and run

> npm run lit-localize-build

## update deps

> npx npm-check-updates -u
Expand Down
15 changes: 15 additions & 0 deletions frontend/admin/lit-localize.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://raw.githubusercontent.com/lit/lit/main/packages/localize-tools/config.schema.json",
"sourceLocale": "en",
"targetLocales": ["it"],
"tsConfig": "./tsconfig.json",
"output": {
"mode": "runtime",
"outputDir": "./src/generated/locales",
"localeCodesModule": "./src/generated/locale-codes.ts"
},
"interchange": {
"format": "xliff",
"xliffDir": "./xliff/"
}
}
200 changes: 172 additions & 28 deletions frontend/admin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions frontend/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build --mode production",
"preview": "vite preview"
"preview": "vite preview",
"lit-localize-extract": "lit-localize extract",
"lit-localize-build": "lit-localize build"
},
"dependencies": {
"@lit/context": "1.1.1",
"@lit/task": "1.0.0",
"@shoelace-style/shoelace": "2.15.0",
"@tanstack/lit-form": "^0.20.3",
"lit": "3.1.3"
"@lit/context": "1.1.2",
"@lit/localize": "0.12.1",
"@lit/task": "1.0.1",
"@shoelace-style/shoelace": "2.15.1",
"@tanstack/lit-form": "0.25.0",
"lit": "3.1.4"
},
"devDependencies": {
"@lit/localize-tools": "0.7.2",
"typescript": "5.4.5",
"vite": "5.2.11",
"vite-plugin-static-copy": "1.0.4"
Expand Down
Loading
Loading