@intlayer/docs 8.5.0 → 8.5.1
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/dictionary/html.md +10 -3
- package/docs/ar/dictionary/markdown.md +15 -17
- package/docs/ar/intlayer_with_analog.md +8 -14
- package/docs/ar/intlayer_with_vite+lit.md +8 -57
- package/docs/ar/intlayer_with_vite+vue.md +3 -3
- package/docs/bn/intlayer_with_vite+lit.md +8 -57
- package/docs/cs/intlayer_with_vite+lit.md +8 -57
- package/docs/de/compiler.md +6 -1
- package/docs/de/configuration.md +12 -9
- package/docs/de/dictionary/html.md +11 -8
- package/docs/de/dictionary/markdown.md +17 -23
- package/docs/de/intlayer_with_analog.md +8 -14
- package/docs/de/intlayer_with_vite+lit.md +8 -57
- package/docs/de/intlayer_with_vite+vue.md +3 -3
- package/docs/en/compiler.md +2 -0
- package/docs/en/configuration.md +8 -8
- package/docs/en/dictionary/html.md +12 -9
- package/docs/en/dictionary/markdown.md +18 -24
- package/docs/en/intlayer_with_analog.md +8 -14
- package/docs/en/intlayer_with_vite+lit.md +10 -57
- package/docs/en/intlayer_with_vite+vue.md +13 -3
- package/docs/en-GB/dictionary/html.md +10 -3
- package/docs/en-GB/dictionary/markdown.md +16 -18
- package/docs/en-GB/intlayer_with_analog.md +8 -14
- package/docs/en-GB/intlayer_with_vite+lit.md +10 -57
- package/docs/en-GB/intlayer_with_vite+vue.md +3 -3
- package/docs/es/compiler.md +6 -1
- package/docs/es/configuration.md +12 -9
- package/docs/es/dictionary/html.md +11 -8
- package/docs/es/dictionary/markdown.md +18 -24
- package/docs/es/intlayer_with_analog.md +8 -14
- package/docs/es/intlayer_with_vite+lit.md +8 -57
- package/docs/es/intlayer_with_vite+vue.md +3 -3
- package/docs/fr/compiler.md +8 -3
- package/docs/fr/configuration.md +12 -9
- package/docs/fr/dictionary/html.md +11 -8
- package/docs/fr/dictionary/markdown.md +18 -24
- package/docs/fr/intlayer_with_analog.md +8 -14
- package/docs/fr/intlayer_with_vite+lit.md +8 -57
- package/docs/fr/intlayer_with_vite+vue.md +3 -3
- package/docs/hi/dictionary/html.md +10 -3
- package/docs/hi/dictionary/markdown.md +17 -19
- package/docs/hi/intlayer_with_analog.md +8 -14
- package/docs/hi/intlayer_with_vite+lit.md +8 -57
- package/docs/hi/intlayer_with_vite+vue.md +3 -3
- package/docs/id/dictionary/html.md +10 -3
- package/docs/id/dictionary/markdown.md +17 -19
- package/docs/id/intlayer_with_analog.md +8 -14
- package/docs/id/intlayer_with_vite+lit.md +8 -57
- package/docs/id/intlayer_with_vite+vue.md +3 -3
- package/docs/it/compiler.md +8 -3
- package/docs/it/configuration.md +12 -9
- package/docs/it/dictionary/html.md +11 -8
- package/docs/it/dictionary/markdown.md +18 -24
- package/docs/it/intlayer_with_analog.md +8 -14
- package/docs/it/intlayer_with_vite+lit.md +8 -57
- package/docs/it/intlayer_with_vite+vue.md +3 -3
- package/docs/ja/dictionary/html.md +11 -8
- package/docs/ja/dictionary/markdown.md +21 -24
- package/docs/ja/intlayer_with_analog.md +8 -14
- package/docs/ja/intlayer_with_vite+lit.md +8 -57
- package/docs/ja/intlayer_with_vite+vue.md +3 -3
- package/docs/ko/dictionary/html.md +11 -8
- package/docs/ko/dictionary/markdown.md +18 -24
- package/docs/ko/intlayer_with_analog.md +8 -14
- package/docs/ko/intlayer_with_vite+lit.md +8 -57
- package/docs/ko/intlayer_with_vite+vue.md +3 -3
- package/docs/nl/intlayer_with_vite+lit.md +8 -57
- package/docs/pl/dictionary/html.md +11 -8
- package/docs/pl/dictionary/markdown.md +18 -24
- package/docs/pl/intlayer_with_analog.md +8 -14
- package/docs/pl/intlayer_with_vite+lit.md +8 -57
- package/docs/pl/intlayer_with_vite+vue.md +3 -3
- package/docs/pt/compiler.md +7 -2
- package/docs/pt/configuration.md +11 -9
- package/docs/pt/dictionary/html.md +11 -8
- package/docs/pt/dictionary/markdown.md +18 -24
- package/docs/pt/intlayer_with_analog.md +8 -14
- package/docs/pt/intlayer_with_vite+lit.md +8 -57
- package/docs/pt/intlayer_with_vite+vue.md +3 -3
- package/docs/ru/dictionary/html.md +11 -8
- package/docs/ru/dictionary/markdown.md +18 -24
- package/docs/ru/intlayer_with_analog.md +8 -14
- package/docs/ru/intlayer_with_vite+lit.md +8 -57
- package/docs/ru/intlayer_with_vite+vue.md +3 -3
- package/docs/tr/dictionary/html.md +11 -8
- package/docs/tr/dictionary/markdown.md +18 -24
- package/docs/tr/intlayer_with_analog.md +8 -14
- package/docs/tr/intlayer_with_vite+lit.md +8 -57
- package/docs/tr/intlayer_with_vite+vue.md +3 -3
- package/docs/uk/dictionary/html.md +10 -3
- package/docs/uk/dictionary/markdown.md +17 -19
- package/docs/uk/intlayer_with_analog.md +8 -14
- package/docs/uk/intlayer_with_vite+lit.md +8 -57
- package/docs/uk/intlayer_with_vite+vue.md +3 -3
- package/docs/ur/intlayer_with_vite+lit.md +8 -57
- package/docs/vi/dictionary/html.md +10 -3
- package/docs/vi/dictionary/markdown.md +17 -19
- package/docs/vi/intlayer_with_analog.md +8 -14
- package/docs/vi/intlayer_with_vite+lit.md +8 -57
- package/docs/vi/intlayer_with_vite+vue.md +3 -3
- package/docs/zh/compiler.md +8 -3
- package/docs/zh/configuration.md +4 -1
- package/docs/zh/dictionary/html.md +11 -8
- package/docs/zh/dictionary/markdown.md +18 -24
- package/docs/zh/intlayer_with_analog.md +8 -14
- package/docs/zh/intlayer_with_vite+lit.md +8 -57
- package/docs/zh/intlayer_with_vite+vue.md +3 -3
- package/package.json +6 -6
|
@@ -23,6 +23,14 @@ history:
|
|
|
23
23
|
|
|
24
24
|
# Translate your Analog (Angular) app using Intlayer | Internationalisation (i18n)
|
|
25
25
|
|
|
26
|
+
<iframe
|
|
27
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-analog-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
28
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
29
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
30
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
31
|
+
loading="lazy"
|
|
32
|
+
/>
|
|
33
|
+
|
|
26
34
|
## Table of Contents
|
|
27
35
|
|
|
28
36
|
<TOC/>
|
|
@@ -42,20 +50,6 @@ With Intlayer, you can:
|
|
|
42
50
|
|
|
43
51
|
## Step-by-Step Guide to Set Up Intlayer in an Analog Application
|
|
44
52
|
|
|
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
53
|
See [Application Template](https://github.com/aymericzip/intlayer-analog-template) on GitHub.
|
|
60
54
|
|
|
61
55
|
### Step 1: Install Dependencies
|
|
@@ -24,6 +24,14 @@ history:
|
|
|
24
24
|
|
|
25
25
|
# Translate your Vite and Lit website using Intlayer | Internationalisation (i18n)
|
|
26
26
|
|
|
27
|
+
<iframe
|
|
28
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-vite-lit-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
29
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
30
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
31
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
32
|
+
loading="lazy"
|
|
33
|
+
/>
|
|
34
|
+
|
|
27
35
|
## Table of Contents
|
|
28
36
|
|
|
29
37
|
<TOC/>
|
|
@@ -41,6 +49,8 @@ With Intlayer, you can:
|
|
|
41
49
|
|
|
42
50
|
---
|
|
43
51
|
|
|
52
|
+
See [Application Template](https://github.com/aymericzip/intlayer-vite-lit-template) on GitHub.
|
|
53
|
+
|
|
44
54
|
## Step-by-Step Guide to Set Up Intlayer in a Vite and Lit Application
|
|
45
55
|
|
|
46
56
|
### Step 1: Install Dependencies
|
|
@@ -643,63 +653,6 @@ const config: IntlayerConfig = {
|
|
|
643
653
|
export default config;
|
|
644
654
|
```
|
|
645
655
|
|
|
646
|
-
<Tabs>
|
|
647
|
-
<Tab value='Extract command'>
|
|
648
|
-
|
|
649
|
-
Run the extractor to transform your components and extract the content
|
|
650
|
-
|
|
651
|
-
```bash packageManager="npm"
|
|
652
|
-
npx intlayer extract
|
|
653
|
-
```
|
|
654
|
-
|
|
655
|
-
```bash packageManager="pnpm"
|
|
656
|
-
pnpm intlayer extract
|
|
657
|
-
```
|
|
658
|
-
|
|
659
|
-
```bash packageManager="yarn"
|
|
660
|
-
yarn intlayer extract
|
|
661
|
-
```
|
|
662
|
-
|
|
663
|
-
```bash packageManager="bun"
|
|
664
|
-
bunx intlayer extract
|
|
665
|
-
```
|
|
666
|
-
|
|
667
|
-
</Tab>
|
|
668
|
-
<Tab value='Babel compiler'>
|
|
669
|
-
|
|
670
|
-
Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
|
|
671
|
-
|
|
672
|
-
```ts fileName="vite.config.ts"
|
|
673
|
-
import { defineConfig } from "vite";
|
|
674
|
-
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
675
|
-
|
|
676
|
-
export default defineConfig({
|
|
677
|
-
plugins: [
|
|
678
|
-
intlayer(),
|
|
679
|
-
intlayerCompiler(), // Adds the compiler plugin
|
|
680
|
-
],
|
|
681
|
-
});
|
|
682
|
-
```
|
|
683
|
-
|
|
684
|
-
```bash packageManager="npm"
|
|
685
|
-
npm run build # Or npm run dev
|
|
686
|
-
```
|
|
687
|
-
|
|
688
|
-
```bash packageManager="pnpm"
|
|
689
|
-
pnpm run build # Or pnpm run dev
|
|
690
|
-
```
|
|
691
|
-
|
|
692
|
-
```bash packageManager="yarn"
|
|
693
|
-
yarn build # Or yarn dev
|
|
694
|
-
```
|
|
695
|
-
|
|
696
|
-
```bash packageManager="bun"
|
|
697
|
-
bun run build # Or bun run dev
|
|
698
|
-
```
|
|
699
|
-
|
|
700
|
-
</Tab>
|
|
701
|
-
</Tabs>
|
|
702
|
-
|
|
703
656
|
### Configure TypeScript
|
|
704
657
|
|
|
705
658
|
Ensure your TypeScript configuration includes the autogenerated types.
|
|
@@ -429,14 +429,14 @@ To utilise Intlayer's internationalisation features throughout your Vue applicat
|
|
|
429
429
|
|
|
430
430
|
```javascript fileName=main.js
|
|
431
431
|
import { createApp } from "vue";
|
|
432
|
-
import {
|
|
432
|
+
import { intlayer } from "vue-intlayer";
|
|
433
433
|
import App from "./App.vue";
|
|
434
434
|
import "./style.css";
|
|
435
435
|
|
|
436
436
|
const app = createApp(App);
|
|
437
437
|
|
|
438
438
|
// Inject the provider at the top level
|
|
439
|
-
|
|
439
|
+
app.use(intlayer);
|
|
440
440
|
|
|
441
441
|
// Mount the app
|
|
442
442
|
app.mount("#app");
|
|
@@ -1061,7 +1061,7 @@ import { installIntlayer, installIntlayerMarkdown } from "vue-intlayer";
|
|
|
1061
1061
|
|
|
1062
1062
|
const app = createApp(App);
|
|
1063
1063
|
|
|
1064
|
-
|
|
1064
|
+
app.use(intlayer);
|
|
1065
1065
|
|
|
1066
1066
|
const md = new MarkdownIt({
|
|
1067
1067
|
html: true, // allow HTML tags
|
package/docs/es/compiler.md
CHANGED
|
@@ -208,7 +208,10 @@ const config: IntlayerConfig = {
|
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* Indica si los componentes deben guardarse después de ser transformados.
|
|
211
|
-
*
|
|
211
|
+
*
|
|
212
|
+
* - Si es `true`, el compilador reescribirá el archivo del componente en el disco. Por lo tanto, la transformación será permanente y el compilador omitirá la transformación en el próximo proceso. De esta manera, el compilador puede transformar la aplicación y luego puede ser eliminado.
|
|
213
|
+
*
|
|
214
|
+
* - Si es `false`, el compilador inyectará la llamada a la función `useIntlayer()` en el código solo en la salida del build, y mantendrá intacta la base de código original. La transformación se realizará solo en memoria.
|
|
212
215
|
*/
|
|
213
216
|
saveComponents: false,
|
|
214
217
|
|
|
@@ -287,6 +290,8 @@ Las siguientes propiedades pueden configurarse en el bloque `compiler` de tu arc
|
|
|
287
290
|
- _Tipo_: `boolean`
|
|
288
291
|
- _Por defecto_: `false`
|
|
289
292
|
- _Descripción_: Indica si los componentes deben guardarse después de ser transformados.
|
|
293
|
+
- Si es `true`, el compilador reescribirá el archivo del componente en el disco. La transformación será permanente y el compilador podrá ser eliminado.
|
|
294
|
+
- Si es `false`, el compilador inyectará la llamada a la función `useIntlayer()` en el código solo en la salida del build, y mantendrá intacta la base de código original. La transformación se realizará solo en memoria.
|
|
290
295
|
|
|
291
296
|
### Rellenar traducciones faltantes
|
|
292
297
|
|
package/docs/es/configuration.md
CHANGED
|
@@ -518,7 +518,10 @@ const config: IntlayerConfig = {
|
|
|
518
518
|
|
|
519
519
|
/**
|
|
520
520
|
* Indica si los componentes deben guardarse después de ser transformados.
|
|
521
|
-
*
|
|
521
|
+
*
|
|
522
|
+
* - Si es `true`, el compilador reescribirá el archivo del componente en el disco. Por lo tanto, la transformación será permanente y el compilador omitirá la transformación en el próximo proceso. De esta manera, el compilador puede transformar la aplicación y luego puede ser eliminado.
|
|
523
|
+
*
|
|
524
|
+
* - Si es `false`, el compilador inyectará la llamada a la función `useIntlayer()` en el código solo en la salida del build, y mantendrá intacta la base de código original. La transformación se realizará solo en memoria.
|
|
522
525
|
*/
|
|
523
526
|
saveComponents: false,
|
|
524
527
|
|
|
@@ -932,14 +935,14 @@ Estos ajustes son para casos de uso avanzados y configuración interna de Intlay
|
|
|
932
935
|
|
|
933
936
|
Ajustes que controlan el compilador de Intlayer, que extrae diccionarios directamente de sus componentes.
|
|
934
937
|
|
|
935
|
-
| Campo | Descripción | Tipo | Predeterminado | Ejemplo | Nota
|
|
936
|
-
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
937
|
-
| `enabled` | Indica si el compilador debe habilitarse para extraer diccionarios. | `boolean` | <br/> `'build-only'` | `true` | `'build-only'` | `'build-only'` se salta el compilador durante el desarrollo para acelerar las compilaciones; solo se ejecuta en comandos de build.
|
|
938
|
-
| `dictionaryKeyPrefix` | Prefijo para las claves de diccionarios extraídas. | `string` | `''` | `'mi-prefijo-'` | Se añade a la clave generada (basada en el nombre del archivo) para evitar conflictos.
|
|
939
|
-
| `saveComponents` | Indica si los componentes deben guardarse después de
|
|
940
|
-
| `output` | Define la ruta de archivos de salida. Reemplaza `outputDir`. Soporta variables de plantilla: `{{fileName}}`, <br/> `{{key}}`, <br/> `{{locale}}`, <br/> `{{extension}}`, <br/> `{{componentFileName}}`, <br/> `{{componentExtension}}`, <br/> `{{format}}`, <br/> `{{componentFormat}}`, <br/> `{{componentDirPath}}`. | `boolean` | <br/> `FilePathPattern` | <br/> `Partial<Record<Locale, boolean | FilePathPattern>>` | `undefined` | `'./{{fileName}}{{extension}}'` <br/> `'/locales/{{locale}}/{{key}}.json'` <br/> `{ en: ({ key }) => './locales/en/${key}.json', fr: '...', es: false }` | • Las rutas `./` se resuelven respecto al directorio del componente.<br/>• Las rutas `/` respecto a la raíz.<br/>• `{{locale}}` dispara la generación separada por localidad.<br/>• Soporta notación de objeto por localidad.
|
|
941
|
-
| `noMetadata` | Si es `true`, el compilador omite los metadatos del diccionario (clave, envoltorio de contenido) de la salida. | `boolean` | `false` | `false` → `{"key":"mi-clave","content":{"key":"valor"}}` <br/> `true` → `{"key":"valor"}` | • Útil para salidas JSON i18next o ICU MessageFormat.<br/>• Funciona bien con el plugin `loadJSON`.
|
|
942
|
-
| `dictionaryKeyPrefix` | Prefijo de clave de diccionario | `string` | `''` | | Agregue un prefijo opcional para las llaves de los diccionarios extraídos
|
|
938
|
+
| Campo | Descripción | Tipo | Predeterminado | Ejemplo | Nota |
|
|
939
|
+
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
940
|
+
| `enabled` | Indica si el compilador debe habilitarse para extraer diccionarios. | `boolean` | <br/> `'build-only'` | `true` | `'build-only'` | `'build-only'` se salta el compilador durante el desarrollo para acelerar las compilaciones; solo se ejecuta en comandos de build. |
|
|
941
|
+
| `dictionaryKeyPrefix` | Prefijo para las claves de diccionarios extraídas. | `string` | `''` | `'mi-prefijo-'` | Se añade a la clave generada (basada en el nombre del archivo) para evitar conflictos. |
|
|
942
|
+
| `saveComponents` | Indica si los componentes deben guardarse después de ser transformados. | `boolean` | `false` | | • Si es `true`, el compilador reescribirá el archivo del componente en el disco. La transformación será permanente y el compilador podrá ser eliminado.<br/>• Si es `false`, el compilador inyectará la llamada a la función `useIntlayer()` en el código solo en la salida del build, y mantendrá intacta la base de código original. |
|
|
943
|
+
| `output` | Define la ruta de archivos de salida. Reemplaza `outputDir`. Soporta variables de plantilla: `{{fileName}}`, <br/> `{{key}}`, <br/> `{{locale}}`, <br/> `{{extension}}`, <br/> `{{componentFileName}}`, <br/> `{{componentExtension}}`, <br/> `{{format}}`, <br/> `{{componentFormat}}`, <br/> `{{componentDirPath}}`. | `boolean` | <br/> `FilePathPattern` | <br/> `Partial<Record<Locale, boolean | FilePathPattern>>` | `undefined` | `'./{{fileName}}{{extension}}'` <br/> `'/locales/{{locale}}/{{key}}.json'` <br/> `{ en: ({ key }) => './locales/en/${key}.json', fr: '...', es: false }` | • Las rutas `./` se resuelven respecto al directorio del componente.<br/>• Las rutas `/` respecto a la raíz.<br/>• `{{locale}}` dispara la generación separada por localidad.<br/>• Soporta notación de objeto por localidad. |
|
|
944
|
+
| `noMetadata` | Si es `true`, el compilador omite los metadatos del diccionario (clave, envoltorio de contenido) de la salida. | `boolean` | `false` | `false` → `{"key":"mi-clave","content":{"key":"valor"}}` <br/> `true` → `{"key":"valor"}` | • Útil para salidas JSON i18next o ICU MessageFormat.<br/>• Funciona bien con el plugin `loadJSON`. |
|
|
945
|
+
| `dictionaryKeyPrefix` | Prefijo de clave de diccionario | `string` | `''` | | Agregue un prefijo opcional para las llaves de los diccionarios extraídos |
|
|
943
946
|
|
|
944
947
|
---
|
|
945
948
|
|
|
@@ -19,6 +19,9 @@ slugs:
|
|
|
19
19
|
- content
|
|
20
20
|
- html
|
|
21
21
|
history:
|
|
22
|
+
- version: 8.5.0
|
|
23
|
+
date: 2026-03-24
|
|
24
|
+
changes: "Add `intlayerHTML` plugin object; use `app.use(intlayerHTML)` instead of `app.use(installIntlayerHTML)`"
|
|
22
25
|
- version: 8.5.0
|
|
23
26
|
date: 2026-03-24
|
|
24
27
|
changes: "mover la importación de {{framework}}-intlayer a {{framework}}-intlayer/html"
|
|
@@ -281,14 +284,14 @@ Puedes configurar el renderizado de HTML de forma global para toda tu aplicació
|
|
|
281
284
|
|
|
282
285
|
```typescript fileName="main.ts"
|
|
283
286
|
import { createApp, h } from "vue";
|
|
284
|
-
import {
|
|
285
|
-
import {
|
|
287
|
+
import { intlayer } from "vue-intlayer";
|
|
288
|
+
import { intlayerHTML } from "vue-intlayer/html";
|
|
286
289
|
import App from "./App.vue";
|
|
287
290
|
|
|
288
291
|
const app = createApp(App);
|
|
289
292
|
|
|
290
|
-
app.use(
|
|
291
|
-
app.use(
|
|
293
|
+
app.use(intlayer);
|
|
294
|
+
app.use(intlayerHTML, {
|
|
292
295
|
components: {
|
|
293
296
|
p: (props, { slots }) => h("p", { class: "prose", ...props }, slots.default?.()),
|
|
294
297
|
CustomLink: (props, { slots }) => h("a", { href: "/details", ...props }, slots.default?.()),
|
|
@@ -302,14 +305,14 @@ Puedes configurar el renderizado de HTML de forma global para toda tu aplicació
|
|
|
302
305
|
|
|
303
306
|
```typescript fileName="main.ts"
|
|
304
307
|
import { createApp, h } from "vue";
|
|
305
|
-
import {
|
|
306
|
-
import {
|
|
308
|
+
import { intlayer } from "vue-intlayer";
|
|
309
|
+
import { intlayerHTML } from "vue-intlayer/html";
|
|
307
310
|
import App from "./App.vue";
|
|
308
311
|
|
|
309
312
|
const app = createApp(App);
|
|
310
313
|
|
|
311
|
-
app.use(
|
|
312
|
-
app.use(
|
|
314
|
+
app.use(intlayer);
|
|
315
|
+
app.use(intlayerHTML, {
|
|
313
316
|
renderHTML: async (html) => {
|
|
314
317
|
const { renderHTML } = await import('vue-intlayer/html');
|
|
315
318
|
return renderHTML(html);
|
|
@@ -17,6 +17,9 @@ slugs:
|
|
|
17
17
|
- content
|
|
18
18
|
- markdown
|
|
19
19
|
history:
|
|
20
|
+
- version: 8.5.0
|
|
21
|
+
date: 2026-03-24
|
|
22
|
+
changes: "Add `intlayerMarkdown` plugin object; use `app.use(intlayerMarkdown)` instead of `app.use(installIntlayerMarkdown)`"
|
|
20
23
|
- version: 8.5.0
|
|
21
24
|
date: 2026-03-24
|
|
22
25
|
changes: "mover la importación de {{framework}}-intlayer a {{framework}}-intlayer/markdown"
|
|
@@ -35,7 +38,7 @@ history:
|
|
|
35
38
|
|
|
36
39
|
Intlayer admite contenido de texto enriquecido definido mediante la sintaxis Markdown. Esto le permite escribir y mantener fácilmente contenido con un formato enriquecido, como blogs, artículos y más.
|
|
37
40
|
|
|
38
|
-
##
|
|
41
|
+
## Declarar Contenido Markdown
|
|
39
42
|
|
|
40
43
|
Puede declarar contenido Markdown mediante la función `md` o simplemente como una cadena (si contiene sintaxis Markdown).
|
|
41
44
|
|
|
@@ -93,7 +96,7 @@ Puede declarar contenido Markdown mediante la función `md` o simplemente como u
|
|
|
93
96
|
|
|
94
97
|
---
|
|
95
98
|
|
|
96
|
-
##
|
|
99
|
+
## Renderizado de Markdown
|
|
97
100
|
|
|
98
101
|
El renderizado puede ser gestionado automáticamente por el sistema de contenido de Intlayer o manualmente mediante herramientas especializadas.
|
|
99
102
|
|
|
@@ -386,8 +389,6 @@ Puede configurar el renderizado de Markdown de forma global para toda su aplicac
|
|
|
386
389
|
|
|
387
390
|
export const AppProvider = ({ children }) => (
|
|
388
391
|
<MarkdownProvider
|
|
389
|
-
forceBlock={true}
|
|
390
|
-
tagfilter={true}
|
|
391
392
|
components={{
|
|
392
393
|
h1: ({ children }) => <h1 className="text-2xl font-bold">{children}</h1>,
|
|
393
394
|
a: ({ href, children }) => <Link to={href}>{children}</Link>,
|
|
@@ -422,21 +423,20 @@ Puede configurar el renderizado de Markdown de forma global para toda su aplicac
|
|
|
422
423
|
|
|
423
424
|
```typescript fileName="main.ts"
|
|
424
425
|
import { createApp } from "vue";
|
|
425
|
-
import {
|
|
426
|
-
import {
|
|
426
|
+
import { intlayer } from "vue-intlayer";
|
|
427
|
+
import { intlayerMarkdown } from "vue-intlayer/markdown";
|
|
427
428
|
import App from "./App.vue";
|
|
428
429
|
|
|
429
430
|
const app = createApp(App);
|
|
430
431
|
|
|
431
|
-
app.use(
|
|
432
|
-
app.use(
|
|
433
|
-
forceBlock: true,
|
|
434
|
-
tagfilter: true,
|
|
432
|
+
app.use(intlayer);
|
|
433
|
+
app.use(intlayerMarkdown, {
|
|
435
434
|
components: {
|
|
436
|
-
h1:
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
435
|
+
h1: (props) =>
|
|
436
|
+
h('h1', { style: { color: 'orange' }, ...props }, props.children),
|
|
437
|
+
ComponentDemo: () => h('div', { style: { background: 'grey' } }, 'DEMO'),
|
|
438
|
+
bold: (props) => h('strong', props),
|
|
439
|
+
code: (props) => h('code', props),
|
|
440
440
|
},
|
|
441
441
|
});
|
|
442
442
|
|
|
@@ -447,14 +447,14 @@ Puede configurar el renderizado de Markdown de forma global para toda su aplicac
|
|
|
447
447
|
|
|
448
448
|
```typescript fileName="main.ts"
|
|
449
449
|
import { createApp } from "vue";
|
|
450
|
-
import {
|
|
451
|
-
import {
|
|
450
|
+
import { intlayer } from "vue-intlayer";
|
|
451
|
+
import { intlayerMarkdown } from "vue-intlayer/markdown";
|
|
452
452
|
import App from "./App.vue";
|
|
453
453
|
|
|
454
454
|
const app = createApp(App);
|
|
455
455
|
|
|
456
|
-
app.use(
|
|
457
|
-
app.use(
|
|
456
|
+
app.use(intlayer);
|
|
457
|
+
app.use(intlayerMarkdown, {
|
|
458
458
|
renderMarkdown: async (md) => {
|
|
459
459
|
const { compileMarkdown } = await import('vue-intlayer/markdown');
|
|
460
460
|
return compileMarkdown(md);
|
|
@@ -476,8 +476,6 @@ Puede configurar el renderizado de Markdown de forma global para toda su aplicac
|
|
|
476
476
|
</script>
|
|
477
477
|
|
|
478
478
|
<MarkdownProvider
|
|
479
|
-
forceBlock={true}
|
|
480
|
-
tagfilter={true}
|
|
481
479
|
components={{
|
|
482
480
|
h1: MyHeading,
|
|
483
481
|
}}
|
|
@@ -513,8 +511,6 @@ Puede configurar el renderizado de Markdown de forma global para toda su aplicac
|
|
|
513
511
|
|
|
514
512
|
export const AppProvider = ({ children }) => (
|
|
515
513
|
<MarkdownProvider
|
|
516
|
-
forceBlock={true}
|
|
517
|
-
tagfilter={true}
|
|
518
514
|
components={{
|
|
519
515
|
h1: ({ children }) => <h1 className="text-2xl font-bold">{children}</h1>,
|
|
520
516
|
}}
|
|
@@ -551,8 +547,6 @@ Puede configurar el renderizado de Markdown de forma global para toda su aplicac
|
|
|
551
547
|
|
|
552
548
|
export const AppProvider = (props) => (
|
|
553
549
|
<MarkdownProvider
|
|
554
|
-
forceBlock={true}
|
|
555
|
-
tagfilter={true}
|
|
556
550
|
components={{
|
|
557
551
|
h1: (props) => <h1 className="text-2xl font-bold">{props.children}</h1>,
|
|
558
552
|
}}
|
|
@@ -23,6 +23,14 @@ history:
|
|
|
23
23
|
|
|
24
24
|
# Traduce tu aplicación Analog (Angular) con Intlayer | Internacionalización (i18n)
|
|
25
25
|
|
|
26
|
+
<iframe
|
|
27
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-analog-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
28
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
29
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
30
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
31
|
+
loading="lazy"
|
|
32
|
+
/>
|
|
33
|
+
|
|
26
34
|
## Tabla de contenidos
|
|
27
35
|
|
|
28
36
|
<TOC/>
|
|
@@ -42,20 +50,6 @@ Con Intlayer, puedes:
|
|
|
42
50
|
|
|
43
51
|
## Guía paso a paso para configurar Intlayer en una aplicación Analog
|
|
44
52
|
|
|
45
|
-
<Tabs defaultTab="code">
|
|
46
|
-
<Tab label="Código" 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 - Cómo internacionalizar tu aplicación usando 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
53
|
Ver [Plantilla de Aplicación](https://github.com/aymericzip/intlayer-analog-template) en GitHub.
|
|
60
54
|
|
|
61
55
|
### Paso 1: Instalar dependencias
|
|
@@ -24,6 +24,14 @@ history:
|
|
|
24
24
|
|
|
25
25
|
# Traduce tu sitio web Vite y Lit usando Intlayer | Internacionalización (i18n)
|
|
26
26
|
|
|
27
|
+
<iframe
|
|
28
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-vite-lit-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
29
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
30
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
31
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
32
|
+
loading="lazy"
|
|
33
|
+
/>
|
|
34
|
+
|
|
27
35
|
## Tabla de Contenidos
|
|
28
36
|
|
|
29
37
|
<TOC/>
|
|
@@ -640,63 +648,6 @@ const config: IntlayerConfig = {
|
|
|
640
648
|
export default config;
|
|
641
649
|
```
|
|
642
650
|
|
|
643
|
-
<Tabs>
|
|
644
|
-
<Tab value='Comando Extract'>
|
|
645
|
-
|
|
646
|
-
Ejecuta el extractor para transformar tus componentes y extraer el contenido
|
|
647
|
-
|
|
648
|
-
```bash packageManager="npm"
|
|
649
|
-
npx intlayer extract
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
```bash packageManager="pnpm"
|
|
653
|
-
pnpm intlayer extract
|
|
654
|
-
```
|
|
655
|
-
|
|
656
|
-
```bash packageManager="yarn"
|
|
657
|
-
yarn intlayer extract
|
|
658
|
-
```
|
|
659
|
-
|
|
660
|
-
```bash packageManager="bun"
|
|
661
|
-
bunx intlayer extract
|
|
662
|
-
```
|
|
663
|
-
|
|
664
|
-
</Tab>
|
|
665
|
-
<Tab value='Compilador Babel'>
|
|
666
|
-
|
|
667
|
-
Actualiza tu `vite.config.ts` para incluir el complemento `intlayerCompiler`:
|
|
668
|
-
|
|
669
|
-
```ts fileName="vite.config.ts"
|
|
670
|
-
import { defineConfig } from "vite";
|
|
671
|
-
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
672
|
-
|
|
673
|
-
export default defineConfig({
|
|
674
|
-
plugins: [
|
|
675
|
-
intlayer(),
|
|
676
|
-
intlayerCompiler(), // Agrega el complemento del compilador
|
|
677
|
-
],
|
|
678
|
-
});
|
|
679
|
-
```
|
|
680
|
-
|
|
681
|
-
```bash packageManager="npm"
|
|
682
|
-
npm run build # O npm run dev
|
|
683
|
-
```
|
|
684
|
-
|
|
685
|
-
```bash packageManager="pnpm"
|
|
686
|
-
pnpm run build # O pnpm run dev
|
|
687
|
-
```
|
|
688
|
-
|
|
689
|
-
```bash packageManager="yarn"
|
|
690
|
-
yarn build # O yarn dev
|
|
691
|
-
```
|
|
692
|
-
|
|
693
|
-
```bash packageManager="bun"
|
|
694
|
-
bun run build # O bun run dev
|
|
695
|
-
```
|
|
696
|
-
|
|
697
|
-
</Tab>
|
|
698
|
-
</Tabs>
|
|
699
|
-
|
|
700
651
|
### Configurar TypeScript
|
|
701
652
|
|
|
702
653
|
Asegúrate de que tu configuración de TypeScript incluya los tipos autogenerados.
|
|
@@ -452,14 +452,14 @@ Para utilizar las funciones de internacionalización de Intlayer en toda tu apli
|
|
|
452
452
|
|
|
453
453
|
```javascript fileName=main.js
|
|
454
454
|
import { createApp } from "vue";
|
|
455
|
-
import {
|
|
455
|
+
import { intlayer } from "vue-intlayer";
|
|
456
456
|
import App from "./App.vue";
|
|
457
457
|
import "./style.css";
|
|
458
458
|
|
|
459
459
|
const app = createApp(App);
|
|
460
460
|
|
|
461
461
|
// Inyectar el proveedor en el nivel superior
|
|
462
|
-
|
|
462
|
+
app.use(intlayer);
|
|
463
463
|
|
|
464
464
|
// Montar la aplicación
|
|
465
465
|
app.mount("#app");
|
|
@@ -1048,7 +1048,7 @@ import { installIntlayer, installIntlayerMarkdown } from "vue-intlayer";
|
|
|
1048
1048
|
|
|
1049
1049
|
const app = createApp(App);
|
|
1050
1050
|
|
|
1051
|
-
|
|
1051
|
+
app.use(intlayer);
|
|
1052
1052
|
|
|
1053
1053
|
const md = new MarkdownIt({
|
|
1054
1054
|
html: true, // permitir etiquetas HTML
|
package/docs/fr/compiler.md
CHANGED
|
@@ -207,8 +207,11 @@ const config: IntlayerConfig = {
|
|
|
207
207
|
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
|
-
* Indique si les composants doivent être
|
|
211
|
-
*
|
|
210
|
+
* Indique si les composants doivent être enregistrés après avoir été transformés.
|
|
211
|
+
*
|
|
212
|
+
* - Si `true`, le compilateur réécrira le fichier du composant sur le disque. Ainsi, la transformation sera permanente et le compilateur sautera la transformation pour le prochain processus. De cette façon, le compilateur peut transformer l'application, puis être supprimé.
|
|
213
|
+
*
|
|
214
|
+
* - Si `false`, le compilateur injectera l'appel de fonction `useIntlayer()` dans le code du build uniquement et gardera la base de code intacte. La transformation sera effectuée uniquement en mémoire.
|
|
212
215
|
*/
|
|
213
216
|
saveComponents: false,
|
|
214
217
|
|
|
@@ -286,7 +289,9 @@ Les propriétés suivantes peuvent être configurées dans le bloc `compiler` de
|
|
|
286
289
|
- **saveComponents**:
|
|
287
290
|
- _Type_: `boolean`
|
|
288
291
|
- _Par défaut_: `false`
|
|
289
|
-
- _Description_: Indique si les composants doivent être
|
|
292
|
+
- _Description_: Indique si les composants doivent être enregistrés après avoir été transformés.
|
|
293
|
+
- Si `true`, le compilateur réécrira le fichier du composant sur le disque. La transformation sera permanente et le compilateur pourra ensuite être supprimé.
|
|
294
|
+
- Si `false`, le compilateur injectera l'appel de fonction `useIntlayer()` dans le code du build uniquement et gardera la base de code intacte. La transformation sera effectuée uniquement en mémoire.
|
|
290
295
|
|
|
291
296
|
### Remplir les traductions manquantes
|
|
292
297
|
|
package/docs/fr/configuration.md
CHANGED
|
@@ -518,7 +518,10 @@ const config: IntlayerConfig = {
|
|
|
518
518
|
|
|
519
519
|
/**
|
|
520
520
|
* Indique si les composants doivent être enregistrés après avoir été transformés.
|
|
521
|
-
*
|
|
521
|
+
*
|
|
522
|
+
* - Si `true`, le compilateur réécrira le fichier du composant sur le disque. Ainsi, la transformation sera permanente et le compilateur sautera la transformation pour le prochain processus. De cette façon, le compilateur peut transformer l'application, puis être supprimé.
|
|
523
|
+
*
|
|
524
|
+
* - Si `false`, le compilateur injectera l'appel de fonction `useIntlayer()` dans le code du build uniquement et gardera la base de code intacte. La transformation sera effectuée uniquement en mémoire.
|
|
522
525
|
*/
|
|
523
526
|
saveComponents: false,
|
|
524
527
|
|
|
@@ -932,14 +935,14 @@ Ces paramètres sont destinés aux cas d'utilisation avancés et à la configura
|
|
|
932
935
|
|
|
933
936
|
Paramètres qui contrôlent le compilateur Intlayer, qui extrait les dictionnaires directement de vos composants.
|
|
934
937
|
|
|
935
|
-
| Champ | Description | Type | Par défaut | Exemple | Note
|
|
936
|
-
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
937
|
-
| `enabled` | Indique si le compilateur doit être activé pour extraire les dictionnaires. | `boolean` | <br/> `'build-only'` | `true` | `'build-only'` | `'build-only'` ignore le compilateur pendant le développement pour accélérer les builds ; ne s'exécute que lors des commandes de build.
|
|
938
|
-
| `dictionaryKeyPrefix` | Préfixe pour les clés de dictionnaire extraites. | `string` | `''` | `'ma-clé-'` | Ajouté à la clé générée (basée sur le nom du fichier) pour éviter les conflits.
|
|
939
|
-
| `saveComponents` | Indique si les composants doivent être
|
|
940
|
-
| `output` | Définit le chemin des fichiers de sortie. Remplace `outputDir`. Supporte les variables de modèle : `{{fileName}}`, <br/> `{{key}}`, <br/> `{{locale}}`, <br/> `{{extension}}`, <br/> `{{componentFileName}}`, <br/> `{{componentExtension}}`, <br/> `{{format}}`, <br/> `{{componentFormat}}`, <br/> `{{componentDirPath}}`. | `boolean` | <br/> `FilePathPattern` | <br/> `Partial<Record<Locale, boolean | FilePathPattern>>` | `undefined` | `'./{{fileName}}{{extension}}'` <br/> `'/locales/{{locale}}/{{key}}.json'` <br/> `{ en: ({ key }) => './locales/en/${key}.json', fr: '...', es: false }` | • Les chemins `./` sont résolus par rapport au répertoire du composant.<br/>• Les chemins `/` par rapport à la racine.<br/>• `{{locale}}` déclenche la génération séparée par locale.<br/>• Supporte la notation objet par locale.
|
|
941
|
-
| `noMetadata` | Si `true`, le compilateur omet les métadonnées du dictionnaire (clé, wrapper de contenu) de la sortie. | `boolean` | `false` | `false` → `{"key":"ma-clé","content":{"key":"valeur"}}` <br/> `true` → `{"key":"valeur"}` | • Utile pour les sorties JSON i18next ou ICU MessageFormat.<br/>• Fonctionne bien avec le plugin `loadJSON`.
|
|
942
|
-
| `dictionaryKeyPrefix` | Préfixe de clé de dictionnaire | `string` | `''` | | Ajoute un préfixe optionnel aux clés de dictionnaire extraites
|
|
938
|
+
| Champ | Description | Type | Par défaut | Exemple | Note |
|
|
939
|
+
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
940
|
+
| `enabled` | Indique si le compilateur doit être activé pour extraire les dictionnaires. | `boolean` | <br/> `'build-only'` | `true` | `'build-only'` | `'build-only'` ignore le compilateur pendant le développement pour accélérer les builds ; ne s'exécute que lors des commandes de build. |
|
|
941
|
+
| `dictionaryKeyPrefix` | Préfixe pour les clés de dictionnaire extraites. | `string` | `''` | `'ma-clé-'` | Ajouté à la clé générée (basée sur le nom du fichier) pour éviter les conflits. |
|
|
942
|
+
| `saveComponents` | Indique si les composants doivent être enregistrés après avoir été transformés. | `boolean` | `false` | | • Si `true`, le compilateur réécrira le fichier du composant sur le disque. La transformation sera permanente et le compilateur pourra ensuite être supprimé.<br/>• Si `false`, le compilateur injectera l'appel de fonction `useIntlayer()` dans le code du build uniquement et gardera la base de code intacte. |
|
|
943
|
+
| `output` | Définit le chemin des fichiers de sortie. Remplace `outputDir`. Supporte les variables de modèle : `{{fileName}}`, <br/> `{{key}}`, <br/> `{{locale}}`, <br/> `{{extension}}`, <br/> `{{componentFileName}}`, <br/> `{{componentExtension}}`, <br/> `{{format}}`, <br/> `{{componentFormat}}`, <br/> `{{componentDirPath}}`. | `boolean` | <br/> `FilePathPattern` | <br/> `Partial<Record<Locale, boolean | FilePathPattern>>` | `undefined` | `'./{{fileName}}{{extension}}'` <br/> `'/locales/{{locale}}/{{key}}.json'` <br/> `{ en: ({ key }) => './locales/en/${key}.json', fr: '...', es: false }` | • Les chemins `./` sont résolus par rapport au répertoire du composant.<br/>• Les chemins `/` par rapport à la racine.<br/>• `{{locale}}` déclenche la génération séparée par locale.<br/>• Supporte la notation objet par locale. |
|
|
944
|
+
| `noMetadata` | Si `true`, le compilateur omet les métadonnées du dictionnaire (clé, wrapper de contenu) de la sortie. | `boolean` | `false` | `false` → `{"key":"ma-clé","content":{"key":"valeur"}}` <br/> `true` → `{"key":"valeur"}` | • Utile pour les sorties JSON i18next ou ICU MessageFormat.<br/>• Fonctionne bien avec le plugin `loadJSON`. |
|
|
945
|
+
| `dictionaryKeyPrefix` | Préfixe de clé de dictionnaire | `string` | `''` | | Ajoute un préfixe optionnel aux clés de dictionnaire extraites |
|
|
943
946
|
|
|
944
947
|
---
|
|
945
948
|
|