Usage
Update the integration configuration
This package has a few required options:
There are many convenient options, check out the reference below to learn more.
Structure
Directorysrc/
Directorylocales/ Data used for translations
Directoryen/
- common.json
Directoryfr/
- common.json
Directorypages/ Not managed by the package
- custom.astro Accessible at /custom
Directoryapi/
- hello.ts Accessible at /api/hello
Directoryroutes/ Managed by the package
- index.astro Accessible at
/
and/fr
by default - blog.astro Accessible at
/blog
and/fr/blog
by default
- index.astro Accessible at
Import the utilities
Utilities can be imported from i18n:astro
inside routes
, pages
and middlewares:
Have a look at the reference to see what you can do!
Client usage
Using utilities from i18n:astro
on the client is opt-in. You need 2 things:
-
Import the
<I18nClient />
component, likely in your layout: -
Enable client features in the integration configuration:
Learn more about it works below!