Skip to content

Commit 428ecec

Browse files
authored
🔀 merge pull request #368 from onRuntime/antoinekm/translations-generation
🌐 add translations generation
2 parents 77c7a36 + 0f381c7 commit 428ecec

1,178 files changed

Lines changed: 59375 additions & 233 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ jobs:
2727
- name: Install Dependencies
2828
run: pnpm install
2929

30+
- name: Test
31+
run: pnpm test
32+
3033
- name: Build
3134
run: pnpm build

.github/workflows/translations.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Generate Translations
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- "apps/web/src/locales/**/*.json"
8+
- "apps/web/src/content/**/*.mdx"
9+
10+
jobs:
11+
translate:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 2
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- uses: pnpm/action-setup@v4
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: pnpm
25+
26+
- run: pnpm install --frozen-lockfile
27+
28+
- name: Generate translations
29+
env:
30+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
31+
run: pnpm --filter @onruntime/web translate
32+
33+
- name: Commit and push
34+
run: |
35+
git config user.name "github-actions[bot]"
36+
git config user.email "github-actions[bot]@users.noreply.github.com"
37+
git add apps/web/src/locales/ apps/web/src/content/
38+
git diff --staged --quiet || git commit -m "🌐 update translations"
39+
git push

README.md

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
1-
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
1+
# onRuntime
22

3-
## Getting Started
3+
Monorepo for onRuntime projects.
44

5-
First, run the development server:
5+
## Apps
66

7-
```bash
8-
pnpm dev
9-
```
7+
- [@onruntime/web](apps/web) - Next.js website
108

11-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
9+
## Packages
1210

13-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
14-
15-
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
16-
17-
## Learn More
18-
19-
To learn more about Next.js, take a look at the following resources:
20-
21-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
22-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
23-
24-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
25-
26-
## Deploy on Vercel
27-
28-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
29-
30-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
11+
- [@onruntime/translations](packages/translations) - i18n library for React, Next.js, and React Native
12+
- [@onruntime/next-sitemap](packages/next-sitemap) - Dynamic sitemap generation for Next.js

apps/web/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# @onruntime/web
2+
3+
Next.js website for onRuntime.
4+
5+
## Getting Started
6+
7+
```bash
8+
pnpm dev
9+
```
10+
11+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

apps/web/package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"dev": "next dev --turbopack",
77
"build": "next build",
88
"start": "next start",
9-
"type-check": "tsc --noEmit"
9+
"type-check": "tsc --noEmit",
10+
"translate": "npx tsx scripts/generate-translations.ts",
11+
"translate:init": "npx tsx scripts/generate-translations.ts --init",
12+
"test": "tsx --test tests/index.ts"
1013
},
1114
"dependencies": {
1215
"@fontsource/cal-sans": "^5.2.3",
@@ -30,7 +33,6 @@
3033
"autoprefixer": "^10.4.20",
3134
"class-variance-authority": "^0.7.1",
3235
"clsx": "^2.1.1",
33-
"gray-matter": "^4.0.3",
3436
"lucide-react": "^0.562.0",
3537
"motion": "^12.0.0",
3638
"next": "16.1.1",
@@ -50,11 +52,16 @@
5052
"zod": "^3.24.2"
5153
},
5254
"devDependencies": {
55+
"@ai-sdk/openai": "^3.0.2",
5356
"@types/node": "^22.0.0",
5457
"@types/react": "^19",
5558
"@types/react-dom": "^19",
59+
"ai": "^6.0.3",
60+
"dotenv-flow": "^4.1.0",
61+
"gray-matter": "^4.0.3",
5662
"postcss": "^8.5.1",
5763
"tailwindcss": "^3.4.17",
64+
"tsx": "^4.21.0",
5865
"typescript": "^5"
5966
}
6067
}

0 commit comments

Comments
 (0)