@intlayer/docs 5.7.7 → 5.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/ar/CI_CD.md +67 -41
- package/docs/de/CI_CD.md +63 -37
- package/docs/en/CI_CD.md +51 -27
- package/docs/en-GB/CI_CD.md +58 -32
- package/docs/es/CI_CD.md +68 -42
- package/docs/hi/CI_CD.md +69 -44
- package/docs/it/CI_CD.md +67 -41
- package/docs/ja/CI_CD.md +67 -41
- package/docs/ko/CI_CD.md +63 -37
- package/docs/pt/CI_CD.md +67 -41
- package/docs/ru/CI_CD.md +70 -44
- package/docs/zh/CI_CD.md +62 -36
- package/package.json +8 -8
package/docs/es/CI_CD.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-05-20
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-08-13
|
|
4
4
|
title: Integración CI/CD
|
|
5
|
-
description: Aprende cómo integrar Intlayer en tu pipeline
|
|
5
|
+
description: Aprende cómo integrar Intlayer en tu pipeline CI/CD para la gestión y despliegue automatizado de contenido.
|
|
6
6
|
keywords:
|
|
7
7
|
- CI/CD
|
|
8
8
|
- Integración Continua
|
|
@@ -19,13 +19,13 @@ slugs:
|
|
|
19
19
|
|
|
20
20
|
# Generación Automática de Traducciones en un Pipeline CI/CD
|
|
21
21
|
|
|
22
|
-
Intlayer permite la generación automática de traducciones para tus archivos de declaración de contenido. Existen
|
|
22
|
+
Intlayer permite la generación automática de traducciones para tus archivos de declaración de contenido. Existen múltiples formas de lograr esto dependiendo de tu flujo de trabajo.
|
|
23
23
|
|
|
24
24
|
## Uso del CMS
|
|
25
25
|
|
|
26
|
-
Con Intlayer, puedes adoptar un flujo de trabajo donde solo se declara un único locale localmente, mientras que todas las traducciones se gestionan de forma remota a través del CMS. Esto permite que el contenido y las traducciones estén completamente desacoplados
|
|
26
|
+
Con Intlayer, puedes adoptar un flujo de trabajo donde solo se declara un único locale localmente, mientras que todas las traducciones se gestionan de forma remota a través del CMS. Esto permite que el contenido y las traducciones estén completamente desacoplados del código base, ofreciendo más flexibilidad para los editores de contenido y habilitando la recarga en caliente del contenido (no es necesario reconstruir la aplicación para aplicar cambios).
|
|
27
27
|
|
|
28
|
-
### Configuración de
|
|
28
|
+
### Configuración de Ejemplo
|
|
29
29
|
|
|
30
30
|
```ts fileName="intlayer.config.ts"
|
|
31
31
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
@@ -45,7 +45,7 @@ const config: IntlayerConfig = {
|
|
|
45
45
|
clientSecret: process.env.INTLAYER_CLIENT_SECRET,
|
|
46
46
|
},
|
|
47
47
|
ai: {
|
|
48
|
-
applicationContext: "
|
|
48
|
+
applicationContext: "Esta es una aplicación de prueba", // Ayuda a asegurar una generación consistente de traducciones
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
51
|
|
|
@@ -58,7 +58,7 @@ Para aprender más sobre el CMS, consulta la [documentación oficial](https://gi
|
|
|
58
58
|
|
|
59
59
|
Puedes integrar la generación de traducciones en tu flujo de trabajo local de Git usando [Husky](https://typicode.github.io/husky/).
|
|
60
60
|
|
|
61
|
-
### Configuración de
|
|
61
|
+
### Configuración de Ejemplo
|
|
62
62
|
|
|
63
63
|
```ts fileName="intlayer.config.ts"
|
|
64
64
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
@@ -66,7 +66,7 @@ import { Locales, type IntlayerConfig } from "intlayer";
|
|
|
66
66
|
const config: IntlayerConfig = {
|
|
67
67
|
internationalization: {
|
|
68
68
|
locales: [Locales.ENGLISH, Locales.SPANISH, Locales.FRENCH],
|
|
69
|
-
requiredLocales: [Locales.ENGLISH], // Los locales opcionales se
|
|
69
|
+
requiredLocales: [Locales.ENGLISH], // Los locales opcionales se manejan de forma remota
|
|
70
70
|
defaultLocale: Locales.ENGLISH,
|
|
71
71
|
},
|
|
72
72
|
editor: {
|
|
@@ -77,7 +77,7 @@ const config: IntlayerConfig = {
|
|
|
77
77
|
provider: "openai",
|
|
78
78
|
apiKey: process.env.OPENAI_API_KEY, // Usa tu propia clave API
|
|
79
79
|
|
|
80
|
-
applicationContext: "
|
|
80
|
+
applicationContext: "Esta es una aplicación de prueba", // Ayuda a asegurar una generación consistente de traducciones
|
|
81
81
|
},
|
|
82
82
|
};
|
|
83
83
|
|
|
@@ -91,7 +91,7 @@ npx intlayer fill --unpushed --mode fill # Solo rellena el contenido faltante
|
|
|
91
91
|
|
|
92
92
|
> Para más información sobre los comandos CLI de Intlayer y su uso, consulta la [documentación CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/intlayer_cli.md).
|
|
93
93
|
|
|
94
|
-
> Si tienes múltiples aplicaciones en tu repositorio usando instancias separadas de Intlayer, puedes usar el argumento `--base-dir`
|
|
94
|
+
> Si tienes múltiples aplicaciones en tu repositorio usando instancias separadas de Intlayer, puedes usar el argumento `--base-dir` de esta manera:
|
|
95
95
|
|
|
96
96
|
```bash fileName=".husky/pre-push"
|
|
97
97
|
# App 1
|
|
@@ -105,68 +105,94 @@ npx intlayer fill --base-dir ./app2 --unpushed --mode fill
|
|
|
105
105
|
|
|
106
106
|
## Uso de GitHub Actions
|
|
107
107
|
|
|
108
|
-
Intlayer proporciona un comando CLI para
|
|
108
|
+
Intlayer proporciona un comando CLI para rellenar automáticamente y revisar el contenido del diccionario. Esto se puede integrar en tu flujo de trabajo CI/CD usando GitHub Actions.
|
|
109
109
|
|
|
110
110
|
```yaml fileName=".github/workflows/intlayer-translate.yml"
|
|
111
|
-
name:
|
|
111
|
+
name: Relleno Automático de Intlayer
|
|
112
|
+
# Condiciones para activar este flujo de trabajo
|
|
112
113
|
on:
|
|
113
|
-
push:
|
|
114
|
-
branches: [ main ]
|
|
115
|
-
paths:
|
|
116
|
-
- 'src/**'
|
|
117
114
|
pull_request:
|
|
118
|
-
branches:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
branches:
|
|
116
|
+
- "main"
|
|
117
|
+
|
|
118
|
+
permissions:
|
|
119
|
+
contents: write
|
|
120
|
+
pull-requests: write
|
|
122
121
|
|
|
123
122
|
concurrency:
|
|
124
|
-
group:
|
|
123
|
+
group: "autofill-${{ github.ref }}"
|
|
125
124
|
cancel-in-progress: true
|
|
126
125
|
|
|
127
126
|
jobs:
|
|
128
127
|
autofill:
|
|
129
128
|
runs-on: ubuntu-latest
|
|
130
129
|
env:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
# OpenAI
|
|
131
|
+
AI_MODEL: openai
|
|
132
|
+
AI_PROVIDER: gpt-5-mini
|
|
133
|
+
AI_API_KEY: ${{ secrets.AI_API_KEY }}
|
|
134
134
|
|
|
135
135
|
steps:
|
|
136
|
+
# Paso 1: Obtener el código más reciente del repositorio
|
|
136
137
|
- name: ⬇️ Clonar repositorio
|
|
137
|
-
uses: actions/checkout@
|
|
138
|
+
uses: actions/checkout@v4
|
|
138
139
|
with:
|
|
139
|
-
persist-credentials: true
|
|
140
|
+
persist-credentials: true # Mantener credenciales para crear PRs
|
|
141
|
+
fetch-depth: 0 # Obtener todo el historial git para análisis de diferencias
|
|
140
142
|
|
|
143
|
+
# Paso 2: Configurar el entorno de Node.js
|
|
141
144
|
- name: 🟢 Configurar Node.js
|
|
142
|
-
uses: actions/setup-node@
|
|
145
|
+
uses: actions/setup-node@v4
|
|
143
146
|
with:
|
|
144
|
-
node-version: 20
|
|
147
|
+
node-version: 20 # Usar Node.js 20 LTS para estabilidad
|
|
145
148
|
|
|
149
|
+
# Paso 3: Instalar dependencias del proyecto
|
|
146
150
|
- name: 📦 Instalar dependencias
|
|
147
|
-
run: npm
|
|
151
|
+
run: npm install
|
|
152
|
+
|
|
153
|
+
# Paso 4: Instalar Intlayer CLI globalmente para gestión de traducciones
|
|
154
|
+
- name: 📦 Instalar Intlayer
|
|
155
|
+
run: npm install -g intlayer-cli
|
|
148
156
|
|
|
157
|
+
# Paso 5: Construir el proyecto Intlayer para generar archivos de traducción
|
|
149
158
|
- name: ⚙️ Construir proyecto Intlayer
|
|
150
159
|
run: npx intlayer build
|
|
151
160
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
# Paso 6: Usar IA para rellenar automáticamente las traducciones faltantes
|
|
162
|
+
- name: 🤖 Rellenar automáticamente las traducciones faltantes
|
|
163
|
+
run: npx intlayer fill --git-diff --mode fill --provider $AI_PROVIDER --model $AI_MODEL --api-key $AI_API_KEY
|
|
164
|
+
|
|
165
|
+
# Paso 7: Verificar si hay cambios y confirmarlos
|
|
166
|
+
- name: � Verificar cambios
|
|
167
|
+
id: check-changes
|
|
168
|
+
run: |
|
|
169
|
+
if [ -n "$(git status --porcelain)" ]; then
|
|
170
|
+
echo "has-changes=true" >> $GITHUB_OUTPUT
|
|
171
|
+
else
|
|
172
|
+
echo "has-changes=false" >> $GITHUB_OUTPUT
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
# Paso 8: Confirmar y enviar cambios si existen
|
|
176
|
+
- name: 📤 Confirmar y enviar cambios
|
|
177
|
+
if: steps.check-changes.outputs.has-changes == 'true'
|
|
178
|
+
run: |
|
|
179
|
+
git config --local user.email "action@github.com"
|
|
180
|
+
git config --local user.name "GitHub Action"
|
|
181
|
+
git add .
|
|
182
|
+
git commit -m "chore: auto-fill missing translations [skip ci]"
|
|
183
|
+
git push origin HEAD:${{ github.head_ref }}
|
|
162
184
|
```
|
|
163
185
|
|
|
164
|
-
|
|
186
|
+
Para configurar las variables de entorno, vaya a GitHub → Configuración → Secrets and variables → Actions y agregue el secreto .
|
|
187
|
+
|
|
188
|
+
> Al igual que con Husky, en el caso de un monorepo, puede usar el argumento `--base-dir` para tratar secuencialmente cada aplicación.
|
|
165
189
|
|
|
166
190
|
> Por defecto, el argumento `--git-diff` filtra los diccionarios que incluyen cambios desde la base (por defecto `origin/main`) hasta la rama actual (por defecto: `HEAD`).
|
|
167
191
|
|
|
168
|
-
> Para más información sobre los comandos de
|
|
192
|
+
> Para más información sobre los comandos de Intlayer CLI y su uso, consulte la [documentación del CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/intlayer_cli.md).
|
|
169
193
|
|
|
170
194
|
## Historial del documento
|
|
171
195
|
|
|
172
|
-
|
|
196
|
+
| Versión | Fecha | Cambios |
|
|
197
|
+
| ------- | ---------- | ----------------- |
|
|
198
|
+
| 5.5.10 | 2025-06-29 | Historial inicial |
|
package/docs/hi/CI_CD.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-05-20
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-08-13
|
|
4
4
|
title: CI/CD एकीकरण
|
|
5
|
-
description: स्वचालित सामग्री प्रबंधन और परिनियोजन के लिए अपने CI/CD पाइपलाइन में
|
|
5
|
+
description: स्वचालित सामग्री प्रबंधन और परिनियोजन के लिए Intlayer को अपने CI/CD पाइपलाइन में एकीकृत करना सीखें।
|
|
6
6
|
keywords:
|
|
7
7
|
- CI/CD
|
|
8
8
|
- सतत एकीकरण
|
|
@@ -19,13 +19,13 @@ slugs:
|
|
|
19
19
|
|
|
20
20
|
# CI/CD पाइपलाइन में स्वचालित अनुवाद उत्पन्न करें
|
|
21
21
|
|
|
22
|
-
Intlayer
|
|
22
|
+
Intlayer आपके सामग्री घोषणा फ़ाइलों के लिए अनुवादों का स्वचालित उत्पादन करने की अनुमति देता है। आपके कार्यप्रवाह के आधार पर इसे प्राप्त करने के कई तरीके हैं।
|
|
23
23
|
|
|
24
24
|
## CMS का उपयोग करना
|
|
25
25
|
|
|
26
|
-
Intlayer के साथ, आप एक ऐसा कार्यप्रवाह अपना सकते हैं जहाँ केवल एक ही स्थानीय भाषा स्थानीय रूप से घोषित की जाती है, जबकि सभी अनुवाद CMS के माध्यम से दूरस्थ रूप से प्रबंधित किए जाते हैं।
|
|
26
|
+
Intlayer के साथ, आप एक ऐसा कार्यप्रवाह अपना सकते हैं जहाँ केवल एक ही स्थानीय भाषा स्थानीय रूप से घोषित की जाती है, जबकि सभी अनुवाद CMS के माध्यम से दूरस्थ रूप से प्रबंधित किए जाते हैं। यह सामग्री और अनुवादों को कोडबेस से पूरी तरह से अलग करने की अनुमति देता है, जिससे सामग्री संपादकों के लिए अधिक लचीलापन मिलता है और हॉट कंटेंट रीलोडिंग सक्षम होती है (परिवर्तन लागू करने के लिए एप्लिकेशन को पुनः निर्माण करने की आवश्यकता नहीं होती)।
|
|
27
27
|
|
|
28
|
-
### उदाहरण
|
|
28
|
+
### उदाहरण विन्यास
|
|
29
29
|
|
|
30
30
|
```ts fileName="intlayer.config.ts"
|
|
31
31
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
@@ -41,11 +41,11 @@ const config: IntlayerConfig = {
|
|
|
41
41
|
|
|
42
42
|
applicationURL: process.env.APPLICATION_URL, // CMS द्वारा उपयोग किया जाने वाला एप्लिकेशन URL
|
|
43
43
|
|
|
44
|
-
clientId: process.env.INTLAYER_CLIENT_ID, // CMS
|
|
44
|
+
clientId: process.env.INTLAYER_CLIENT_ID, // CMS प्रमाणपत्र
|
|
45
45
|
clientSecret: process.env.INTLAYER_CLIENT_SECRET,
|
|
46
46
|
},
|
|
47
47
|
ai: {
|
|
48
|
-
applicationContext: "
|
|
48
|
+
applicationContext: "यह एक परीक्षण एप्लिकेशन है", // सुनिश्चित करता है कि अनुवाद सुसंगत रूप से उत्पन्न हों
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
51
|
|
|
@@ -56,9 +56,9 @@ CMS के बारे में अधिक जानने के लिए,
|
|
|
56
56
|
|
|
57
57
|
## Husky का उपयोग करना
|
|
58
58
|
|
|
59
|
-
आप [Husky](https://typicode.github.io/husky/) का उपयोग करके
|
|
59
|
+
आप अपने स्थानीय Git वर्कफ़्लो में अनुवाद निर्माण को [Husky](https://typicode.github.io/husky/) का उपयोग करके एकीकृत कर सकते हैं।
|
|
60
60
|
|
|
61
|
-
### उदाहरण
|
|
61
|
+
### उदाहरण विन्यास
|
|
62
62
|
|
|
63
63
|
```ts fileName="intlayer.config.ts"
|
|
64
64
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
@@ -66,7 +66,7 @@ import { Locales, type IntlayerConfig } from "intlayer";
|
|
|
66
66
|
const config: IntlayerConfig = {
|
|
67
67
|
internationalization: {
|
|
68
68
|
locales: [Locales.ENGLISH, Locales.SPANISH, Locales.FRENCH],
|
|
69
|
-
requiredLocales: [Locales.ENGLISH], // वैकल्पिक
|
|
69
|
+
requiredLocales: [Locales.ENGLISH], // वैकल्पिक लोकल दूरस्थ रूप से संभाले जाते हैं
|
|
70
70
|
defaultLocale: Locales.ENGLISH,
|
|
71
71
|
},
|
|
72
72
|
editor: {
|
|
@@ -75,9 +75,9 @@ const config: IntlayerConfig = {
|
|
|
75
75
|
},
|
|
76
76
|
ai: {
|
|
77
77
|
provider: "openai",
|
|
78
|
-
apiKey: process.env.OPENAI_API_KEY, // अपना API कुंजी उपयोग करें
|
|
78
|
+
apiKey: process.env.OPENAI_API_KEY, // अपना स्वयं का API कुंजी उपयोग करें
|
|
79
79
|
|
|
80
|
-
applicationContext: "
|
|
80
|
+
applicationContext: "यह एक परीक्षण एप्लिकेशन है", // सुनिश्चित करता है कि अनुवाद सुसंगत रूप से उत्पन्न हों
|
|
81
81
|
},
|
|
82
82
|
};
|
|
83
83
|
|
|
@@ -108,61 +108,84 @@ npx intlayer fill --base-dir ./app2 --unpushed --mode fill
|
|
|
108
108
|
Intlayer एक CLI कमांड प्रदान करता है जो शब्दकोश सामग्री को स्वचालित रूप से भरने और समीक्षा करने के लिए है। इसे GitHub Actions का उपयोग करके आपके CI/CD वर्कफ़्लो में एकीकृत किया जा सकता है।
|
|
109
109
|
|
|
110
110
|
```yaml fileName=".github/workflows/intlayer-translate.yml"
|
|
111
|
-
name: Intlayer
|
|
111
|
+
name: Intlayer ऑटो-फिल
|
|
112
|
+
# इस वर्कफ़्लो के लिए ट्रिगर शर्तें
|
|
112
113
|
on:
|
|
113
|
-
push:
|
|
114
|
-
branches: [ main ]
|
|
115
|
-
paths:
|
|
116
|
-
- 'src/**'
|
|
117
114
|
pull_request:
|
|
118
|
-
branches:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
branches:
|
|
116
|
+
- "main"
|
|
117
|
+
|
|
118
|
+
permissions:
|
|
119
|
+
contents: write
|
|
120
|
+
pull-requests: write
|
|
122
121
|
|
|
123
122
|
concurrency:
|
|
124
|
-
group:
|
|
123
|
+
group: "autofill-${{ github.ref }}"
|
|
125
124
|
cancel-in-progress: true
|
|
126
125
|
|
|
127
126
|
jobs:
|
|
128
127
|
autofill:
|
|
129
128
|
runs-on: ubuntu-latest
|
|
130
129
|
env:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
# OpenAI
|
|
131
|
+
AI_MODEL: openai
|
|
132
|
+
AI_PROVIDER: gpt-5-mini
|
|
133
|
+
AI_API_KEY: ${{ secrets.AI_API_KEY }}
|
|
134
134
|
|
|
135
135
|
steps:
|
|
136
|
+
# चरण 1: रिपॉजिटरी से नवीनतम कोड प्राप्त करें
|
|
136
137
|
- name: ⬇️ रिपॉजिटरी चेकआउट करें
|
|
137
|
-
uses: actions/checkout@
|
|
138
|
+
uses: actions/checkout@v4
|
|
138
139
|
with:
|
|
139
|
-
persist-credentials: true
|
|
140
|
+
persist-credentials: true # PRs बनाने के लिए क्रेडेंशियल्स रखें
|
|
141
|
+
fetch-depth: 0 # डिफ़ एनालिसिस के लिए पूरी गिट हिस्ट्री प्राप्त करें
|
|
140
142
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
# चरण 2: Node.js पर्यावरण सेट करें
|
|
144
|
+
- name: 🟢 Node.js सेट करें
|
|
145
|
+
uses: actions/setup-node@v4
|
|
143
146
|
with:
|
|
144
|
-
node-version: 20
|
|
147
|
+
node-version: 20 # स्थिरता के लिए Node.js 20 LTS का उपयोग करें
|
|
148
|
+
|
|
149
|
+
# चरण 3: प्रोजेक्ट निर्भरताएँ इंस्टॉल करें
|
|
150
|
+
- name: 📦 निर्भरताएँ इंस्टॉल करें
|
|
151
|
+
run: npm install
|
|
145
152
|
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
# चरण 4: अनुवाद प्रबंधन के लिए Intlayer CLI को ग्लोबली इंस्टॉल करें
|
|
154
|
+
- name: 📦 Intlayer इंस्टॉल करें
|
|
155
|
+
run: npm install -g intlayer-cli
|
|
148
156
|
|
|
157
|
+
# चरण 5: अनुवाद फ़ाइलें उत्पन्न करने के लिए Intlayer प्रोजेक्ट बनाएं
|
|
149
158
|
- name: ⚙️ Intlayer प्रोजेक्ट बनाएं
|
|
150
159
|
run: npx intlayer build
|
|
151
160
|
|
|
161
|
+
# चरण 6: AI का उपयोग करके स्वचालित रूप से गायब अनुवाद भरें
|
|
152
162
|
- name: 🤖 गायब अनुवादों को स्वचालित रूप से भरें
|
|
153
|
-
run: npx intlayer fill --git-diff --mode fill
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
run: npx intlayer fill --git-diff --mode fill --provider $AI_PROVIDER --model $AI_MODEL --api-key $AI_API_KEY
|
|
164
|
+
|
|
165
|
+
# चरण 7: जांचें कि क्या कोई परिवर्तन हैं और उन्हें कमिट करें
|
|
166
|
+
- name: � परिवर्तनों के लिए जांच करें
|
|
167
|
+
id: check-changes
|
|
168
|
+
run: |
|
|
169
|
+
if [ -n "$(git status --porcelain)" ]; then
|
|
170
|
+
echo "has-changes=true" >> $GITHUB_OUTPUT
|
|
171
|
+
else
|
|
172
|
+
echo "has-changes=false" >> $GITHUB_OUTPUT
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
# चरण 8: यदि कोई परिवर्तन हैं तो उन्हें कमिट और पुश करें
|
|
176
|
+
- name: 📤 परिवर्तन कमिट और पुश करें
|
|
177
|
+
if: steps.check-changes.outputs.has-changes == 'true'
|
|
178
|
+
run: |
|
|
179
|
+
git config --local user.email "action@github.com"
|
|
180
|
+
git config --local user.name "GitHub Action"
|
|
181
|
+
git add .
|
|
182
|
+
git commit -m "chore: गायब अनुवादों को स्वचालित रूप से भरें [skip ci]"
|
|
183
|
+
git push origin HEAD:${{ github.head_ref }}
|
|
163
184
|
```
|
|
164
185
|
|
|
165
|
-
|
|
186
|
+
पर्यावरण चर सेट करने के लिए, GitHub → Settings → Secrets and variables → Actions पर जाएं और सीक्रेट जोड़ें।
|
|
187
|
+
|
|
188
|
+
> Husky के समान, मोनोरिपो के मामले में, आप प्रत्येक ऐप को क्रमिक रूप से संसाधित करने के लिए `--base-dir` तर्क का उपयोग कर सकते हैं।
|
|
166
189
|
|
|
167
190
|
> डिफ़ॉल्ट रूप से, `--git-diff` तर्क उन शब्दकोशों को फ़िल्टर करता है जिनमें बेस (डिफ़ॉल्ट `origin/main`) से वर्तमान शाखा (डिफ़ॉल्ट: `HEAD`) तक के परिवर्तन शामिल होते हैं।
|
|
168
191
|
|
|
@@ -170,4 +193,6 @@ jobs:
|
|
|
170
193
|
|
|
171
194
|
## दस्तावेज़ इतिहास
|
|
172
195
|
|
|
173
|
-
|
|
196
|
+
| संस्करण | दिनांक | परिवर्तन |
|
|
197
|
+
| ------- | ---------- | ------------------- |
|
|
198
|
+
| 5.5.10 | 2025-06-29 | इतिहास प्रारंभ करें |
|
package/docs/it/CI_CD.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-05-20
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-08-13
|
|
4
4
|
title: Integrazione CI/CD
|
|
5
|
-
description: Scopri come integrare Intlayer nella tua pipeline CI/CD per la gestione e il deployment
|
|
5
|
+
description: Scopri come integrare Intlayer nella tua pipeline CI/CD per la gestione e il deployment automatizzato dei contenuti.
|
|
6
6
|
keywords:
|
|
7
7
|
- CI/CD
|
|
8
8
|
- Integrazione Continua
|
|
@@ -19,13 +19,13 @@ slugs:
|
|
|
19
19
|
|
|
20
20
|
# Generazione Automatica delle Traduzioni in una Pipeline CI/CD
|
|
21
21
|
|
|
22
|
-
Intlayer consente la generazione automatica delle traduzioni per i tuoi file di dichiarazione dei contenuti. Ci sono diversi modi per
|
|
22
|
+
Intlayer consente la generazione automatica delle traduzioni per i tuoi file di dichiarazione dei contenuti. Ci sono diversi modi per raggiungere questo obiettivo a seconda del tuo flusso di lavoro.
|
|
23
23
|
|
|
24
24
|
## Utilizzo del CMS
|
|
25
25
|
|
|
26
|
-
Con Intlayer, puoi adottare un flusso di lavoro in cui viene dichiarata localmente una sola lingua, mentre tutte le traduzioni sono gestite da remoto tramite il CMS. Questo permette che
|
|
26
|
+
Con Intlayer, puoi adottare un flusso di lavoro in cui viene dichiarata localmente una sola lingua, mentre tutte le traduzioni sono gestite da remoto tramite il CMS. Questo permette che contenuti e traduzioni siano completamente separati dal codice, offrendo maggiore flessibilità agli editor di contenuti e abilitando il caricamento dinamico dei contenuti (senza bisogno di ricostruire l'applicazione per applicare le modifiche).
|
|
27
27
|
|
|
28
|
-
### Configurazione di
|
|
28
|
+
### Configurazione di Esempio
|
|
29
29
|
|
|
30
30
|
```ts fileName="intlayer.config.ts"
|
|
31
31
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
@@ -58,7 +58,7 @@ Per saperne di più sul CMS, consulta la [documentazione ufficiale](https://gith
|
|
|
58
58
|
|
|
59
59
|
Puoi integrare la generazione delle traduzioni nel tuo flusso di lavoro Git locale usando [Husky](https://typicode.github.io/husky/).
|
|
60
60
|
|
|
61
|
-
### Configurazione di
|
|
61
|
+
### Configurazione di Esempio
|
|
62
62
|
|
|
63
63
|
```ts fileName="intlayer.config.ts"
|
|
64
64
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
@@ -91,7 +91,7 @@ npx intlayer fill --unpushed --mode fill # Riempie solo i contenuti mancanti,
|
|
|
91
91
|
|
|
92
92
|
> Per maggiori informazioni sui comandi CLI di Intlayer e sul loro utilizzo, consulta la [documentazione CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/intlayer_cli.md).
|
|
93
93
|
|
|
94
|
-
> Se hai più app nel tuo repository che utilizzano istanze
|
|
94
|
+
> Se hai più app nel tuo repository che utilizzano istanze separate di Intlayer, puoi usare l'argomento `--base-dir` in questo modo:
|
|
95
95
|
|
|
96
96
|
```bash fileName=".husky/pre-push"
|
|
97
97
|
# App 1
|
|
@@ -103,70 +103,96 @@ npx intlayer build --base-dir ./app2
|
|
|
103
103
|
npx intlayer fill --base-dir ./app2 --unpushed --mode fill
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
##
|
|
106
|
+
## Utilizzo di GitHub Actions
|
|
107
107
|
|
|
108
108
|
Intlayer fornisce un comando CLI per l'autocompletamento e la revisione del contenuto del dizionario. Questo può essere integrato nel tuo flusso di lavoro CI/CD utilizzando GitHub Actions.
|
|
109
109
|
|
|
110
110
|
```yaml fileName=".github/workflows/intlayer-translate.yml"
|
|
111
|
-
name: Intlayer
|
|
111
|
+
name: Compilazione Automatica Intlayer
|
|
112
|
+
# Condizioni di attivazione per questo workflow
|
|
112
113
|
on:
|
|
113
|
-
push:
|
|
114
|
-
branches: [ main ]
|
|
115
|
-
paths:
|
|
116
|
-
- 'src/**'
|
|
117
114
|
pull_request:
|
|
118
|
-
branches:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
branches:
|
|
116
|
+
- "main"
|
|
117
|
+
|
|
118
|
+
permissions:
|
|
119
|
+
contents: write
|
|
120
|
+
pull-requests: write
|
|
122
121
|
|
|
123
122
|
concurrency:
|
|
124
|
-
group:
|
|
123
|
+
group: "autofill-${{ github.ref }}"
|
|
125
124
|
cancel-in-progress: true
|
|
126
125
|
|
|
127
126
|
jobs:
|
|
128
127
|
autofill:
|
|
129
128
|
runs-on: ubuntu-latest
|
|
130
129
|
env:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
# OpenAI
|
|
131
|
+
AI_MODEL: openai
|
|
132
|
+
AI_PROVIDER: gpt-5-mini
|
|
133
|
+
AI_API_KEY: ${{ secrets.AI_API_KEY }}
|
|
134
134
|
|
|
135
135
|
steps:
|
|
136
|
+
# Passo 1: Recupera l'ultima versione del codice dal repository
|
|
136
137
|
- name: ⬇️ Checkout repository
|
|
137
|
-
uses: actions/checkout@
|
|
138
|
+
uses: actions/checkout@v4
|
|
138
139
|
with:
|
|
139
|
-
persist-credentials: true
|
|
140
|
+
persist-credentials: true # Mantieni le credenziali per la creazione delle PR
|
|
141
|
+
fetch-depth: 0 # Ottieni tutta la cronologia git per l'analisi delle differenze
|
|
140
142
|
|
|
143
|
+
# Passo 2: Configura l'ambiente Node.js
|
|
141
144
|
- name: 🟢 Configura Node.js
|
|
142
|
-
uses: actions/setup-node@
|
|
145
|
+
uses: actions/setup-node@v4
|
|
143
146
|
with:
|
|
144
|
-
node-version: 20
|
|
147
|
+
node-version: 20 # Usa Node.js 20 LTS per stabilità
|
|
148
|
+
|
|
149
|
+
# Passo 3: Installa le dipendenze del progetto
|
|
150
|
+
- name: 📦 Installa dipendenze
|
|
151
|
+
run: npm install
|
|
145
152
|
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
# Passo 4: Installa globalmente Intlayer CLI per la gestione delle traduzioni
|
|
154
|
+
- name: 📦 Installa Intlayer
|
|
155
|
+
run: npm install -g intlayer-cli
|
|
148
156
|
|
|
149
|
-
|
|
157
|
+
# Passo 5: Compila il progetto Intlayer per generare i file di traduzione
|
|
158
|
+
- name: ⚙️ Compila progetto Intlayer
|
|
150
159
|
run: npx intlayer build
|
|
151
160
|
|
|
161
|
+
# Passo 6: Usa l'IA per compilare automaticamente le traduzioni mancanti
|
|
152
162
|
- name: 🤖 Compila automaticamente le traduzioni mancanti
|
|
153
|
-
run: npx intlayer fill --git-diff --mode fill
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
run: npx intlayer fill --git-diff --mode fill --provider $AI_PROVIDER --model $AI_MODEL --api-key $AI_API_KEY
|
|
164
|
+
|
|
165
|
+
# Passo 7: Controlla se ci sono modifiche e committale
|
|
166
|
+
- name: � Controlla modifiche
|
|
167
|
+
id: check-changes
|
|
168
|
+
run: |
|
|
169
|
+
if [ -n "$(git status --porcelain)" ]; then
|
|
170
|
+
echo "has-changes=true" >> $GITHUB_OUTPUT
|
|
171
|
+
else
|
|
172
|
+
echo "has-changes=false" >> $GITHUB_OUTPUT
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
# Passo 8: Commit e push delle modifiche se presenti
|
|
176
|
+
- name: 📤 Commit e push delle modifiche
|
|
177
|
+
if: steps.check-changes.outputs.has-changes == 'true'
|
|
178
|
+
run: |
|
|
179
|
+
git config --local user.email "action@github.com"
|
|
180
|
+
git config --local user.name "GitHub Action"
|
|
181
|
+
git add .
|
|
182
|
+
git commit -m "chore: compila automaticamente le traduzioni mancanti [skip ci]"
|
|
183
|
+
git push origin HEAD:${{ github.head_ref }}
|
|
162
184
|
```
|
|
163
185
|
|
|
164
|
-
|
|
186
|
+
Per configurare le variabili d'ambiente, vai su GitHub → Impostazioni → Segreti e variabili → Azioni e aggiungi il segreto .
|
|
187
|
+
|
|
188
|
+
> Come per Husky, nel caso di un monorepo, puoi usare l'argomento `--base-dir` per trattare sequenzialmente ogni app.
|
|
165
189
|
|
|
166
|
-
> Per impostazione predefinita, l'argomento `--git-diff` filtra i dizionari che includono modifiche dalla base (default `origin/main`) al
|
|
190
|
+
> Per impostazione predefinita, l'argomento `--git-diff` filtra i dizionari che includono modifiche dalla base (default `origin/main`) al ramo corrente (default: `HEAD`).
|
|
167
191
|
|
|
168
192
|
> Per maggiori informazioni sui comandi CLI di Intlayer e sul loro utilizzo, consulta la [documentazione CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/intlayer_cli.md).
|
|
169
193
|
|
|
170
|
-
## Cronologia
|
|
194
|
+
## Cronologia del documento
|
|
171
195
|
|
|
172
|
-
|
|
196
|
+
| Versione | Data | Modifiche |
|
|
197
|
+
| -------- | ---------- | ------------------------- |
|
|
198
|
+
| 5.5.10 | 2025-06-29 | Inizializza la cronologia |
|