Skip to content
Merged
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
12 changes: 9 additions & 3 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '22'
node-version: '24'

- name: Install dependencies
run: npm ci

- name: Build app
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload the build output
path: 'dist'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check lint, format & types

on:
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
6 changes: 0 additions & 6 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"build": "vite build",
"preview": "vite preview",
"lint": "biome check",
"format": "biome format"
"format": "biome format",
"typecheck": "tsc --noEmit",
"test": "npm run lint && npm run typecheck"
},
"keywords": [],
"author": "",
Expand Down
20 changes: 6 additions & 14 deletions src/i18n/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ const I18nContext = createContext<I18nContextValue | null>(null)
* Each locale is a separate chunk loaded on demand
*/
async function loadLocale(locale: Locale): Promise<Translations> {
switch (locale) {
case 'es':
return (await import('./locales/es')).default
case 'fr':
return (await import('./locales/fr')).default
case 'de':
return (await import('./locales/de')).default
case 'sv':
return (await import('./locales/sv')).default
case 'pt':
return (await import('./locales/pt')).default
default:
return en
}
if (locale === DEFAULT_LOCALE) return en
if (!SUPPORTED_LOCALES.includes(locale)) return en
const module: { default: Translations } = await import(
`./locales/${locale}.ts`
)
return module.default
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ const pt: Translations = {
toggleTheme: 'Alternar tema',
}

export default pt
export default pt