@intlayer/docs 8.0.4 → 8.0.5
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/dist/cjs/blog.cjs +1 -0
- package/dist/cjs/blog.cjs.map +1 -1
- package/dist/cjs/common.cjs +1 -0
- package/dist/cjs/common.cjs.map +1 -1
- package/dist/cjs/doc.cjs +1 -0
- package/dist/cjs/doc.cjs.map +1 -1
- package/dist/cjs/frequentQuestions.cjs +1 -0
- package/dist/cjs/frequentQuestions.cjs.map +1 -1
- package/dist/cjs/generated/blog.entry.cjs +1 -0
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +21 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +1 -0
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +1 -0
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/legal.cjs +1 -0
- package/dist/cjs/legal.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +20 -0
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +1 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/ar/cli/doc-translate.md +1 -0
- package/docs/ar/cli/fill.md +1 -0
- package/docs/ar/configuration.md +10 -0
- package/docs/ar/intlayer_with_analog.md +371 -0
- package/docs/ar/intlayer_with_angular.md +12 -14
- package/docs/ar/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/de/agent_skills.md +53 -0
- package/docs/de/cli/doc-translate.md +1 -0
- package/docs/de/cli/fill.md +1 -0
- package/docs/de/configuration.md +10 -0
- package/docs/de/intlayer_with_analog.md +369 -0
- package/docs/de/intlayer_with_angular.md +11 -16
- package/docs/de/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/en/agent_skills.md +53 -0
- package/docs/en/cli/doc-translate.md +1 -0
- package/docs/en/cli/fill.md +1 -0
- package/docs/en/configuration.md +21 -1
- package/docs/en/intlayer_with_analog.md +4 -12
- package/docs/en/intlayer_with_angular.md +13 -15
- package/docs/en/packages/react-intlayer/useIntlayer.md +1 -1
- package/docs/en/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/en-GB/cli/doc-translate.md +1 -0
- package/docs/en-GB/cli/fill.md +1 -0
- package/docs/en-GB/configuration.md +10 -0
- package/docs/en-GB/intlayer_with_analog.md +369 -0
- package/docs/en-GB/intlayer_with_angular.md +12 -14
- package/docs/en-GB/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/es/agent_skills.md +53 -0
- package/docs/es/cli/doc-translate.md +1 -0
- package/docs/es/cli/fill.md +1 -0
- package/docs/es/configuration.md +10 -0
- package/docs/es/intlayer_with_analog.md +369 -0
- package/docs/es/intlayer_with_angular.md +11 -16
- package/docs/es/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/fr/agent_skills.md +53 -0
- package/docs/fr/cli/doc-translate.md +1 -0
- package/docs/fr/cli/fill.md +1 -0
- package/docs/fr/configuration.md +10 -0
- package/docs/fr/intlayer_with_analog.md +369 -0
- package/docs/fr/intlayer_with_angular.md +11 -16
- package/docs/fr/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/hi/cli/doc-translate.md +1 -0
- package/docs/hi/cli/fill.md +1 -0
- package/docs/hi/configuration.md +10 -0
- package/docs/hi/intlayer_with_analog.md +371 -0
- package/docs/hi/intlayer_with_angular.md +12 -14
- package/docs/hi/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/id/cli/doc-translate.md +1 -0
- package/docs/id/cli/fill.md +1 -0
- package/docs/id/configuration.md +10 -0
- package/docs/id/intlayer_with_analog.md +371 -0
- package/docs/id/intlayer_with_angular.md +12 -14
- package/docs/id/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/it/agent_skills.md +53 -0
- package/docs/it/cli/doc-translate.md +1 -0
- package/docs/it/cli/fill.md +1 -0
- package/docs/it/configuration.md +10 -0
- package/docs/it/intlayer_with_analog.md +371 -0
- package/docs/it/intlayer_with_angular.md +12 -14
- package/docs/it/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/ja/agent_skills.md +53 -0
- package/docs/ja/cli/doc-translate.md +1 -0
- package/docs/ja/cli/fill.md +1 -0
- package/docs/ja/configuration.md +10 -0
- package/docs/ja/intlayer_with_analog.md +365 -0
- package/docs/ja/intlayer_with_angular.md +12 -14
- package/docs/ja/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/ko/agent_skills.md +53 -0
- package/docs/ko/cli/doc-translate.md +1 -0
- package/docs/ko/cli/fill.md +1 -0
- package/docs/ko/configuration.md +10 -0
- package/docs/ko/intlayer_with_analog.md +365 -0
- package/docs/ko/intlayer_with_angular.md +12 -14
- package/docs/ko/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/pl/cli/doc-translate.md +1 -0
- package/docs/pl/cli/fill.md +1 -0
- package/docs/pl/configuration.md +10 -0
- package/docs/pl/intlayer_with_analog.md +371 -0
- package/docs/pl/intlayer_with_angular.md +12 -14
- package/docs/pl/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/pt/agent_skills.md +53 -0
- package/docs/pt/cli/doc-translate.md +1 -0
- package/docs/pt/cli/fill.md +1 -0
- package/docs/pt/configuration.md +10 -0
- package/docs/pt/intlayer_with_analog.md +371 -0
- package/docs/pt/intlayer_with_angular.md +12 -14
- package/docs/pt/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/ru/cli/doc-translate.md +1 -0
- package/docs/ru/cli/fill.md +1 -0
- package/docs/ru/configuration.md +18 -0
- package/docs/ru/intlayer_with_analog.md +371 -0
- package/docs/ru/intlayer_with_angular.md +12 -14
- package/docs/ru/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/tr/cli/doc-translate.md +1 -0
- package/docs/tr/cli/fill.md +1 -0
- package/docs/tr/configuration.md +10 -0
- package/docs/tr/intlayer_with_analog.md +365 -0
- package/docs/tr/intlayer_with_angular.md +12 -14
- package/docs/tr/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/uk/cli/doc-translate.md +1 -0
- package/docs/uk/cli/fill.md +1 -0
- package/docs/uk/configuration.md +10 -0
- package/docs/uk/intlayer_with_analog.md +365 -0
- package/docs/uk/intlayer_with_angular.md +12 -14
- package/docs/uk/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/vi/configuration.md +10 -0
- package/docs/vi/intlayer_with_analog.md +365 -0
- package/docs/vi/intlayer_with_angular.md +12 -14
- package/docs/vi/packages/solid-intlayer/useIntlayer.md +1 -1
- package/docs/zh/agent_skills.md +53 -0
- package/docs/zh/configuration.md +10 -0
- package/docs/zh/intlayer_with_analog.md +365 -0
- package/docs/zh/intlayer_with_angular.md +12 -14
- package/docs/zh/packages/solid-intlayer/useIntlayer.md +1 -1
- package/package.json +8 -8
- package/src/generated/docs.entry.ts +20 -0
|
@@ -14,6 +14,9 @@ slugs:
|
|
|
14
14
|
- concept
|
|
15
15
|
- configuration
|
|
16
16
|
history:
|
|
17
|
+
- version: 8.0.5
|
|
18
|
+
date: 2026-02-06
|
|
19
|
+
changes: Add `dataSerialization` to the AI configuration
|
|
17
20
|
- version: 8.0.0
|
|
18
21
|
date: 2026-01-22
|
|
19
22
|
changes: Move `importMode` build configuration to `dictionary` configuration.
|
|
@@ -899,6 +902,13 @@ Intlayer supports multiple AI providers for enhanced flexibility and choice. Cur
|
|
|
899
902
|
- _Example_: `'https://api.openai.com/v1'`
|
|
900
903
|
- _Note_: Can be used to point to a local, or custom AI API endpoint.
|
|
901
904
|
|
|
905
|
+
- **dataSerialization**:
|
|
906
|
+
- _Type_: `'json' | 'toon'`
|
|
907
|
+
- _Default_: `'json'`
|
|
908
|
+
- _Description_: The data serialization format to use for the AI features of Intlayer.
|
|
909
|
+
- _Example_: `'toon'`
|
|
910
|
+
- _Note_: `json`: Standard, reliable; uses more tokens. `toon`: Fewer tokens, less consistent than JSON.
|
|
911
|
+
|
|
902
912
|
### Build Configuration
|
|
903
913
|
|
|
904
914
|
Settings that control how Intlayer optimises and builds your application's internationalisation.
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-04-18
|
|
3
|
+
updatedAt: 2025-12-30
|
|
4
|
+
title: Analog i18n - How to translate your Analog app – guide 2026
|
|
5
|
+
description: Discover how to make your Analog app multilingual. Follow the documentation to internationalise (i18n) and translate it.
|
|
6
|
+
keywords:
|
|
7
|
+
- Internationalisation
|
|
8
|
+
- Documentation
|
|
9
|
+
- Intlayer
|
|
10
|
+
- Analog
|
|
11
|
+
- Angular
|
|
12
|
+
- JavaScript
|
|
13
|
+
slugs:
|
|
14
|
+
- doc
|
|
15
|
+
- environment
|
|
16
|
+
- analog
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer/tree/main/examples/analog-app-template
|
|
18
|
+
history:
|
|
19
|
+
- version: 8.0.4
|
|
20
|
+
date: 2026-01-26
|
|
21
|
+
changes: Init history
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Translate your Analog (Angular) app using Intlayer | Internationalisation (i18n)
|
|
25
|
+
|
|
26
|
+
## Table of Contents
|
|
27
|
+
|
|
28
|
+
<TOC/>
|
|
29
|
+
|
|
30
|
+
## What is Intlayer?
|
|
31
|
+
|
|
32
|
+
**Intlayer** is an innovative, open-source internationalisation (i18n) library designed to simplify multilingual support in modern web applications.
|
|
33
|
+
|
|
34
|
+
With Intlayer, you can:
|
|
35
|
+
|
|
36
|
+
- **Easily manage translations** using declarative dictionaries at the component level.
|
|
37
|
+
- **Dynamically localise metadata**, routes, and content.
|
|
38
|
+
- **Ensure TypeScript support** with autogenerated types, improving autocompletion and error detection.
|
|
39
|
+
- **Benefit from advanced features**, like dynamic locale detection and switching.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step-by-Step Guide to Set Up Intlayer in an Analog Application
|
|
44
|
+
|
|
45
|
+
<Tabs defaultTab="code">
|
|
46
|
+
<Tab label="Code" value="code">
|
|
47
|
+
|
|
48
|
+
<iframe
|
|
49
|
+
src="https://stackblitz.com/github/aymericzip/intlayer/tree/main/examples/vite-analog-app?embed=1&ctl=1&file=intlayer.config.ts"
|
|
50
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
51
|
+
title="Demo CodeSandbox - How to Internationalise your application using Intlayer"
|
|
52
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
53
|
+
loading="lazy"
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
</Tab>
|
|
57
|
+
</Tabs>
|
|
58
|
+
|
|
59
|
+
See [Application Template](https://github.com/aymericzip/intlayer/tree/main/examples/analog-app-template) on GitHub.
|
|
60
|
+
|
|
61
|
+
### Step 1: Install Dependencies
|
|
62
|
+
|
|
63
|
+
Install the necessary packages using npm:
|
|
64
|
+
|
|
65
|
+
```bash packageManager="npm"
|
|
66
|
+
npm install intlayer angular-intlayer vite-intlayer
|
|
67
|
+
npx intlayer init
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```bash packageManager="pnpm"
|
|
71
|
+
pnpm add intlayer angular-intlayer vite-intlayer
|
|
72
|
+
pnpm intlayer init
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```bash packageManager="yarn"
|
|
76
|
+
yarn add intlayer angular-intlayer vite-intlayer
|
|
77
|
+
yarn intlayer init
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```bash packageManager="bun"
|
|
81
|
+
bun add intlayer angular-intlayer vite-intlayer
|
|
82
|
+
bunx intlayer init
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- **intlayer**
|
|
86
|
+
|
|
87
|
+
The core package that provides internationalisation tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/dictionary/content_file.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/cli/index.md).
|
|
88
|
+
|
|
89
|
+
- **angular-intlayer**
|
|
90
|
+
The package that integrates Intlayer with Angular application. It provides context providers and hooks for Angular internationalisation.
|
|
91
|
+
|
|
92
|
+
- **vite-intlayer**
|
|
93
|
+
The package that integrates Intlayer with Vite. It provides a plugin to handle content declaration files and sets up aliases for optimal performance.
|
|
94
|
+
|
|
95
|
+
### Step 2: Configuration of your project
|
|
96
|
+
|
|
97
|
+
Create a config file to configure the languages of your application:
|
|
98
|
+
|
|
99
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
100
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
101
|
+
|
|
102
|
+
const config: IntlayerConfig = {
|
|
103
|
+
internationalisation: {
|
|
104
|
+
locales: [
|
|
105
|
+
Locales.ENGLISH,
|
|
106
|
+
Locales.FRENCH,
|
|
107
|
+
Locales.SPANISH,
|
|
108
|
+
// Your other locales
|
|
109
|
+
],
|
|
110
|
+
defaultLocale: Locales.ENGLISH,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export default config;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
118
|
+
import { Locales } from "intlayer";
|
|
119
|
+
|
|
120
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
121
|
+
const config = {
|
|
122
|
+
internationalisation: {
|
|
123
|
+
locales: [
|
|
124
|
+
Locales.ENGLISH,
|
|
125
|
+
Locales.FRENCH,
|
|
126
|
+
Locales.SPANISH,
|
|
127
|
+
// Your other locales
|
|
128
|
+
],
|
|
129
|
+
defaultLocale: Locales.ENGLISH,
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export default config;
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
137
|
+
const { Locales } = require("intlayer");
|
|
138
|
+
|
|
139
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
140
|
+
const config = {
|
|
141
|
+
internationalisation: {
|
|
142
|
+
locales: [
|
|
143
|
+
Locales.ENGLISH,
|
|
144
|
+
Locales.FRENCH,
|
|
145
|
+
Locales.SPANISH,
|
|
146
|
+
// Your other locales
|
|
147
|
+
],
|
|
148
|
+
defaultLocale: Locales.ENGLISH,
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
module.exports = config;
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
> Through this configuration file, you can set up localised URLs, middleware redirection, cookie names, the location and extension of your content declarations, disable Intlayer logs in the console, and more. For a complete list of available parameters, refer to the [configuration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/configuration.md).
|
|
156
|
+
|
|
157
|
+
### Step 3: Integrate Intlayer in Your Vite Configuration
|
|
158
|
+
|
|
159
|
+
To integrate Intlayer with Analog, you need to use the `vite-intlayer` plugin.
|
|
160
|
+
|
|
161
|
+
Modify your `vite.config.ts` file:
|
|
162
|
+
|
|
163
|
+
```typescript fileName="vite.config.ts"
|
|
164
|
+
import { defineConfig } from "vite";
|
|
165
|
+
import { intlayer } from "vite-intlayer";
|
|
166
|
+
import analog from "@analogjs/platform";
|
|
167
|
+
|
|
168
|
+
// https://vitejs.dev/config/
|
|
169
|
+
export default defineConfig(() => ({
|
|
170
|
+
plugins: [
|
|
171
|
+
analog(),
|
|
172
|
+
intlayer(), // Add the Intlayer plugin
|
|
173
|
+
],
|
|
174
|
+
}));
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
> The `intlayer()` plugin configures Vite with Intlayer. It handles content declaration files and sets up aliases for optimal performance.
|
|
178
|
+
|
|
179
|
+
### Step 4: Declare Your Content
|
|
180
|
+
|
|
181
|
+
Create and manage your content declarations to store translations:
|
|
182
|
+
|
|
183
|
+
```tsx fileName="src/app/app.content.ts" contentDeclarationFormat="typescript"
|
|
184
|
+
import { t, type Dictionary } from "intlayer";
|
|
185
|
+
|
|
186
|
+
const appContent = {
|
|
187
|
+
key: "app",
|
|
188
|
+
content: {
|
|
189
|
+
title: t({
|
|
190
|
+
en: "Hello",
|
|
191
|
+
fr: "Bonjour",
|
|
192
|
+
es: "Hola",
|
|
193
|
+
}),
|
|
194
|
+
congratulations: t({
|
|
195
|
+
en: "Congratulations! Your app is running. 🎉",
|
|
196
|
+
fr: "Félicitations! Votre application est en cours d'exécution. 🎉",
|
|
197
|
+
es: "¡Felicidades! Tu aplicación está en ejecución. 🎉",
|
|
198
|
+
}),
|
|
199
|
+
},
|
|
200
|
+
} satisfies Dictionary;
|
|
201
|
+
|
|
202
|
+
export default appContent;
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
> Your content declarations can be defined anywhere in your application as soon they are included into the `contentDir` directory (by default, `./src`). And match the content declaration file extension (by default, `.content.{json,ts,tsx,js,jsx,mjs,cjs}`).
|
|
206
|
+
|
|
207
|
+
> For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/dictionary/content_file.md).
|
|
208
|
+
|
|
209
|
+
### Step 5: Utilise Intlayer in Your Code
|
|
210
|
+
|
|
211
|
+
To utilise Intlayer's internationalisation features throughout your Analog application, you need to provide Intlayer in your application configuration.
|
|
212
|
+
|
|
213
|
+
```typescript fileName="src/app/app.config.ts"
|
|
214
|
+
import { ApplicationConfig } from "@angular/core";
|
|
215
|
+
import { provideIntlayer } from "angular-intlayer";
|
|
216
|
+
|
|
217
|
+
export const appConfig: ApplicationConfig = {
|
|
218
|
+
providers: [
|
|
219
|
+
provideIntlayer(), // Add the Intlayer provider here
|
|
220
|
+
],
|
|
221
|
+
};
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Then, you can use the `useIntlayer` function within any component.
|
|
225
|
+
|
|
226
|
+
```typescript fileName="src/app/pages/index.page.ts"
|
|
227
|
+
import { Component } from "@angular/core";
|
|
228
|
+
import { useIntlayer } from "angular-intlayer";
|
|
229
|
+
|
|
230
|
+
@Component({
|
|
231
|
+
selector: "app-home",
|
|
232
|
+
standalone: true,
|
|
233
|
+
template: `
|
|
234
|
+
<div class="content">
|
|
235
|
+
<h1>{{ content().title }}</h1>
|
|
236
|
+
<p>{{ content().congratulations }}</p>
|
|
237
|
+
</div>
|
|
238
|
+
`,
|
|
239
|
+
})
|
|
240
|
+
export default class HomeComponent {
|
|
241
|
+
content = useIntlayer("app");
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Intlayer content is returned as a `Signal`, so you access the values by calling the signal: `content().title`.
|
|
246
|
+
|
|
247
|
+
### (Optional) Step 6: Change the language of your content
|
|
248
|
+
|
|
249
|
+
To change the language of your content, you can use the `setLocale` function provided by the `useLocale` function. This allows you to set the locale of the application and update the content accordingly.
|
|
250
|
+
|
|
251
|
+
Create a component to switch between languages:
|
|
252
|
+
|
|
253
|
+
```typescript fileName="src/app/locale-switcher.component.ts"
|
|
254
|
+
import { Component } from "@angular/core";
|
|
255
|
+
import { CommonModule } from "@angular/common";
|
|
256
|
+
import { useLocale } from "angular-intlayer";
|
|
257
|
+
|
|
258
|
+
@Component({
|
|
259
|
+
selector: "app-locale-switcher",
|
|
260
|
+
standalone: true,
|
|
261
|
+
imports: [CommonModule],
|
|
262
|
+
template: `
|
|
263
|
+
<div class="locale-switcher">
|
|
264
|
+
<select
|
|
265
|
+
[value]="locale()"
|
|
266
|
+
(change)="setLocale($any($event.target).value)"
|
|
267
|
+
>
|
|
268
|
+
@for (loc of availableLocales; track loc) {
|
|
269
|
+
<option [value]="loc">{{ loc }}</option>
|
|
270
|
+
}
|
|
271
|
+
</select>
|
|
272
|
+
</div>
|
|
273
|
+
`,
|
|
274
|
+
styles: [
|
|
275
|
+
`
|
|
276
|
+
.locale-switcher {
|
|
277
|
+
margin: 1rem;
|
|
278
|
+
padding: 0.5rem;
|
|
279
|
+
border: 1px solid #ccc;
|
|
280
|
+
border-radius: 4px;
|
|
281
|
+
width: fit-content;
|
|
282
|
+
}
|
|
283
|
+
`,
|
|
284
|
+
],
|
|
285
|
+
})
|
|
286
|
+
export class LocaleSwitcherComponent {
|
|
287
|
+
localeCtx = useLocale();
|
|
288
|
+
|
|
289
|
+
locale = this.localeCtx.locale;
|
|
290
|
+
availableLocales = this.localeCtx.availableLocales;
|
|
291
|
+
setLocale = this.localeCtx.setLocale;
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Then, use this component in your pages:
|
|
296
|
+
|
|
297
|
+
```typescript fileName="src/app/pages/index.page.ts"
|
|
298
|
+
import { Component } from "@angular/core";
|
|
299
|
+
import { useIntlayer } from "angular-intlayer";
|
|
300
|
+
import { LocaleSwitcherComponent } from "../locale-switcher.component";
|
|
301
|
+
|
|
302
|
+
@Component({
|
|
303
|
+
selector: "app-home",
|
|
304
|
+
standalone: true,
|
|
305
|
+
imports: [LocaleSwitcherComponent],
|
|
306
|
+
template: `
|
|
307
|
+
<app-locale-switcher></app-locale-switcher>
|
|
308
|
+
<div class="content">
|
|
309
|
+
<h1>{{ content().title }}</h1>
|
|
310
|
+
<p>{{ content().congratulations }}</p>
|
|
311
|
+
</div>
|
|
312
|
+
`,
|
|
313
|
+
})
|
|
314
|
+
export default class HomeComponent {
|
|
315
|
+
content = useIntlayer("app");
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Configure TypeScript
|
|
320
|
+
|
|
321
|
+
Intlayer uses module augmentation to get benefits of TypeScript and make your codebase stronger.
|
|
322
|
+
|
|
323
|
+

|
|
324
|
+
|
|
325
|
+

|
|
326
|
+
|
|
327
|
+
Ensure your TypeScript configuration includes the autogenerated types.
|
|
328
|
+
|
|
329
|
+
```json5 fileName="tsconfig.json"
|
|
330
|
+
{
|
|
331
|
+
// ... Your existing TypeScript configurations
|
|
332
|
+
"include": [
|
|
333
|
+
// ... Your existing TypeScript configurations
|
|
334
|
+
".intlayer/**/*.ts", // Include the auto-generated types
|
|
335
|
+
],
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
### Git Configuration
|
|
340
|
+
|
|
341
|
+
It is recommended to ignore the files generated by Intlayer. This allows you to avoid committing them to your Git repository.
|
|
342
|
+
|
|
343
|
+
To do this, you can add the following instructions to your `.gitignore` file:
|
|
344
|
+
|
|
345
|
+
```plaintext
|
|
346
|
+
# Ignore the files generated by Intlayer
|
|
347
|
+
.intlayer
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### VS Code Extension
|
|
351
|
+
|
|
352
|
+
To improve your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
|
|
353
|
+
|
|
354
|
+
[Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
355
|
+
|
|
356
|
+
This extension provides:
|
|
357
|
+
|
|
358
|
+
- **Autocompletion** for translation keys.
|
|
359
|
+
- **Real-time error detection** for missing translations.
|
|
360
|
+
- **Inline previews** of translated content.
|
|
361
|
+
- **Quick actions** to easily create and update translations.
|
|
362
|
+
|
|
363
|
+
For more details on how to use the extension, refer to the [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
### Go Further
|
|
368
|
+
|
|
369
|
+
To go further, you can implement the [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/intlayer_visual_editor.md) or externalise your content using the [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/intlayer_CMS.md).
|
|
@@ -169,30 +169,28 @@ To integrate Intlayer with the Angular CLI, you need to use a custom builder. Th
|
|
|
169
169
|
|
|
170
170
|
First, modify your `angular.json` to use the custom Webpack builder. Update the `build` and `serve` configurations:
|
|
171
171
|
|
|
172
|
-
```
|
|
172
|
+
```json5 fileName="angular.json"
|
|
173
173
|
{
|
|
174
174
|
"projects": {
|
|
175
175
|
"your-app-name": {
|
|
176
176
|
"architect": {
|
|
177
177
|
"build": {
|
|
178
|
-
"builder": "@angular-builders/custom-webpack:browser",
|
|
178
|
+
"builder": "@angular-builders/custom-webpack:browser", // replace "@angular-devkit/build-angular:application",
|
|
179
179
|
"options": {
|
|
180
180
|
"customWebpackConfig": {
|
|
181
|
-
"path": "./webpack.config.ts"
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
"path": "./webpack.config.ts",
|
|
182
|
+
"mergeStrategies": { "module.rules": "prepend" },
|
|
183
|
+
},
|
|
184
|
+
"main": "src/main.ts", // replace "browser": "src/main.ts",
|
|
185
|
+
// ...
|
|
186
|
+
},
|
|
184
187
|
},
|
|
185
188
|
"serve": {
|
|
186
189
|
"builder": "@angular-builders/custom-webpack:dev-server",
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
196
194
|
}
|
|
197
195
|
```
|
|
198
196
|
|
|
@@ -33,7 +33,7 @@ The `useIntlayer` hook allows you to retrieve localised content from a dictionar
|
|
|
33
33
|
import { useIntlayer } from "solid-intlayer";
|
|
34
34
|
|
|
35
35
|
const MyComponent = () => {
|
|
36
|
-
const content = useIntlayer("
|
|
36
|
+
const content = useIntlayer("my-dictionary-key");
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<div>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2026-02-09
|
|
3
|
+
updatedAt: 2026-02-09
|
|
4
|
+
title: Habilidades del Agente
|
|
5
|
+
description: Aprende a usar las habilidades del agente Intlayer para mejorar la comprensión de tu proyecto por parte de tu agente de IA.
|
|
6
|
+
keywords:
|
|
7
|
+
- Intlayer
|
|
8
|
+
- Habilidades del Agente
|
|
9
|
+
- Agente de IA
|
|
10
|
+
- Internacionalización
|
|
11
|
+
- Documentación
|
|
12
|
+
slugs:
|
|
13
|
+
- doc
|
|
14
|
+
- agent_skills
|
|
15
|
+
history:
|
|
16
|
+
- version: 8.0.4
|
|
17
|
+
date: 2026-02-09
|
|
18
|
+
changes: Inicializar historial
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## El comando `intlayer init skills`
|
|
22
|
+
|
|
23
|
+
El comando `intlayer init skills` es la forma más fácil de configurar las habilidades del agente en tu proyecto. Detecta tu entorno e instala los archivos de configuración necesarios para tus plataformas preferidas.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx intlayer init skills
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Cuando ejecutas este comando, este:
|
|
30
|
+
|
|
31
|
+
1. Detectará el framework que estás usando (por ejemplo, Next.js, React, Vite).
|
|
32
|
+
2. Te preguntará para qué plataformas quieres instalar las habilidades (Cursor, VS Code, OpenCode, Claude Code, etc.).
|
|
33
|
+
3. Generará los archivos de configuración necesarios (como `.cursor/mcp.json`, `.vscode/mcp.json` o `.intlayer/skills/*.md`).
|
|
34
|
+
|
|
35
|
+
## Plataformas Soportadas
|
|
36
|
+
|
|
37
|
+
Intlayer admite la integración con las siguientes plataformas:
|
|
38
|
+
|
|
39
|
+
### 1. Cursor
|
|
40
|
+
|
|
41
|
+
Cursor admite servidores MCP (Model Context Protocol). Al ejecutar `intlayer init skills` se creará un archivo `.cursor/mcp.json` que permite a Cursor comunicarse con el servidor MCP de Intlayer.
|
|
42
|
+
|
|
43
|
+
### 2. VS Code
|
|
44
|
+
|
|
45
|
+
Para los usuarios de VS Code, especialmente aquellos que usan GitHub Copilot u otras extensiones compatibles con MCP, el comando crea una configuración `.vscode/mcp.json`.
|
|
46
|
+
|
|
47
|
+
### 3. OpenCode
|
|
48
|
+
|
|
49
|
+
OpenCode es un agente de CLI interactivo diseñado para tareas de ingeniería de software. Intlayer proporciona habilidades específicas para ayudar a OpenCode a asistirte en las tareas de internacionalización.
|
|
50
|
+
|
|
51
|
+
### 4. Claude Code
|
|
52
|
+
|
|
53
|
+
Claude Code se puede configurar para usar las habilidades de Intlayer agregando las configuraciones generadas a sus ajustes de escritorio o CLI.
|
|
@@ -86,6 +86,7 @@ npx intlayer doc translate
|
|
|
86
86
|
- **`--temperature [temperature]`**: Configuración de temperatura para el modelo de IA.
|
|
87
87
|
- **`--api-key [apiKey]`**: Proporciona tu propia clave API para el servicio de IA.
|
|
88
88
|
- **`--application-context [applicationContext]`**: Proporciona contexto adicional para la traducción de IA.
|
|
89
|
+
- **`--data-serialization [dataSerialization]`**: El formato de serialización de datos a utilizar para las funciones de IA de Intlayer. Opciones: `json` (estándar, confiable), `toon` (menos tokens, menos consistente).
|
|
89
90
|
- **`--custom-prompt [prompt]`**: Personaliza el prompt base utilizado para la traducción. (Nota: Para la mayoría de los casos, se recomienda usar la opción `--custom-instructions` en su lugar, ya que proporciona un mejor control sobre el comportamiento de la traducción.)
|
|
90
91
|
|
|
91
92
|
> Ejemplo: `npx intlayer doc translate --model deepseek-chat --provider deepseek --temperature 0.5 --api-key sk-1234567890 --application-context "Mi aplicación es una tienda de gatos"`
|
package/docs/es/cli/fill.md
CHANGED
|
@@ -126,6 +126,7 @@ Affected dictionary keys for processing: app, comp-test, hello-world, lang-switc
|
|
|
126
126
|
- **`--api-key [apiKey]`**: Proporciona tu propia clave API para el servicio de IA.
|
|
127
127
|
- **`--custom-prompt [prompt]`**: Proporciona un prompt personalizado para tus instrucciones de traducción.
|
|
128
128
|
- **`--application-context [applicationContext]`**: Proporciona contexto adicional para la traducción por IA.
|
|
129
|
+
- **`--data-serialization [dataSerialization]`**: El formato de serialización de datos a utilizar para las funciones de IA de Intlayer. Opciones: `json` (estándar, confiable), `toon` (menos tokens, menos consistente).
|
|
129
130
|
|
|
130
131
|
> Ejemplo: `npx intlayer fill --model gpt-3.5-turbo --provider openai --temperature 0.5 --api-key sk-1234567890 --application-context "Mi aplicación es una tienda de gatos"`
|
|
131
132
|
|
package/docs/es/configuration.md
CHANGED
|
@@ -14,6 +14,9 @@ slugs:
|
|
|
14
14
|
- concept
|
|
15
15
|
- configuration
|
|
16
16
|
history:
|
|
17
|
+
- version: 8.0.5
|
|
18
|
+
date: 2026-02-06
|
|
19
|
+
changes: Añadir `dataSerialization` a la configuración de IA
|
|
17
20
|
- version: 8.0.0
|
|
18
21
|
date: 2026-01-22
|
|
19
22
|
changes: Move `importMode` build configuration to `dictionary` configuration.
|
|
@@ -892,6 +895,13 @@ Intlayer admite múltiples proveedores de IA para una mayor flexibilidad y elecc
|
|
|
892
895
|
- _Ejemplo_: `'https://api.openai.com/v1'`
|
|
893
896
|
- _Nota_: Puede usarse para apuntar a un endpoint de API de IA local o personalizado.
|
|
894
897
|
|
|
898
|
+
- **dataSerialization**:
|
|
899
|
+
- _Tipo_: `'json' | 'toon'`
|
|
900
|
+
- _Por defecto_: `'json'`
|
|
901
|
+
- _Descripción_: El formato de serialización de datos a utilizar para las funciones de IA de Intlayer.
|
|
902
|
+
- _Ejemplo_: `'toon'`
|
|
903
|
+
- _Nota_: `json`: Estándar, confiable; utiliza más tokens. `toon`: Menos tokens, menos consistente que JSON.
|
|
904
|
+
|
|
895
905
|
### Configuración de compilación
|
|
896
906
|
|
|
897
907
|
Configuraciones que controlan cómo Intlayer optimiza y construye la internacionalización de su aplicación.
|