Skip to content

Commit

Permalink
docs(examples): add basics, netlify, node and react setups
Browse files Browse the repository at this point in the history
examples are not all fully functional but they'll be used as a base to improve astro-i18next
  • Loading branch information
yassinedoghri committed Nov 6, 2022
1 parent f94ca96 commit 8106b23
Show file tree
Hide file tree
Showing 66 changed files with 81,543 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/basics/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# build output
dist/
.output/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
2 changes: 2 additions & 0 deletions examples/basics/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Expose Astro dependencies for `pnpm` users
shamefully-hoist=true
6 changes: 6 additions & 0 deletions examples/basics/.stackblitzrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"startCommand": "npm start",
"env": {
"ENABLE_CJS_IMPORTS": true
}
}
7 changes: 7 additions & 0 deletions examples/basics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# astro-i18next examples - Basics (SSG)

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/yassinedoghri/astro-i18next/tree/latest/examples/basics)

## 👀 Want to learn more?

Feel free to check [astro-i18next's documentation](../../README.md).
16 changes: 16 additions & 0 deletions examples/basics/astro-i18next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { AstroI18nextConfig } from "astro-i18next";

const config: AstroI18nextConfig = {
defaultLanguage: "en",
supportedLanguages: ["en", "fr"],
i18next: {
debug: true,
initImmediate: false,
backend: {
loadPath: "./src/locales/{{lng}}.json",
},
},
i18nextPlugins: { fsBackend: "i18next-fs-backend" },
};

export default config;
10 changes: 10 additions & 0 deletions examples/basics/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "astro/config";
import astroI18next from "astro-i18next";

// https://astro.build/config
export default defineConfig({
experimental: {
integrations: true,
},
integrations: [astroI18next()],
});
Loading

0 comments on commit 8106b23

Please sign in to comment.