@intlayer/docs 8.3.0-canary.4 → 8.3.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/compiler.md +84 -49
- package/docs/ar/configuration.md +80 -37
- package/docs/ar/intlayer_with_nextjs_16.md +174 -1
- package/docs/ar/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ar/intlayer_with_react_router_v7.md +224 -1
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/ar/intlayer_with_svelte_kit.md +175 -2
- package/docs/ar/intlayer_with_tanstack.md +176 -1
- package/docs/ar/intlayer_with_vite+preact.md +174 -1
- package/docs/ar/intlayer_with_vite+react.md +174 -1
- package/docs/ar/intlayer_with_vite+solid.md +174 -1
- package/docs/ar/intlayer_with_vite+svelte.md +174 -1
- package/docs/ar/intlayer_with_vite+vue.md +174 -1
- package/docs/de/compiler.md +83 -48
- package/docs/de/configuration.md +434 -212
- package/docs/de/intlayer_with_nextjs_16.md +176 -1
- package/docs/de/intlayer_with_nextjs_compiler.md +106 -349
- package/docs/de/intlayer_with_react_router_v7.md +225 -2
- package/docs/de/intlayer_with_react_router_v7_fs_routes.md +221 -79
- package/docs/de/intlayer_with_svelte_kit.md +158 -2
- package/docs/de/intlayer_with_tanstack.md +159 -1
- package/docs/de/intlayer_with_vite+preact.md +157 -1
- package/docs/de/intlayer_with_vite+react.md +157 -1
- package/docs/de/intlayer_with_vite+solid.md +159 -3
- package/docs/de/intlayer_with_vite+svelte.md +157 -1
- package/docs/de/intlayer_with_vite+vue.md +157 -1
- package/docs/en/compiler.md +60 -33
- package/docs/en/configuration.md +80 -57
- package/docs/en/intlayer_with_nextjs_16.md +176 -0
- package/docs/en/intlayer_with_nextjs_compiler.md +179 -1
- package/docs/en/intlayer_with_react_router_v7.md +159 -0
- package/docs/en/intlayer_with_react_router_v7_fs_routes.md +159 -0
- package/docs/en/intlayer_with_svelte_kit.md +159 -0
- package/docs/en/intlayer_with_tanstack.md +160 -1
- package/docs/en/intlayer_with_vite+preact.md +159 -0
- package/docs/en/intlayer_with_vite+react.md +159 -0
- package/docs/en/intlayer_with_vite+solid.md +148 -27
- package/docs/en/intlayer_with_vite+svelte.md +159 -0
- package/docs/en/intlayer_with_vite+vue.md +142 -41
- package/docs/en-GB/compiler.md +66 -34
- package/docs/en-GB/configuration.md +78 -36
- package/docs/es/compiler.md +83 -48
- package/docs/es/configuration.md +429 -206
- package/docs/es/intlayer_with_adonisjs.md +1 -1
- package/docs/es/intlayer_with_express.md +1 -1
- package/docs/es/intlayer_with_fastify.md +1 -1
- package/docs/es/intlayer_with_hono.md +1 -1
- package/docs/es/intlayer_with_nestjs.md +1 -1
- package/docs/es/intlayer_with_nextjs_16.md +176 -3
- package/docs/es/intlayer_with_nextjs_compiler.md +175 -2
- package/docs/es/intlayer_with_nuxt.md +1 -1
- package/docs/es/intlayer_with_react_router_v7.md +227 -4
- package/docs/es/intlayer_with_react_router_v7_fs_routes.md +162 -4
- package/docs/es/intlayer_with_svelte_kit.md +158 -2
- package/docs/es/intlayer_with_tanstack.md +160 -2
- package/docs/es/intlayer_with_vite+preact.md +162 -6
- package/docs/es/intlayer_with_vite+react.md +160 -4
- package/docs/es/intlayer_with_vite+solid.md +163 -7
- package/docs/es/intlayer_with_vite+svelte.md +157 -1
- package/docs/es/intlayer_with_vite+vue.md +165 -9
- package/docs/fr/compiler.md +81 -46
- package/docs/fr/configuration.md +355 -134
- package/docs/fr/intlayer_with_adonisjs.md +1 -1
- package/docs/fr/intlayer_with_express.md +1 -1
- package/docs/fr/intlayer_with_fastify.md +1 -1
- package/docs/fr/intlayer_with_hono.md +1 -1
- package/docs/fr/intlayer_with_nestjs.md +1 -1
- package/docs/fr/intlayer_with_nextjs_16.md +183 -7
- package/docs/fr/intlayer_with_nextjs_compiler.md +179 -3
- package/docs/fr/intlayer_with_react_router_v7.md +229 -3
- package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +237 -6
- package/docs/fr/intlayer_with_svelte_kit.md +158 -2
- package/docs/fr/intlayer_with_tanstack.md +159 -1
- package/docs/fr/intlayer_with_vite+preact.md +164 -8
- package/docs/fr/intlayer_with_vite+react.md +162 -6
- package/docs/fr/intlayer_with_vite+solid.md +163 -7
- package/docs/fr/intlayer_with_vite+svelte.md +157 -1
- package/docs/fr/intlayer_with_vite+vue.md +164 -8
- package/docs/hi/compiler.md +81 -46
- package/docs/hi/configuration.md +87 -44
- package/docs/hi/intlayer_with_nextjs_16.md +174 -1
- package/docs/hi/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/hi/intlayer_with_react_router_v7.md +224 -1
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/hi/intlayer_with_svelte_kit.md +158 -2
- package/docs/hi/intlayer_with_tanstack.md +159 -1
- package/docs/hi/intlayer_with_vite+preact.md +157 -1
- package/docs/hi/intlayer_with_vite+react.md +157 -1
- package/docs/hi/intlayer_with_vite+solid.md +157 -1
- package/docs/hi/intlayer_with_vite+svelte.md +157 -1
- package/docs/hi/intlayer_with_vite+vue.md +157 -1
- package/docs/id/compiler.md +84 -51
- package/docs/id/configuration.md +83 -45
- package/docs/id/intlayer_with_nextjs_16.md +174 -1
- package/docs/id/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/id/intlayer_with_react_router_v7.md +224 -1
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/id/intlayer_with_svelte_kit.md +158 -2
- package/docs/id/intlayer_with_tanstack.md +159 -1
- package/docs/id/intlayer_with_vite+preact.md +157 -1
- package/docs/id/intlayer_with_vite+react.md +157 -1
- package/docs/id/intlayer_with_vite+solid.md +157 -1
- package/docs/id/intlayer_with_vite+svelte.md +157 -1
- package/docs/id/intlayer_with_vite+vue.md +157 -1
- package/docs/it/compiler.md +81 -46
- package/docs/it/configuration.md +426 -204
- package/docs/it/intlayer_with_nextjs_16.md +174 -1
- package/docs/it/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/it/intlayer_with_react_router_v7.md +225 -2
- package/docs/it/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/it/intlayer_with_svelte_kit.md +158 -2
- package/docs/it/intlayer_with_tanstack.md +159 -1
- package/docs/it/intlayer_with_vite+preact.md +157 -1
- package/docs/it/intlayer_with_vite+react.md +157 -1
- package/docs/it/intlayer_with_vite+solid.md +159 -3
- package/docs/it/intlayer_with_vite+svelte.md +157 -1
- package/docs/it/intlayer_with_vite+vue.md +157 -1
- package/docs/ja/compiler.md +94 -58
- package/docs/ja/configuration.md +88 -45
- package/docs/ja/intlayer_with_nextjs_16.md +174 -1
- package/docs/ja/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ja/intlayer_with_react_router_v7.md +184 -394
- package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/ja/intlayer_with_svelte_kit.md +119 -595
- package/docs/ja/intlayer_with_tanstack.md +131 -642
- package/docs/ja/intlayer_with_vite+preact.md +111 -1231
- package/docs/ja/intlayer_with_vite+react.md +129 -1304
- package/docs/ja/intlayer_with_vite+solid.md +159 -3
- package/docs/ja/intlayer_with_vite+svelte.md +157 -1
- package/docs/ja/intlayer_with_vite+vue.md +157 -1
- package/docs/ko/compiler.md +88 -52
- package/docs/ko/configuration.md +87 -44
- package/docs/ko/intlayer_with_nextjs_16.md +174 -1
- package/docs/ko/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ko/intlayer_with_react_router_v7.md +225 -2
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/ko/intlayer_with_svelte_kit.md +158 -2
- package/docs/ko/intlayer_with_tanstack.md +159 -1
- package/docs/ko/intlayer_with_vite+preact.md +157 -1
- package/docs/ko/intlayer_with_vite+react.md +157 -1
- package/docs/ko/intlayer_with_vite+solid.md +159 -3
- package/docs/ko/intlayer_with_vite+svelte.md +157 -1
- package/docs/ko/intlayer_with_vite+vue.md +157 -1
- package/docs/pl/compiler.md +84 -51
- package/docs/pl/configuration.md +83 -37
- package/docs/pl/intlayer_with_nextjs_16.md +174 -1
- package/docs/pl/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/pl/intlayer_with_react_router_v7.md +224 -1
- package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/pl/intlayer_with_svelte_kit.md +158 -2
- package/docs/pl/intlayer_with_tanstack.md +159 -1
- package/docs/pl/intlayer_with_vite+preact.md +157 -1
- package/docs/pl/intlayer_with_vite+react.md +157 -1
- package/docs/pl/intlayer_with_vite+solid.md +157 -1
- package/docs/pl/intlayer_with_vite+svelte.md +157 -1
- package/docs/pl/intlayer_with_vite+vue.md +157 -1
- package/docs/pt/compiler.md +81 -46
- package/docs/pt/configuration.md +404 -194
- package/docs/pt/intlayer_with_nextjs_16.md +174 -1
- package/docs/pt/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/pt/intlayer_with_react_router_v7.md +224 -1
- package/docs/pt/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/pt/intlayer_with_svelte_kit.md +158 -2
- package/docs/pt/intlayer_with_tanstack.md +159 -1
- package/docs/pt/intlayer_with_vite+preact.md +157 -1
- package/docs/pt/intlayer_with_vite+react.md +157 -1
- package/docs/pt/intlayer_with_vite+solid.md +157 -1
- package/docs/pt/intlayer_with_vite+svelte.md +157 -1
- package/docs/pt/intlayer_with_vite+vue.md +157 -1
- package/docs/ru/compiler.md +90 -57
- package/docs/ru/configuration.md +76 -46
- package/docs/ru/intlayer_with_nextjs_16.md +174 -1
- package/docs/ru/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ru/intlayer_with_react_router_v7.md +224 -1
- package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/ru/intlayer_with_svelte_kit.md +158 -2
- package/docs/ru/intlayer_with_tanstack.md +159 -1
- package/docs/ru/intlayer_with_vite+preact.md +157 -1
- package/docs/ru/intlayer_with_vite+react.md +157 -1
- package/docs/ru/intlayer_with_vite+solid.md +157 -1
- package/docs/ru/intlayer_with_vite+svelte.md +157 -1
- package/docs/ru/intlayer_with_vite+vue.md +157 -1
- package/docs/tr/compiler.md +85 -52
- package/docs/tr/configuration.md +83 -40
- package/docs/tr/intlayer_with_nextjs_16.md +174 -1
- package/docs/tr/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/tr/intlayer_with_react_router_v7.md +224 -1
- package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/tr/intlayer_with_svelte_kit.md +158 -2
- package/docs/tr/intlayer_with_tanstack.md +159 -1
- package/docs/tr/intlayer_with_vite+preact.md +157 -1
- package/docs/tr/intlayer_with_vite+react.md +157 -1
- package/docs/tr/intlayer_with_vite+solid.md +157 -1
- package/docs/tr/intlayer_with_vite+svelte.md +157 -1
- package/docs/tr/intlayer_with_vite+vue.md +157 -1
- package/docs/uk/compiler.md +96 -61
- package/docs/uk/configuration.md +83 -37
- package/docs/uk/intlayer_with_nextjs_16.md +174 -1
- package/docs/uk/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/uk/intlayer_with_react_router_v7.md +224 -1
- package/docs/uk/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/uk/intlayer_with_svelte_kit.md +157 -1
- package/docs/uk/intlayer_with_tanstack.md +159 -1
- package/docs/uk/intlayer_with_vite+preact.md +157 -1
- package/docs/uk/intlayer_with_vite+react.md +157 -1
- package/docs/uk/intlayer_with_vite+solid.md +157 -1
- package/docs/uk/intlayer_with_vite+svelte.md +157 -1
- package/docs/uk/intlayer_with_vite+vue.md +157 -1
- package/docs/vi/compiler.md +85 -50
- package/docs/vi/configuration.md +85 -39
- package/docs/vi/intlayer_with_nextjs_16.md +174 -1
- package/docs/vi/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/vi/intlayer_with_react_router_v7.md +224 -1
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/vi/intlayer_with_svelte_kit.md +158 -2
- package/docs/vi/intlayer_with_tanstack.md +159 -1
- package/docs/vi/intlayer_with_vite+preact.md +157 -1
- package/docs/vi/intlayer_with_vite+react.md +157 -1
- package/docs/vi/intlayer_with_vite+solid.md +157 -1
- package/docs/vi/intlayer_with_vite+svelte.md +157 -1
- package/docs/vi/intlayer_with_vite+vue.md +157 -1
- package/docs/zh/compiler.md +84 -49
- package/docs/zh/configuration.md +80 -37
- package/docs/zh/intlayer_with_adonisjs.md +1 -1
- package/docs/zh/intlayer_with_express.md +1 -1
- package/docs/zh/intlayer_with_fastify.md +1 -1
- package/docs/zh/intlayer_with_hono.md +1 -1
- package/docs/zh/intlayer_with_nestjs.md +1 -1
- package/docs/zh/intlayer_with_nextjs_16.md +174 -1
- package/docs/zh/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/zh/intlayer_with_react_router_v7.md +227 -4
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +228 -4
- package/docs/zh/intlayer_with_svelte_kit.md +158 -2
- package/docs/zh/intlayer_with_tanstack.md +159 -1
- package/docs/zh/intlayer_with_vite+preact.md +159 -3
- package/docs/zh/intlayer_with_vite+react.md +157 -1
- package/docs/zh/intlayer_with_vite+solid.md +161 -5
- package/docs/zh/intlayer_with_vite+svelte.md +157 -1
- package/docs/zh/intlayer_with_vite+vue.md +158 -2
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-09-04
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: React Router v7 i18n - Cara menerjemahkan aplikasi React Router v7 di 2026
|
|
5
5
|
description: Pelajari cara menambahkan internasionalisasi (i18n) ke aplikasi React Router v7 Anda menggunakan Intlayer. Ikuti panduan komprehensif ini untuk membuat aplikasi Anda multibahasa dengan routing yang mendukung locale.
|
|
6
6
|
keywords:
|
|
@@ -512,6 +512,229 @@ export default function RootLayout() {
|
|
|
512
512
|
}
|
|
513
513
|
```
|
|
514
514
|
|
|
515
|
+
### (Opsional) Langkah 1 : Ekstrak konten komponen Anda
|
|
516
|
+
|
|
517
|
+
Jika Anda memiliki basis kode yang ada, mengubah ribuan file bisa memakan waktu lama.
|
|
518
|
+
|
|
519
|
+
Untuk memudahkan proses ini, Intlayer mengusulkan [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/cli/extract.md) untuk mengubah komponen Anda dan mengekstrak kontennya.
|
|
520
|
+
|
|
521
|
+
Untuk mengaturnya, Anda dapat menambahkan bagian `compiler` di file `intlayer.config.ts` Anda:
|
|
522
|
+
|
|
523
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
524
|
+
import { type IntlayerConfig } from "intlayer";
|
|
525
|
+
|
|
526
|
+
const config: IntlayerConfig = {
|
|
527
|
+
// ... Sisa konfigurasi Anda
|
|
528
|
+
compiler: {
|
|
529
|
+
/**
|
|
530
|
+
* Menunjukkan apakah compiler harus diaktifkan.
|
|
531
|
+
*/
|
|
532
|
+
enabled: true,
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Menentukan jalur file output
|
|
536
|
+
*/
|
|
537
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
|
|
541
|
+
*/
|
|
542
|
+
saveComponents: false,
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Prefiks kunci kamus
|
|
546
|
+
*/
|
|
547
|
+
dictionaryKeyPrefix: "",
|
|
548
|
+
},
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
export default config;
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
555
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
556
|
+
const config = {
|
|
557
|
+
// ... Sisa konfigurasi Anda
|
|
558
|
+
compiler: {
|
|
559
|
+
/**
|
|
560
|
+
* Menunjukkan apakah compiler harus diaktifkan.
|
|
561
|
+
*/
|
|
562
|
+
enabled: true,
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Menentukan jalur file output
|
|
566
|
+
*/
|
|
567
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
|
|
571
|
+
*/
|
|
572
|
+
saveComponents: false,
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Prefiks kunci kamus
|
|
576
|
+
*/
|
|
577
|
+
dictionaryKeyPrefix: "",
|
|
578
|
+
},
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
export default config;
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
585
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
586
|
+
const config = {
|
|
587
|
+
// ... Sisa konfigurasi Anda
|
|
588
|
+
compiler: {
|
|
589
|
+
/**
|
|
590
|
+
* Menunjukkan apakah compiler harus diaktifkan.
|
|
591
|
+
*/
|
|
592
|
+
enabled: true,
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Menentukan jalur file output
|
|
596
|
+
*/
|
|
597
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
|
|
601
|
+
*/
|
|
602
|
+
saveComponents: false,
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Prefiks kunci kamus
|
|
606
|
+
*/
|
|
607
|
+
dictionaryKeyPrefix: "",
|
|
608
|
+
},
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
module.exports = config;
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
<Tabs>
|
|
615
|
+
<Tab value='Perintah ekstrak'>
|
|
616
|
+
|
|
617
|
+
Jalankan extractor untuk mengubah komponen Anda dan mengekstrak kontennya
|
|
618
|
+
|
|
619
|
+
```bash packageManager="npm"
|
|
620
|
+
npx intlayer extract
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
```bash packageManager="pnpm"
|
|
624
|
+
pnpm intlayer extract
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
```bash packageManager="yarn"
|
|
628
|
+
yarn intlayer extract
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
```bash packageManager="bun"
|
|
632
|
+
bunx intlayer extract
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
</Tab>
|
|
636
|
+
<Tab value='Compiler Babel'>
|
|
637
|
+
|
|
638
|
+
Perbarui `vite.config.ts` Anda untuk menyertakan plugin `intlayerCompiler`:
|
|
639
|
+
|
|
640
|
+
```ts fileName="vite.config.ts"
|
|
641
|
+
import { defineConfig } from "vite";
|
|
642
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
643
|
+
|
|
644
|
+
export default defineConfig({
|
|
645
|
+
plugins: [
|
|
646
|
+
intlayer(),
|
|
647
|
+
intlayerCompiler(), // Menambahkan plugin compiler
|
|
648
|
+
],
|
|
649
|
+
});
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
```bash packageManager="npm"
|
|
653
|
+
npm run build # Atau npm run dev
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
```bash packageManager="pnpm"
|
|
657
|
+
pnpm run build # Or pnpm run dev
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
```bash packageManager="yarn"
|
|
661
|
+
yarn build # Or yarn dev
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
```bash packageManager="bun"
|
|
665
|
+
bun run build # Or bun run dev
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
</Tab>
|
|
669
|
+
</Tabs>
|
|
670
|
+
|
|
671
|
+
---
|
|
672
|
+
|
|
673
|
+
## Configure TypeScript
|
|
674
|
+
|
|
675
|
+
Intlayer uses module augmentation to get benefits of TypeScript and make your codebase stronger.
|
|
676
|
+
|
|
677
|
+
Ensure your TypeScript configuration includes the autogenerated types:
|
|
678
|
+
|
|
679
|
+
```json5 fileName="tsconfig.json"
|
|
680
|
+
{
|
|
681
|
+
// ... your existing configurations
|
|
682
|
+
include: [
|
|
683
|
+
// ... your existing includes
|
|
684
|
+
".intlayer/**/*.ts", // Include the auto-generated types
|
|
685
|
+
],
|
|
686
|
+
}
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
---
|
|
690
|
+
|
|
691
|
+
## Git Configuration
|
|
692
|
+
|
|
693
|
+
It is recommended to ignore the files generated by Intlayer. This allows you to avoid committing them to your Git repository.
|
|
694
|
+
|
|
695
|
+
To do this, you can add the following instructions to your `.gitignore` file:
|
|
696
|
+
|
|
697
|
+
```plaintext fileName=".gitignore"
|
|
698
|
+
# Ignore the files generated by Intlayer
|
|
699
|
+
.intlayer
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
---
|
|
703
|
+
|
|
704
|
+
## VS Code Extension
|
|
705
|
+
|
|
706
|
+
To improve your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
|
|
707
|
+
|
|
708
|
+
[Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
709
|
+
|
|
710
|
+
This extension provides:
|
|
711
|
+
|
|
712
|
+
- **Autocompletion** for translation keys.
|
|
713
|
+
- **Real-time error detection** for missing translations.
|
|
714
|
+
- **Inline previews** of translated content.
|
|
715
|
+
- **Quick actions** to easily create and update translations.
|
|
716
|
+
|
|
717
|
+
For more details on how to use the extension, refer to the [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
|
|
718
|
+
|
|
719
|
+
---
|
|
720
|
+
|
|
721
|
+
## Go Further
|
|
722
|
+
|
|
723
|
+
To go further, you can implement the [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) or externalize your content using the [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md).
|
|
724
|
+
|
|
725
|
+
---
|
|
726
|
+
|
|
727
|
+
## Documentation References
|
|
728
|
+
|
|
729
|
+
- [Intlayer Documentation](https://intlayer.org)
|
|
730
|
+
- [React Router v7 Documentation](https://reactrouter.com/)
|
|
731
|
+
- [useIntlayer hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useIntlayer.md)
|
|
732
|
+
- [useLocale hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md)
|
|
733
|
+
- [Content Declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md)
|
|
734
|
+
- [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md)
|
|
735
|
+
|
|
736
|
+
This comprehensive guide provides everything you need to integrate Intlayer with React Router v7 for a fully internationalized application with locale-aware routing and TypeScript support.
|
|
737
|
+
|
|
515
738
|
### Langkah 11: Tambahkan middleware (Opsional)
|
|
516
739
|
|
|
517
740
|
Anda juga dapat menggunakan `intlayerProxy` untuk menambahkan routing sisi server ke aplikasi Anda. Plugin ini akan secara otomatis mendeteksi locale saat ini berdasarkan URL dan mengatur cookie locale yang sesuai. Jika tidak ada locale yang ditentukan, plugin akan menentukan locale yang paling sesuai berdasarkan preferensi bahasa browser pengguna. Jika tidak ada locale yang terdeteksi, maka akan mengarahkan ulang ke locale default.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-09-04
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: React Router v7 i18n - Cara menerjemahkan aplikasi React Router v7 di 2026
|
|
5
5
|
description: Pelajari cara menambahkan internasionalisasi (i18n) ke aplikasi React Router v7 Anda menggunakan Intlayer. Ikuti panduan komprehensif ini untuk membuat aplikasi Anda multibahasa dengan routing yang mendukung locale.
|
|
6
6
|
keywords:
|
|
@@ -457,6 +457,230 @@ export default function RootLayout() {
|
|
|
457
457
|
}
|
|
458
458
|
```
|
|
459
459
|
|
|
460
|
+
### (Opsional) Langkah 1 : Ekstrak konten komponen Anda
|
|
461
|
+
|
|
462
|
+
Jika Anda memiliki basis kode yang ada, mengubah ribuan file bisa memakan waktu lama.
|
|
463
|
+
|
|
464
|
+
Untuk memudahkan proses ini, Intlayer mengusulkan [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/cli/extract.md) untuk mengubah komponen Anda dan mengekstrak kontennya.
|
|
465
|
+
|
|
466
|
+
Untuk mengaturnya, Anda dapat menambahkan bagian `compiler` di file `intlayer.config.ts` Anda:
|
|
467
|
+
|
|
468
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
469
|
+
import { type IntlayerConfig } from "intlayer";
|
|
470
|
+
|
|
471
|
+
const config: IntlayerConfig = {
|
|
472
|
+
// ... Sisa konfigurasi Anda
|
|
473
|
+
compiler: {
|
|
474
|
+
/**
|
|
475
|
+
* Menunjukkan apakah compiler harus diaktifkan.
|
|
476
|
+
*/
|
|
477
|
+
enabled: true,
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Menentukan jalur file output
|
|
481
|
+
*/
|
|
482
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
|
|
486
|
+
*/
|
|
487
|
+
saveComponents: false,
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Prefiks kunci kamus
|
|
491
|
+
*/
|
|
492
|
+
dictionaryKeyPrefix: "",
|
|
493
|
+
},
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
export default config;
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
500
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
501
|
+
const config = {
|
|
502
|
+
// ... Sisa konfigurasi Anda
|
|
503
|
+
compiler: {
|
|
504
|
+
/**
|
|
505
|
+
* Menunjukkan apakah compiler harus diaktifkan.
|
|
506
|
+
*/
|
|
507
|
+
enabled: true,
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Menentukan jalur file output
|
|
511
|
+
*/
|
|
512
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
|
|
516
|
+
*/
|
|
517
|
+
saveComponents: false,
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Prefiks kunci kamus
|
|
521
|
+
*/
|
|
522
|
+
dictionaryKeyPrefix: "",
|
|
523
|
+
},
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
export default config;
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
530
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
531
|
+
const config = {
|
|
532
|
+
// ... Sisa konfigurasi Anda
|
|
533
|
+
compiler: {
|
|
534
|
+
/**
|
|
535
|
+
* Menunjukkan apakah compiler harus diaktifkan.
|
|
536
|
+
*/
|
|
537
|
+
enabled: true,
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Menentukan jalur file output
|
|
541
|
+
*/
|
|
542
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
|
|
546
|
+
*/
|
|
547
|
+
saveComponents: false,
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Prefiks kunci kamus
|
|
551
|
+
*/
|
|
552
|
+
dictionaryKeyPrefix: "",
|
|
553
|
+
},
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
module.exports = config;
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
<Tabs>
|
|
560
|
+
<Tab value='Perintah ekstrak'>
|
|
561
|
+
|
|
562
|
+
Jalankan extractor untuk mengubah komponen Anda dan mengekstrak kontennya
|
|
563
|
+
|
|
564
|
+
```bash packageManager="npm"
|
|
565
|
+
npx intlayer extract
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
```bash packageManager="pnpm"
|
|
569
|
+
pnpm intlayer extract
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
```bash packageManager="yarn"
|
|
573
|
+
yarn intlayer extract
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
```bash packageManager="bun"
|
|
577
|
+
bunx intlayer extract
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
</Tab>
|
|
581
|
+
<Tab value='Compiler Babel'>
|
|
582
|
+
|
|
583
|
+
Perbarui `vite.config.ts` Anda untuk menyertakan plugin `intlayerCompiler`:
|
|
584
|
+
|
|
585
|
+
```ts fileName="vite.config.ts"
|
|
586
|
+
import { defineConfig } from "vite";
|
|
587
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
588
|
+
|
|
589
|
+
export default defineConfig({
|
|
590
|
+
plugins: [
|
|
591
|
+
intlayer(),
|
|
592
|
+
intlayerCompiler(), // Menambahkan plugin compiler
|
|
593
|
+
],
|
|
594
|
+
});
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
```bash packageManager="npm"
|
|
598
|
+
npm run build # Atau npm run dev
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
```bash packageManager="pnpm"
|
|
602
|
+
pnpm run build # Or pnpm run dev
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
```bash packageManager="yarn"
|
|
606
|
+
yarn build # Or yarn dev
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
```bash packageManager="bun"
|
|
610
|
+
bun run build # Or bun run dev
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
</Tab>
|
|
614
|
+
</Tabs>
|
|
615
|
+
|
|
616
|
+
---
|
|
617
|
+
|
|
618
|
+
## Configure TypeScript
|
|
619
|
+
|
|
620
|
+
Intlayer uses module augmentation to get benefits of TypeScript and make your codebase stronger.
|
|
621
|
+
|
|
622
|
+
Ensure your TypeScript configuration includes the autogenerated types:
|
|
623
|
+
|
|
624
|
+
```json5 fileName="tsconfig.json"
|
|
625
|
+
{
|
|
626
|
+
// ... your existing configurations
|
|
627
|
+
include: [
|
|
628
|
+
// ... your existing includes
|
|
629
|
+
".intlayer/**/*.ts", // Include the auto-generated types
|
|
630
|
+
],
|
|
631
|
+
}
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
---
|
|
635
|
+
|
|
636
|
+
## Git Configuration
|
|
637
|
+
|
|
638
|
+
It is recommended to ignore the files generated by Intlayer. This allows you to avoid committing them to your Git repository.
|
|
639
|
+
|
|
640
|
+
To do this, you can add the following instructions to your `.gitignore` file:
|
|
641
|
+
|
|
642
|
+
```plaintext fileName=".gitignore"
|
|
643
|
+
# Ignore the files generated by Intlayer
|
|
644
|
+
.intlayer
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
---
|
|
648
|
+
|
|
649
|
+
## VS Code Extension
|
|
650
|
+
|
|
651
|
+
To improve your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
|
|
652
|
+
|
|
653
|
+
[Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
654
|
+
|
|
655
|
+
This extension provides:
|
|
656
|
+
|
|
657
|
+
- **Autocompletion** for translation keys.
|
|
658
|
+
- **Real-time error detection** for missing translations.
|
|
659
|
+
- **Inline previews** of translated content.
|
|
660
|
+
- **Quick actions** to easily create and update translations.
|
|
661
|
+
|
|
662
|
+
For more details on how to use the extension, refer to the [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
|
|
663
|
+
|
|
664
|
+
---
|
|
665
|
+
|
|
666
|
+
## Go Further
|
|
667
|
+
|
|
668
|
+
To go further, you can implement the [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) or externalize your content using the [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md).
|
|
669
|
+
|
|
670
|
+
---
|
|
671
|
+
|
|
672
|
+
## Documentation References
|
|
673
|
+
|
|
674
|
+
- [Intlayer Documentation](https://intlayer.org)
|
|
675
|
+
- [React Router v7 Documentation](https://reactrouter.com/)
|
|
676
|
+
- [React Router fs-routes Documentation](https://reactrouter.com/how-to/file-route-conventions)
|
|
677
|
+
- [useIntlayer hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useIntlayer.md)
|
|
678
|
+
- [useLocale hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md)
|
|
679
|
+
- [Content Declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md)
|
|
680
|
+
- [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md)
|
|
681
|
+
|
|
682
|
+
This comprehensive guide provides everything you need to integrate Intlayer with React Router v7 using file-system based routing for a fully internationalized application with locale-aware routing and TypeScript support.
|
|
683
|
+
|
|
460
684
|
### Langkah 11: Tambahkan middleware (Opsional)
|
|
461
685
|
|
|
462
686
|
Anda juga dapat menggunakan `intlayerProxy` untuk menambahkan routing sisi server ke aplikasi Anda. Plugin ini akan secara otomatis mendeteksi locale saat ini berdasarkan URL dan mengatur cookie locale yang sesuai. Jika tidak ada locale yang ditentukan, plugin akan menentukan locale yang paling sesuai berdasarkan preferensi bahasa browser pengguna. Jika tidak ada locale yang terdeteksi, maka akan mengarahkan ulang ke locale default.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-11-20
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: SvelteKit i18n - Cara menerjemahkan aplikasi SvelteKit di 2026
|
|
5
5
|
description: Temukan cara membuat situs web SvelteKit Anda menjadi multibahasa. Ikuti dokumentasi untuk melakukan internasionalisasi (i18n) dan menerjemahkannya menggunakan Server-Side Rendering (SSR).
|
|
6
6
|
keywords:
|
|
@@ -185,7 +185,7 @@ Sekarang Anda dapat menggunakan fungsi `useIntlayer` di komponen Svelte mana pun
|
|
|
185
185
|
|
|
186
186
|
> **Catatan:** `useIntlayer` mengembalikan store Svelte, jadi Anda perlu menggunakan prefix `---
|
|
187
187
|
> createdAt: 2025-11-20
|
|
188
|
-
> updatedAt:
|
|
188
|
+
> updatedAt: 2026-03-12
|
|
189
189
|
> title: Cara menerjemahkan aplikasi SvelteKit Anda – panduan i18n 2026
|
|
190
190
|
> description: Temukan cara membuat situs web SvelteKit Anda menjadi multibahasa. Ikuti dokumentasi untuk melakukan internasionalisasi (i18n) dan menerjemahkannya menggunakan Server-Side Rendering (SSR).
|
|
191
191
|
> keywords:
|
|
@@ -744,6 +744,162 @@ Disarankan untuk mengabaikan file-file yang dihasilkan oleh Intlayer.
|
|
|
744
744
|
|
|
745
745
|
---
|
|
746
746
|
|
|
747
|
+
### (Opsional) Langkah 1 : Ekstrak konten komponen Anda
|
|
748
|
+
|
|
749
|
+
Jika Anda memiliki basis kode yang ada, mengubah ribuan file bisa memakan waktu lama.
|
|
750
|
+
|
|
751
|
+
Untuk memudahkan proses ini, Intlayer mengusulkan [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/cli/extract.md) untuk mengubah komponen Anda dan mengekstrak kontennya.
|
|
752
|
+
|
|
753
|
+
Untuk mengaturnya, Anda dapat menambahkan bagian `compiler` di file `intlayer.config.ts` Anda:
|
|
754
|
+
|
|
755
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
756
|
+
import { type IntlayerConfig } from "intlayer";
|
|
757
|
+
|
|
758
|
+
const config: IntlayerConfig = {
|
|
759
|
+
// ... Sisa konfigurasi Anda
|
|
760
|
+
compiler: {
|
|
761
|
+
/**
|
|
762
|
+
* Menunjukkan apakah compiler harus diaktifkan.
|
|
763
|
+
*/
|
|
764
|
+
enabled: true,
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Menentukan jalur file output
|
|
768
|
+
*/
|
|
769
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
|
|
773
|
+
*/
|
|
774
|
+
saveComponents: false,
|
|
775
|
+
|
|
776
|
+
/**
|
|
777
|
+
* Prefiks kunci kamus
|
|
778
|
+
*/
|
|
779
|
+
dictionaryKeyPrefix: "",
|
|
780
|
+
},
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
export default config;
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
787
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
788
|
+
const config = {
|
|
789
|
+
// ... Sisa konfigurasi Anda
|
|
790
|
+
compiler: {
|
|
791
|
+
/**
|
|
792
|
+
* Menunjukkan apakah compiler harus diaktifkan.
|
|
793
|
+
*/
|
|
794
|
+
enabled: true,
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Menentukan jalur file output
|
|
798
|
+
*/
|
|
799
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
|
|
803
|
+
*/
|
|
804
|
+
saveComponents: false,
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Prefiks kunci kamus
|
|
808
|
+
*/
|
|
809
|
+
dictionaryKeyPrefix: "",
|
|
810
|
+
},
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
export default config;
|
|
814
|
+
```
|
|
815
|
+
|
|
816
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
817
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
818
|
+
const config = {
|
|
819
|
+
// ... Sisa konfigurasi Anda
|
|
820
|
+
compiler: {
|
|
821
|
+
/**
|
|
822
|
+
* Menunjukkan apakah compiler harus diaktifkan.
|
|
823
|
+
*/
|
|
824
|
+
enabled: true,
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Menentukan jalur file output
|
|
828
|
+
*/
|
|
829
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Menunjukkan apakah komponen harus disimpan setelah diubah. Dengan begitu, compiler dapat dijalankan satu kali saja untuk mengubah aplikasi, lalu dapat dihapus.
|
|
833
|
+
*/
|
|
834
|
+
saveComponents: false,
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Prefiks kunci kamus
|
|
838
|
+
*/
|
|
839
|
+
dictionaryKeyPrefix: "",
|
|
840
|
+
},
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
module.exports = config;
|
|
844
|
+
```
|
|
845
|
+
|
|
846
|
+
<Tabs>
|
|
847
|
+
<Tab value='Perintah ekstrak'>
|
|
848
|
+
|
|
849
|
+
Jalankan extractor untuk mengubah komponen Anda dan mengekstrak kontennya
|
|
850
|
+
|
|
851
|
+
```bash packageManager="npm"
|
|
852
|
+
npx intlayer extract
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
```bash packageManager="pnpm"
|
|
856
|
+
pnpm intlayer extract
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
```bash packageManager="yarn"
|
|
860
|
+
yarn intlayer extract
|
|
861
|
+
```
|
|
862
|
+
|
|
863
|
+
```bash packageManager="bun"
|
|
864
|
+
bunx intlayer extract
|
|
865
|
+
```
|
|
866
|
+
|
|
867
|
+
</Tab>
|
|
868
|
+
<Tab value='Compiler Babel'>
|
|
869
|
+
|
|
870
|
+
Perbarui `vite.config.ts` Anda untuk menyertakan plugin `intlayerCompiler`:
|
|
871
|
+
|
|
872
|
+
```ts fileName="vite.config.ts"
|
|
873
|
+
import { defineConfig } from "vite";
|
|
874
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
875
|
+
|
|
876
|
+
export default defineConfig({
|
|
877
|
+
plugins: [
|
|
878
|
+
intlayer(),
|
|
879
|
+
intlayerCompiler(), // Menambahkan plugin compiler
|
|
880
|
+
],
|
|
881
|
+
});
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
```bash packageManager="npm"
|
|
885
|
+
npm run build # Atau npm run dev
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
```bash packageManager="pnpm"
|
|
889
|
+
pnpm run build # Or pnpm run dev
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
```bash packageManager="yarn"
|
|
893
|
+
yarn build # Or yarn dev
|
|
894
|
+
```
|
|
895
|
+
|
|
896
|
+
```bash packageManager="bun"
|
|
897
|
+
bun run build # Or bun run dev
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
</Tab>
|
|
901
|
+
</Tabs>
|
|
902
|
+
|
|
747
903
|
### Melangkah Lebih Jauh
|
|
748
904
|
|
|
749
905
|
- **Editor Visual**: Integrasikan [Intlayer Visual Editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/intlayer_visual_editor.md) untuk mengedit terjemahan langsung dari UI.
|