Modelo de projeto·Pro
Next.js + Tailwind + i18n
Projeto Next.js 15 com next-intl e Tailwind CSS, e uma página em inglês e espanhol em /en e /es. O modo escuro segue o sistema. Precisa do ambiente Linux com Node.js; o primeiro npm install baixa cerca de 400 MB.
Para instalar, você precisa do PocketCode Pro.
Se o PocketCode estiver instalado no seu Android, isto abre a página no app.
Prévia
Arquivos
README.md
messages/en.json
messages/es.json
next.config.ts
package-lock.json
package.json
postcss.config.mjs
src/app/[locale]/layout.tsx
src/app/[locale]/page.tsx
src/app/globals.css
src/components/LocaleSwitcher.tsx
src/i18n/navigation.ts
src/i18n/request.ts
src/i18n/routing.ts
src/middleware.ts
tailwind.config.ts
tsconfig.jsonREADME.md
# Next.js 15 + Tailwind + next-intl A one-page site in English and Spanish, with routes per language (`/en`, `/es`), Tailwind CSS and dark mode that follows the system setting. ## Run it in PocketCode You need the app's Linux environment with Node.js 18.18 or newer (the Developer pack in Terminal › Linux includes Node.js and npm). 1. Open the terminal in this project's folder. 2. Install the dependencies (the first time downloads around 400 MB and needs internet): ```sh npm install ``` 3. Start the development server: ```sh npm run dev ``` 4. Open http://localhost:3000 in the phone's browser. It redirects to `/en` or `/es` depending on the browser language. Other commands: `npm run build` (production build), `npm start` (serve that build), `npm run typecheck`. ## Where things are | Path | What it does | |---|---| | `messages/en.json`, `messages/es.json` | The texts of each language | | `src/i18n/routing.ts` | The list of languages and the default one | | `src/i18n/request.ts` | Loads the messages of the current language | | `src/middleware.ts` | Picks the language on the first visit and redirects | | `src/app/[locale]/page.tsx` | The page | | `src/components/LocaleSwitcher.tsx` | The language selector | | `tailwind.config.ts` | Tailwind settings (`darkMode: 'media'`) | ## Add a language 1. Add its code to `locales` in `src/i18n/routing.ts`, for example `'fr'`.Esta prévia está encurtada. O conteúdo completo vem com a instalação.
Mudanças na 1.0.0
Primeira versão.