0.1.0 • Published 8 months ago

fransek-next-i18n v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

fransek-next-i18n

Setup

npm install fransek-next-i18n
// middleware.ts
import { i18nMiddleware } from "fransek-next-i18n";

export default i18nMiddleware({
    locales: ["en", "sv", "es", "fr"] as const,
    default: "en",
});
src/
|-- app/
|   |-- [locale]/
|   |   |-- layout.tsx
|   |   |-- page.tsx
|-- middleware.ts

locale()

Returns the current locale on the server.

useLocale()

Returns the current locale on the client.

0.1.0

8 months ago