Sfoglia il codice sorgente

Updated documentation

Efren Yevale Varela 1 mese fa
parent
commit
4e51ed9cb1
2 ha cambiato i file con 31 aggiunte e 20 eliminazioni
  1. 22 18
      AGENTS.md
  2. 9 2
      README.md

+ 22 - 18
AGENTS.md

@@ -1,14 +1,17 @@
 # AGENTS.md — testing-proxy
 
+A SvelteKit 5 + Tailwind frontend with i18n (Paraglide) and dark mode enabled by default.
+
 ## Project Overview
 
-- **Framework**: SvelteKit 2.63.0 with Svelte 5 (runes mode)
+- **Framework**: SvelteKit 2.63.0 with Svelte 5 (runes mode, mandatory)
 - **Build Tool**: Vite 8.0.16
-- **Styling**: Tailwind CSS 4.3.0 (via `@tailwindcss/vite`)
-- **Component Library**: Flowbite Svelte 1.33.1 + Flowbite Icons
-- **Deployment Adapter**: `@sveltejs/adapter-node` (Node.js deployments)
-- **Package Manager**: pnpm (workspace support configured)
-- **Type System**: JavaScript with JSConfig (no TypeScript)
+- **Styling**: Tailwind CSS 4.3.0 (via `@tailwindcss/vite`, no separate config)
+- **Components**: Flowbite Svelte 1.33.1 + Flowbite Icons
+- **i18n**: Paraglide JS (English + Spanish, auto-localized routes)
+- **Adapter**: `@sveltejs/adapter-node` (Node.js deployments)
+- **Package Manager**: pnpm
+- **Type System**: JavaScript (JSConfig, no TypeScript enforcement)
 
 ## Critical Commands
 
@@ -39,13 +42,18 @@ This is a fresh project with no test suite or linter configured. Do not assume t
 
 ```
 src/
-├── app.html           # HTML shell (dark mode preset, typo: "lass" not "class")
+├── app.html           # HTML shell (dark mode preset)
+├── hooks.js           # Paraglide i18n route localization
 ├── routes/
 │   ├── +layout.svelte # Root layout component
-│   ├── +page.svelte   # Home page (uses Flowbite Alert)
+│   ├── +page.svelte   # Home page (Flowbite Alert, language switcher, dark mode toggle)
 │   └── layout.css     # Route-level styles
 └── lib/
     ├── index.js       # $lib alias exports (currently empty)
+    ├── paraglide/     # i18n (auto-generated, DO NOT EDIT)
+    │   ├── messages.js          # Locale-aware message functions
+    │   ├── runtime.js           # getLocale(), setLocale(), deLocalizeUrl()
+    │   └── messages/*.js        # en-us, es-mx translations
     └── assets/        # Static assets
 ```
 
@@ -95,22 +103,18 @@ runes: ({ filename }) =>
 ## Git & Workflow
 
 - **Branch**: master
-- **Commits**: Only one initial commit (`de93a8a`)
+- **Recent commits**: 5 commits total (initial + dark mode + i18n + documentation + icon fix)
 - **Status**: Clean working tree (no staged/unstaged changes)
 
-**Note:** This is a fresh project. No established commit conventions yet.
+**Convention**: No established commit message convention yet. Keep it clear and atomic.
 
 ## Known Issues & Observations
 
-1. **HTML Typo**: `app.html` line 9 has `lass="bg-white dark:bg-gray-700"` (missing `c` in `class`)
-   - Should be: `class="bg-white dark:bg-gray-700"`
-   - Affects dark mode styling on body element
-
-2. **No CI/CD**: No `.github/workflows/` or other CI pipeline configured
+1. **No CI/CD**: No `.github/workflows/` or other CI pipeline configured
 
-3. **No Tests**: No test framework or test scripts in `package.json`
+2. **No Tests**: No test framework or test scripts in `package.json`
 
-4. **Minimal jsconfig**: Inherits TypeScript config from `.svelte-kit/tsconfig.json` but doesn't enforce type checking (`checkJs: false`)
+3. **Minimal jsconfig**: Inherits TypeScript config from `.svelte-kit/tsconfig.json` but doesn't enforce type checking (`checkJs: false`)
 
 ## Common Agent Tasks & Gotchas
 
@@ -153,4 +157,4 @@ runes: ({ filename }) =>
 
 ---
 
-**Last Updated**: Initial creation for fresh SvelteKit project
+**Last Updated**: Verified against current project state (5 commits, i18n enabled, no typos, clean build)

+ 9 - 2
README.md

@@ -71,13 +71,20 @@ See [Svelte 5 runes documentation](https://svelte.dev/docs/svelte/what-are-runes
 - Use Tailwind utilities directly; no CSS Modules
 - Scoped styles available via `<style>` blocks in `.svelte` files
 
-### Known Issue
+### Internationalization (i18n)
 
-`src/app.html` line 9 has a typo: `lass=` should be `class=`. This affects body element dark mode styling.
+The project uses **Paraglide JS** for i18n with:
+- **Languages**: English (en-US) and Spanish (es-MX)
+- **Auto-localized Routes**: URLs automatically prefixed with language code (e.g., `/en/` or `/es/`)
+- **Runtime API**: Use `getLocale()`, `setLocale()`, and `deLocalizeUrl()` from `$lib/paraglide/runtime.js`
+- **Messages**: Locale-aware functions in `$lib/paraglide/messages.js`
+
+All routes are automatically localized. No manual language handling needed.
 
 ## Links
 
 - [SvelteKit Documentation](https://svelte.dev/docs/kit)
 - [Flowbite Svelte](https://flowbite-svelte.com/)
 - [Tailwind CSS](https://tailwindcss.com/)
+- [Paraglide JS](https://paraglidejs.com/vite)
 - [Project Instructions](./AGENTS.md)