Intlayer
/

TornadoAI aymericzip commited on
Commit
07af936
Β·
0 Parent(s):

Duplicate from aymericzip/intlayer

Browse files

Co-authored-by: Aymeric PINEAU <aymericzip@users.noreply.huggingface.co>

Files changed (4) hide show
  1. Dockerfile +3 -0
  2. README.md +126 -0
  3. commands.txt +2 -0
  4. index.html +0 -0
Dockerfile ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ FROM nginx:alpine
2
+ EXPOSE 80
3
+ COPY . /usr/share/nginx/html
README.md ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Intlayer AI Site (`ai.intlayer.org`)
2
+
3
+ Landing page and web showcase for [ai.intlayer.org](https://ai.intlayer.org) β€” highlighting **Intlayer**'s AI-powered internationalization (i18n), dynamic content generation, A/B testing, and AI-driven translation workflows.
4
+
5
+ ---
6
+
7
+ ## 🌟 About Intlayer
8
+
9
+ [Intlayer](https://intlayer.org) is an open-source, modern internationalization (i18n) framework designed for JavaScript and TypeScript applications (React, Next.js, Vite, Vue, Svelte, Express, and more). Beyond traditional key-value dictionaries, Intlayer treats content declaration as code and integrates AI tools to streamline localization, translation maintenance, and content auditing.
10
+
11
+ Explore the live AI landing page at [ai.intlayer.org](https://ai.intlayer.org).
12
+
13
+ ---
14
+
15
+ ## πŸ€– Intlayer AI CLI Tools
16
+
17
+ Intlayer provides powerful CLI commands driven by AI models (OpenAI, Anthropic, Mistral, Google Gemini, Ollama, etc.) to automate and maintain translations across codebases and documentation.
18
+
19
+ ### 1. `intlayer fill` β€” AI Dictionary Audit & Fill
20
+
21
+ The [`intlayer fill`](https://intlayer.org/doc/concept/cli/fill) command inspects your content declaration files (`*.content.{ts,js,tsx,jsx,json}`) for missing translations, structural inconsistencies, or type discrepancies. It automatically uses AI to complete missing locales while preserving existing keys and context.
22
+
23
+ ```bash
24
+ # Audit and automatically fill missing translations in all dictionaries
25
+ npx intlayer fill
26
+
27
+ # Target specific content declaration files
28
+ npx intlayer fill -f src/components/Hero.content.ts
29
+
30
+ # Target specific dictionary keys
31
+ npx intlayer fill -k heroSection navbar
32
+
33
+ # Choose a specific AI provider and model
34
+ npx intlayer fill --provider openai --model gpt-4o
35
+ ```
36
+
37
+ **Key Features:**
38
+ - **Smart Chunking:** Automatically divides large JSON/content files into manageable blocks to stay within token context limits.
39
+ - **Context-Aware:** Incorporates surrounding application and file context for natural, idiomatic translations.
40
+ - **Non-Destructive:** Retains existing translations and only updates missing or mismatched fields.
41
+ - **Parallel Processing:** Uses concurrent queues across files and locales to optimize speed.
42
+
43
+ πŸ“– [Read the full `intlayer fill` documentation](https://intlayer.org/doc/concept/cli/fill)
44
+
45
+ ---
46
+
47
+ ### 2. `intlayer doc translate` β€” AI Documentation Translation
48
+
49
+ The [`intlayer doc translate`](https://intlayer.org/doc/concept/cli/doc-translate) command automatically translates markdown and MDX documentation files from a base locale to target locales using AI models.
50
+
51
+ ```bash
52
+ # Translate docs matching a pattern to specific locales
53
+ npx intlayer doc translate --doc-pattern "docs/**/*.md" --base-locale en --locales fr es de
54
+
55
+ # Skip files that have not changed recently
56
+ npx intlayer doc translate --skip-if-exists
57
+
58
+ # Run with custom concurrency
59
+ npx intlayer doc translate --nb-simultaneous-file-processed 4
60
+ ```
61
+
62
+ **Key Features:**
63
+ - **Markdown & MDX Aware:** Preserves frontmatter, code blocks, and markdown structure during translation.
64
+ - **Large Document Chunking:** Splits lengthy guides and documentation into coherent chunks.
65
+ - **Configurable Locales:** Explicitly control source and target locales or rely on your `intlayer.config.ts`.
66
+
67
+ πŸ“– [Read the full `intlayer doc translate` documentation](https://intlayer.org/doc/concept/cli/doc-translate)
68
+
69
+ ---
70
+
71
+ ### 3. `intlayer doc review` β€” Documentation Quality & Sync Audit
72
+
73
+ The [`intlayer doc review`](https://intlayer.org/doc/concept/cli/doc-review) command checks translated documentation against the source base documentation to ensure consistency, find diverging sections, and apply fixes.
74
+
75
+ ```bash
76
+ # Review existing translated docs and apply AI updates to outdated sections
77
+ npx intlayer doc review --doc-pattern "docs/**/*.md" --base-locale en --locales fr es
78
+
79
+ # Generate a report of diverging blocks without modifying files
80
+ npx intlayer doc review --mode report
81
+
82
+ # Display only the high-level status synthesis
83
+ npx intlayer doc review --mode synthesis
84
+ ```
85
+
86
+ **Modes:**
87
+ - `apply` *(default)*: Analyzes diverging sections with AI, updates out-of-sync blocks, and writes the translated files.
88
+ - `report`: Runs a dry run without calling AI translation APIs; logs out-of-date blocks with line numbers for manual or agentic review.
89
+ - `synthesis`: Skips block-level logging and prints an executive summary of up-to-date and pending files.
90
+
91
+ πŸ“– [Read the full `intlayer doc review` documentation](https://intlayer.org/doc/concept/cli/doc-review)
92
+
93
+ ---
94
+
95
+ ## πŸš€ Running This Website Locally
96
+
97
+ This repository contains the static deployment of [ai.intlayer.org](https://ai.intlayer.org) served with Nginx via Docker.
98
+
99
+ ### Prerequisites
100
+
101
+ - [Docker](https://www.docker.com/) installed on your machine.
102
+
103
+ ### Build and Run
104
+
105
+ 1. **Build the Docker container:**
106
+ ```bash
107
+ docker build -t intlayer-ai -f ./Dockerfile .
108
+ ```
109
+
110
+ 2. **Run the container:**
111
+ ```bash
112
+ docker run --rm -p 8000:80 --name intlayer-ai-app intlayer-ai
113
+ ```
114
+
115
+ 3. Open your browser and navigate to `http://localhost:8000`.
116
+
117
+ ---
118
+
119
+ ## πŸ”— Useful Links
120
+
121
+ - **Website:** [ai.intlayer.org](https://ai.intlayer.org)
122
+ - **Official Intlayer Website:** [intlayer.org](https://intlayer.org)
123
+ - **CLI Fill Guide:** [intlayer.org/doc/concept/cli/fill](https://intlayer.org/doc/concept/cli/fill)
124
+ - **CLI Doc Translate Guide:** [intlayer.org/doc/concept/cli/doc-translate](https://intlayer.org/doc/concept/cli/doc-translate)
125
+ - **CLI Doc Review Guide:** [intlayer.org/doc/concept/cli/doc-review](https://intlayer.org/doc/concept/cli/doc-review)
126
+ - **GitHub Repository:** [github.com/aymericzip/intlayer](https://github.com/aymericzip/intlayer)
commands.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ docker build -t intlayer-ai -f ./Dockerfile .
2
+ docker run --rm -p 8000:80 --name intlayer-ai-app intlayer-ai
index.html ADDED
The diff for this file is too large to render. See raw diff