@intlayer/docs 6.1.6-canary.0 → 6.1.6
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/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +71 -80
- package/dist/cjs/generated/docs.entry.cjs +16 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +16 -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/intlayer_with_angular.md +2 -2
- package/docs/ar/intlayer_with_astro.md +246 -0
- package/docs/ar/intlayer_with_create_react_app.md +3 -2
- package/docs/ar/intlayer_with_express.md +2 -2
- package/docs/ar/intlayer_with_nestjs.md +2 -2
- package/docs/ar/intlayer_with_nextjs_14.md +2 -2
- package/docs/ar/intlayer_with_nextjs_15.md +2 -2
- package/docs/ar/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ar/intlayer_with_nuxt.md +2 -2
- package/docs/ar/intlayer_with_react_native+expo.md +11 -20
- package/docs/ar/intlayer_with_react_router_v7.md +195 -241
- package/docs/ar/intlayer_with_tanstack.md +198 -272
- package/docs/ar/intlayer_with_vite+preact.md +9 -9
- package/docs/ar/intlayer_with_vite+react.md +7 -7
- package/docs/ar/intlayer_with_vite+vue.md +9 -9
- package/docs/de/intlayer_with_angular.md +2 -2
- package/docs/de/intlayer_with_astro.md +246 -0
- package/docs/de/intlayer_with_create_react_app.md +2 -2
- package/docs/de/intlayer_with_express.md +2 -2
- package/docs/de/intlayer_with_nestjs.md +2 -2
- package/docs/de/intlayer_with_nextjs_14.md +2 -2
- package/docs/de/intlayer_with_nextjs_15.md +2 -2
- package/docs/de/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/de/intlayer_with_nuxt.md +2 -2
- package/docs/de/intlayer_with_react_native+expo.md +11 -20
- package/docs/de/intlayer_with_react_router_v7.md +193 -242
- package/docs/de/intlayer_with_tanstack.md +194 -266
- package/docs/de/intlayer_with_vite+preact.md +9 -9
- package/docs/de/intlayer_with_vite+react.md +9 -9
- package/docs/de/intlayer_with_vite+vue.md +11 -11
- package/docs/de/packages/vite-intlayer/index.md +3 -3
- package/docs/en/how_works_intlayer.md +1 -1
- package/docs/en/index.md +1 -1
- package/docs/en/intlayer_cli.md +1 -1
- package/docs/en/intlayer_with_angular.md +4 -4
- package/docs/en/intlayer_with_astro.md +246 -0
- package/docs/en/intlayer_with_create_react_app.md +4 -4
- package/docs/en/intlayer_with_express.md +3 -3
- package/docs/en/intlayer_with_lynx+react.md +1 -1
- package/docs/en/intlayer_with_nestjs.md +2 -2
- package/docs/en/intlayer_with_nextjs_14.md +13 -4
- package/docs/en/intlayer_with_nextjs_15.md +13 -4
- package/docs/en/intlayer_with_nextjs_page_router.md +5 -5
- package/docs/en/intlayer_with_nuxt.md +4 -4
- package/docs/en/intlayer_with_react_native+expo.md +46 -24
- package/docs/en/intlayer_with_react_router_v7.md +164 -211
- package/docs/en/intlayer_with_tanstack.md +166 -241
- package/docs/en/intlayer_with_vite+preact.md +12 -12
- package/docs/en/intlayer_with_vite+react.md +12 -12
- package/docs/en/intlayer_with_vite+solid.md +2 -2
- package/docs/en/intlayer_with_vite+svelte.md +2 -2
- package/docs/en/intlayer_with_vite+vue.md +12 -12
- package/docs/en/introduction.md +1 -1
- package/docs/en/packages/next-intlayer/useDictionary.md +1 -1
- package/docs/en/packages/next-intlayer/useIntlayer.md +1 -1
- package/docs/en/packages/react-intlayer/useDictionary.md +1 -1
- package/docs/en/packages/react-intlayer/useI18n.md +1 -1
- package/docs/en/packages/react-intlayer/useIntlayer.md +1 -1
- package/docs/en/releases/v6.md +1 -0
- package/docs/en/roadmap.md +1 -1
- package/docs/en-GB/intlayer_with_angular.md +3 -3
- package/docs/en-GB/intlayer_with_astro.md +246 -0
- package/docs/en-GB/intlayer_with_create_react_app.md +5 -4
- package/docs/en-GB/intlayer_with_express.md +2 -2
- package/docs/en-GB/intlayer_with_nestjs.md +2 -2
- package/docs/en-GB/intlayer_with_nextjs_14.md +4 -4
- package/docs/en-GB/intlayer_with_nextjs_15.md +2 -2
- package/docs/en-GB/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/en-GB/intlayer_with_nuxt.md +2 -2
- package/docs/en-GB/intlayer_with_react_native+expo.md +11 -20
- package/docs/en-GB/intlayer_with_react_router_v7.md +171 -220
- package/docs/en-GB/intlayer_with_tanstack.md +174 -248
- package/docs/en-GB/intlayer_with_vite+preact.md +9 -9
- package/docs/en-GB/intlayer_with_vite+react.md +9 -9
- package/docs/en-GB/intlayer_with_vite+vue.md +11 -11
- package/docs/en-GB/packages/next-intlayer/useIntlayer.md +1 -1
- package/docs/en-GB/packages/react-intlayer/useIntlayer.md +1 -1
- package/docs/es/intlayer_with_angular.md +2 -2
- package/docs/es/intlayer_with_astro.md +246 -0
- package/docs/es/intlayer_with_create_react_app.md +3 -2
- package/docs/es/intlayer_with_express.md +2 -2
- package/docs/es/intlayer_with_nextjs_14.md +2 -2
- package/docs/es/intlayer_with_nextjs_15.md +2 -2
- package/docs/es/intlayer_with_react_native+expo.md +11 -20
- package/docs/es/intlayer_with_react_router_v7.md +188 -232
- package/docs/es/intlayer_with_tanstack.md +203 -273
- package/docs/es/intlayer_with_vite+preact.md +7 -7
- package/docs/es/intlayer_with_vite+react.md +7 -7
- package/docs/es/intlayer_with_vite+vue.md +9 -9
- package/docs/fr/intlayer_with_angular.md +2 -2
- package/docs/fr/intlayer_with_astro.md +246 -0
- package/docs/fr/intlayer_with_create_react_app.md +3 -2
- package/docs/fr/intlayer_with_express.md +2 -2
- package/docs/fr/intlayer_with_nestjs.md +2 -2
- package/docs/fr/intlayer_with_nextjs_14.md +2 -2
- package/docs/fr/intlayer_with_react_native+expo.md +11 -20
- package/docs/fr/intlayer_with_react_router_v7.md +188 -248
- package/docs/fr/intlayer_with_tanstack.md +192 -265
- package/docs/fr/intlayer_with_vite+preact.md +7 -7
- package/docs/fr/intlayer_with_vite+react.md +7 -7
- package/docs/fr/intlayer_with_vite+vue.md +9 -9
- package/docs/hi/intlayer_cli.md +1 -4
- package/docs/hi/intlayer_with_angular.md +2 -2
- package/docs/hi/intlayer_with_astro.md +246 -0
- package/docs/hi/intlayer_with_create_react_app.md +2 -2
- package/docs/hi/intlayer_with_express.md +2 -2
- package/docs/hi/intlayer_with_nestjs.md +2 -2
- package/docs/hi/intlayer_with_nextjs_14.md +2 -2
- package/docs/hi/intlayer_with_nextjs_15.md +2 -2
- package/docs/hi/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/hi/intlayer_with_nuxt.md +2 -2
- package/docs/hi/intlayer_with_react_native+expo.md +11 -20
- package/docs/hi/intlayer_with_react_router_v7.md +199 -243
- package/docs/hi/intlayer_with_tanstack.md +210 -285
- package/docs/hi/intlayer_with_vite+preact.md +9 -9
- package/docs/hi/intlayer_with_vite+react.md +9 -9
- package/docs/hi/intlayer_with_vite+solid.md +1 -1
- package/docs/hi/intlayer_with_vite+vue.md +11 -11
- package/docs/it/intlayer_with_angular.md +2 -2
- package/docs/it/intlayer_with_astro.md +246 -0
- package/docs/it/intlayer_with_create_react_app.md +3 -2
- package/docs/it/intlayer_with_express.md +2 -2
- package/docs/it/intlayer_with_nestjs.md +2 -2
- package/docs/it/intlayer_with_nextjs_14.md +2 -2
- package/docs/it/intlayer_with_nextjs_15.md +2 -2
- package/docs/it/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/it/intlayer_with_nuxt.md +2 -2
- package/docs/it/intlayer_with_react_native+expo.md +11 -21
- package/docs/it/intlayer_with_react_router_v7.md +195 -242
- package/docs/it/intlayer_with_tanstack.md +203 -267
- package/docs/it/intlayer_with_vite+preact.md +9 -9
- package/docs/it/intlayer_with_vite+react.md +13 -11
- package/docs/it/intlayer_with_vite+vue.md +11 -11
- package/docs/ja/intlayer_with_angular.md +2 -2
- package/docs/ja/intlayer_with_astro.md +246 -0
- package/docs/ja/intlayer_with_create_react_app.md +3 -2
- package/docs/ja/intlayer_with_express.md +2 -2
- package/docs/ja/intlayer_with_nestjs.md +2 -2
- package/docs/ja/intlayer_with_nextjs_14.md +2 -2
- package/docs/ja/intlayer_with_nextjs_15.md +2 -2
- package/docs/ja/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ja/intlayer_with_nuxt.md +2 -2
- package/docs/ja/intlayer_with_react_native+expo.md +18 -29
- package/docs/ja/intlayer_with_react_router_v7.md +204 -250
- package/docs/ja/intlayer_with_tanstack.md +218 -286
- package/docs/ja/intlayer_with_vite+preact.md +9 -9
- package/docs/ja/intlayer_with_vite+react.md +11 -11
- package/docs/ja/intlayer_with_vite+vue.md +11 -11
- package/docs/ko/intlayer_with_angular.md +2 -2
- package/docs/ko/intlayer_with_astro.md +246 -0
- package/docs/ko/intlayer_with_create_react_app.md +3 -2
- package/docs/ko/intlayer_with_express.md +2 -2
- package/docs/ko/intlayer_with_nestjs.md +2 -2
- package/docs/ko/intlayer_with_nextjs_14.md +2 -2
- package/docs/ko/intlayer_with_nextjs_15.md +2 -2
- package/docs/ko/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ko/intlayer_with_nuxt.md +2 -2
- package/docs/ko/intlayer_with_react_native+expo.md +19 -28
- package/docs/ko/intlayer_with_react_router_v7.md +190 -244
- package/docs/ko/intlayer_with_tanstack.md +200 -270
- package/docs/ko/intlayer_with_vite+preact.md +9 -9
- package/docs/ko/intlayer_with_vite+react.md +9 -9
- package/docs/ko/intlayer_with_vite+vue.md +11 -11
- package/docs/pt/intlayer_with_angular.md +2 -2
- package/docs/pt/intlayer_with_astro.md +246 -0
- package/docs/pt/intlayer_with_create_react_app.md +3 -2
- package/docs/pt/intlayer_with_express.md +2 -2
- package/docs/pt/intlayer_with_nestjs.md +2 -2
- package/docs/pt/intlayer_with_nextjs_14.md +2 -2
- package/docs/pt/intlayer_with_nextjs_15.md +2 -2
- package/docs/pt/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/pt/intlayer_with_nuxt.md +2 -2
- package/docs/pt/intlayer_with_react_native+expo.md +11 -20
- package/docs/pt/intlayer_with_react_router_v7.md +7 -13
- package/docs/pt/intlayer_with_tanstack.md +183 -258
- package/docs/pt/intlayer_with_vite+preact.md +9 -9
- package/docs/pt/intlayer_with_vite+react.md +9 -9
- package/docs/pt/intlayer_with_vite+vue.md +9 -9
- package/docs/ru/intlayer_with_angular.md +2 -2
- package/docs/ru/intlayer_with_astro.md +246 -0
- package/docs/ru/intlayer_with_create_react_app.md +3 -2
- package/docs/ru/intlayer_with_express.md +2 -2
- package/docs/ru/intlayer_with_nestjs.md +2 -2
- package/docs/ru/intlayer_with_nextjs_14.md +2 -2
- package/docs/ru/intlayer_with_nextjs_15.md +2 -2
- package/docs/ru/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ru/intlayer_with_nuxt.md +2 -2
- package/docs/ru/intlayer_with_react_native+expo.md +11 -20
- package/docs/ru/intlayer_with_react_router_v7.md +192 -238
- package/docs/ru/intlayer_with_tanstack.md +197 -269
- package/docs/ru/intlayer_with_vite+preact.md +9 -9
- package/docs/ru/intlayer_with_vite+react.md +9 -9
- package/docs/ru/intlayer_with_vite+vue.md +11 -11
- package/docs/tr/how_works_intlayer.md +1 -1
- package/docs/tr/index.md +1 -1
- package/docs/tr/intlayer_cli.md +1 -1
- package/docs/tr/intlayer_with_angular.md +4 -4
- package/docs/tr/intlayer_with_astro.md +246 -0
- package/docs/tr/intlayer_with_create_react_app.md +4 -4
- package/docs/tr/intlayer_with_express.md +3 -3
- package/docs/tr/intlayer_with_lynx+react.md +1 -1
- package/docs/tr/intlayer_with_nestjs.md +2 -2
- package/docs/tr/intlayer_with_nextjs_14.md +2 -2
- package/docs/tr/intlayer_with_nextjs_15.md +4 -4
- package/docs/tr/intlayer_with_nextjs_page_router.md +5 -5
- package/docs/tr/intlayer_with_nuxt.md +4 -4
- package/docs/tr/intlayer_with_react_native+expo.md +12 -21
- package/docs/tr/intlayer_with_react_router_v7.md +222 -267
- package/docs/tr/intlayer_with_tanstack.md +400 -303
- package/docs/tr/intlayer_with_vite+preact.md +12 -12
- package/docs/tr/intlayer_with_vite+react.md +12 -12
- package/docs/tr/intlayer_with_vite+solid.md +2 -2
- package/docs/tr/intlayer_with_vite+svelte.md +2 -2
- package/docs/tr/intlayer_with_vite+vue.md +12 -12
- package/docs/tr/introduction.md +1 -1
- package/docs/tr/packages/react-intlayer/useDictionary.md +1 -1
- package/docs/tr/packages/react-intlayer/useI18n.md +1 -1
- package/docs/tr/roadmap.md +1 -1
- package/docs/zh/intlayer_with_angular.md +2 -2
- package/docs/zh/intlayer_with_astro.md +246 -0
- package/docs/zh/intlayer_with_create_react_app.md +3 -2
- package/docs/zh/intlayer_with_express.md +2 -2
- package/docs/zh/intlayer_with_nestjs.md +2 -2
- package/docs/zh/intlayer_with_nextjs_14.md +2 -2
- package/docs/zh/intlayer_with_nextjs_15.md +2 -2
- package/docs/zh/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/zh/intlayer_with_nuxt.md +2 -2
- package/docs/zh/intlayer_with_react_native+expo.md +19 -28
- package/docs/zh/intlayer_with_react_router_v7.md +200 -248
- package/docs/zh/intlayer_with_tanstack.md +208 -283
- package/docs/zh/intlayer_with_vite+preact.md +9 -9
- package/docs/zh/intlayer_with_vite+react.md +9 -9
- package/docs/zh/intlayer_with_vite+vue.md +9 -9
- package/package.json +11 -11
- package/src/generated/docs.entry.ts +16 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt: 2025-09-
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-09-04
|
|
3
|
+
updatedAt: 2025-10-03
|
|
4
4
|
title: React Router v7'de Intlayer ile Başlarken
|
|
5
|
-
description:
|
|
5
|
+
description: React Router v7 uygulamanıza Intlayer kullanarak uluslararasılaştırmayı (i18n) nasıl ekleyeceğinizi öğrenin. Uygulamanızı yerel dil farkındalıklı yönlendirme ile çok dilli hale getirmek için bu kapsamlı rehberi takip edin.
|
|
6
6
|
keywords:
|
|
7
7
|
- Uluslararasılaştırma
|
|
8
8
|
- Dokümantasyon
|
|
@@ -17,13 +17,12 @@ slugs:
|
|
|
17
17
|
- environment
|
|
18
18
|
- vite-and-react
|
|
19
19
|
- react-router-v7
|
|
20
|
-
applicationTemplate: https://github.com/
|
|
21
|
-
author: AydinTheFirst
|
|
20
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-react-router-v7-template
|
|
22
21
|
---
|
|
23
22
|
|
|
24
|
-
# Intlayer ve React Router v7 ile
|
|
23
|
+
# Intlayer ve React Router v7 ile Uluslararasılaştırmaya (i18n) Başlarken
|
|
25
24
|
|
|
26
|
-
Bu
|
|
25
|
+
Bu rehber, React Router v7 projelerinde yerel dil farkındalıklı yönlendirme, TypeScript desteği ve modern geliştirme uygulamaları ile sorunsuz uluslararasılaştırma için **Intlayer**'ın nasıl entegre edileceğini gösterir.
|
|
27
26
|
|
|
28
27
|
## Intlayer Nedir?
|
|
29
28
|
|
|
@@ -31,19 +30,19 @@ Bu kılavuz, React Router v7 projelerinde yerel ayar bilincine sahip yönlendirm
|
|
|
31
30
|
|
|
32
31
|
Intlayer ile şunları yapabilirsiniz:
|
|
33
32
|
|
|
34
|
-
- **Bileşen
|
|
35
|
-
- **Meta verileri,
|
|
36
|
-
- **Otomatik tamamlama ve hata
|
|
37
|
-
- **Dinamik yerel algılama ve
|
|
38
|
-
- **React Router v7'nin yapılandırma tabanlı yönlendirme sistemi ile yerel
|
|
33
|
+
- **Bileşen seviyesinde bildirimsel sözlükler kullanarak çevirileri kolayca yönetmek.**
|
|
34
|
+
- **Meta verileri, yönlendirmeleri ve içeriği dinamik olarak yerelleştirmek.**
|
|
35
|
+
- **Otomatik oluşturulan tiplerle TypeScript desteğini sağlamak, otomatik tamamlama ve hata tespitini geliştirmek.**
|
|
36
|
+
- **Dinamik yerel dil algılama ve değiştirme gibi gelişmiş özelliklerden faydalanmak.**
|
|
37
|
+
- **React Router v7'nin yapılandırma tabanlı yönlendirme sistemi ile yerel dil farkındalıklı yönlendirmeyi etkinleştirin.**
|
|
39
38
|
|
|
40
39
|
---
|
|
41
40
|
|
|
42
|
-
## React Router v7 Uygulamasında Intlayer Kurulumu Adım Adım
|
|
41
|
+
## React Router v7 Uygulamasında Intlayer Kurulumu İçin Adım Adım Rehber
|
|
43
42
|
|
|
44
|
-
### Adım 1: Bağımlılıkları
|
|
43
|
+
### Adım 1: Bağımlılıkları Yükleyin
|
|
45
44
|
|
|
46
|
-
Tercih ettiğiniz paket yöneticisini kullanarak gerekli paketleri
|
|
45
|
+
Tercih ettiğiniz paket yöneticisini kullanarak gerekli paketleri yükleyin:
|
|
47
46
|
|
|
48
47
|
```bash packageManager="npm"
|
|
49
48
|
npm install intlayer react-intlayer
|
|
@@ -57,15 +56,15 @@ pnpm add vite-intlayer --save-dev
|
|
|
57
56
|
|
|
58
57
|
- **intlayer**
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
- Uluslararasılaştırma araçlarını yapılandırma yönetimi, çeviri, [içerik beyanı](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/dictionary/get_started.md), transpile etme ve [CLI komutları](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/intlayer_cli.md) için sağlayan temel paket.
|
|
61
60
|
|
|
62
61
|
- **react-intlayer**
|
|
63
|
-
Intlayer'ı React
|
|
62
|
+
Intlayer'ı React uygulamasıyla entegre eden paket. React uluslararasılaştırması için bağlam sağlayıcıları ve kancalar sunar.
|
|
64
63
|
|
|
65
64
|
- **vite-intlayer**
|
|
66
|
-
[Vite paketleyici](https://vite.dev/guide/why.html#why-bundle-for-production) ile
|
|
65
|
+
Intlayer'ı [Vite paketleyici](https://vite.dev/guide/why.html#why-bundle-for-production) ile entegre etmek için Vite eklentisini, ayrıca kullanıcının tercih ettiği yerel dili algılamak, çerezleri yönetmek ve URL yönlendirmesini işlemek için ara yazılımı içerir.
|
|
67
66
|
|
|
68
|
-
### Adım 2:
|
|
67
|
+
### Adım 2: Projenizin Yapılandırması
|
|
69
68
|
|
|
70
69
|
Uygulamanızın dillerini yapılandırmak için bir yapılandırma dosyası oluşturun:
|
|
71
70
|
|
|
@@ -75,10 +74,7 @@ import { type IntlayerConfig, Locales } from "intlayer";
|
|
|
75
74
|
const config: IntlayerConfig = {
|
|
76
75
|
internationalization: {
|
|
77
76
|
defaultLocale: Locales.ENGLISH,
|
|
78
|
-
locales: [Locales.ENGLISH, Locales.
|
|
79
|
-
},
|
|
80
|
-
middleware: {
|
|
81
|
-
prefixDefault: true, // URL'lerde her zaman varsayılan yerel ayarı önekle
|
|
77
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
82
78
|
},
|
|
83
79
|
};
|
|
84
80
|
|
|
@@ -92,10 +88,7 @@ import { Locales } from "intlayer";
|
|
|
92
88
|
const config = {
|
|
93
89
|
internationalization: {
|
|
94
90
|
defaultLocale: Locales.ENGLISH,
|
|
95
|
-
locales: [Locales.ENGLISH, Locales.
|
|
96
|
-
},
|
|
97
|
-
middleware: {
|
|
98
|
-
prefixDefault: true,
|
|
91
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
99
92
|
},
|
|
100
93
|
};
|
|
101
94
|
|
|
@@ -109,70 +102,64 @@ const { Locales } = require("intlayer");
|
|
|
109
102
|
const config = {
|
|
110
103
|
internationalization: {
|
|
111
104
|
defaultLocale: Locales.ENGLISH,
|
|
112
|
-
locales: [Locales.ENGLISH, Locales.
|
|
113
|
-
},
|
|
114
|
-
middleware: {
|
|
115
|
-
prefixDefault: true,
|
|
105
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
116
106
|
},
|
|
117
107
|
};
|
|
118
108
|
|
|
119
109
|
module.exports = config;
|
|
120
110
|
```
|
|
121
111
|
|
|
122
|
-
> Bu yapılandırma dosyası aracılığıyla, yerelleştirilmiş URL'
|
|
123
|
-
|
|
124
|
-
### Adım 3: React Router v7 Rotalarını Yapılandırma
|
|
125
|
-
|
|
126
|
-
Yerel ayar bilincine sahip rotalarla yönlendirme yapılandırmanızı ayarlayın:
|
|
127
|
-
|
|
128
|
-
```typescript fileName="app/routes.ts" codeFormat="typescript"
|
|
129
|
-
import { layout, route, type RouteConfig } from "@react-router/dev/routes";
|
|
112
|
+
> Bu yapılandırma dosyası aracılığıyla, yerelleştirilmiş URL'leri, ara yazılım yönlendirmesini, çerez isimlerini, içerik bildirimlerinizin konumunu ve uzantısını ayarlayabilir, Intlayer günlüklerini konsolda devre dışı bırakabilir ve daha fazlasını yapabilirsiniz. Mevcut parametrelerin tam listesi için [yapılandırma dokümantasyonuna](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/configuration.md) bakınız.
|
|
130
113
|
|
|
131
|
-
|
|
132
|
-
layout("routes/layout.tsx", [
|
|
133
|
-
route("/", "routes/page.tsx"), // Kök sayfa - yerel ayara yönlendirir
|
|
134
|
-
route("/:lang", "routes/[lang]/page.tsx"), // Yerelleştirilmiş ana sayfa
|
|
135
|
-
route("/:lang/about", "routes/[lang]/about/page.tsx"), // Yerelleştirilmiş hakkımızda sayfası
|
|
136
|
-
]),
|
|
137
|
-
] satisfies RouteConfig;
|
|
138
|
-
```
|
|
114
|
+
### Adım 3: Intlayer'ı Vite Yapılandırmanıza Entegre Edin
|
|
139
115
|
|
|
140
|
-
|
|
116
|
+
Yapılandırmanıza intlayer eklentisini ekleyin:
|
|
141
117
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
```typescript fileName="vite.config.ts" codeFormat="typescript"
|
|
118
|
+
```typescript fileName="vite.config.ts"
|
|
145
119
|
import { reactRouter } from "@react-router/dev/vite";
|
|
146
120
|
import { defineConfig } from "vite";
|
|
147
|
-
import {
|
|
121
|
+
import { intlayer } from "vite-intlayer";
|
|
148
122
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
149
123
|
|
|
150
124
|
export default defineConfig({
|
|
151
|
-
plugins: [
|
|
152
|
-
reactRouter(),
|
|
153
|
-
tsconfigPaths(),
|
|
154
|
-
intlayer(),
|
|
155
|
-
intlayerMiddlewarePlugin(),
|
|
156
|
-
],
|
|
125
|
+
plugins: [reactRouter(), tsconfigPaths(), intlayer()],
|
|
157
126
|
});
|
|
158
127
|
```
|
|
159
128
|
|
|
160
|
-
> `intlayer()` Vite eklentisi, Intlayer'ı Vite ile entegre etmek için kullanılır. İçerik bildirim dosyalarının oluşturulmasını sağlar ve
|
|
129
|
+
> `intlayer()` Vite eklentisi, Intlayer'ı Vite ile entegre etmek için kullanılır. İçerik bildirim dosyalarının oluşturulmasını sağlar ve geliştirme modunda bunları izler. Vite uygulaması içinde Intlayer ortam değişkenlerini tanımlar. Ayrıca, performansı optimize etmek için takma adlar sağlar.
|
|
161
130
|
|
|
162
|
-
### Adım
|
|
131
|
+
### Adım 4: React Router v7 Rotalarını Yapılandırma
|
|
163
132
|
|
|
164
|
-
|
|
133
|
+
Yerel dil farkındalığı olan rotalarla yönlendirme yapılandırmanızı ayarlayın:
|
|
165
134
|
|
|
166
|
-
|
|
135
|
+
```typescript fileName="app/routes.ts"
|
|
136
|
+
import { layout, route, type RouteConfig } from "@react-router/dev/routes";
|
|
167
137
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
138
|
+
export default [
|
|
139
|
+
layout("routes/layout.tsx", [
|
|
140
|
+
route("/:lang?", "routes/page.tsx"), // Yerelleştirilmiş ana sayfa
|
|
141
|
+
route("/:lang?/about", "routes/about/page.tsx"), // Yerelleştirilmiş hakkında sayfası
|
|
142
|
+
]),
|
|
143
|
+
] satisfies RouteConfig;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Adım 5: Layout Bileşenleri Oluşturun
|
|
147
|
+
|
|
148
|
+
Kök layout ve dil bazlı layout'larınızı ayarlayın:
|
|
149
|
+
|
|
150
|
+
#### Kök Layout
|
|
151
|
+
|
|
152
|
+
```tsx fileName="app/routes/layout.tsx"
|
|
171
153
|
import { IntlayerProvider } from "react-intlayer";
|
|
154
|
+
import { Outlet } from "react-router";
|
|
155
|
+
|
|
156
|
+
import type { Route } from "./+types/layout";
|
|
157
|
+
|
|
158
|
+
export default function RootLayout({ params }: Route.ComponentProps) {
|
|
159
|
+
const { locale } = params;
|
|
172
160
|
|
|
173
|
-
export default function RootLayout() {
|
|
174
161
|
return (
|
|
175
|
-
<IntlayerProvider>
|
|
162
|
+
<IntlayerProvider locale={locale}>
|
|
176
163
|
<Outlet />
|
|
177
164
|
</IntlayerProvider>
|
|
178
165
|
);
|
|
@@ -183,7 +170,7 @@ export default function RootLayout() {
|
|
|
183
170
|
|
|
184
171
|
Çevirileri depolamak için içerik bildirimlerinizi oluşturun ve yönetin:
|
|
185
172
|
|
|
186
|
-
```tsx fileName="app/routes/[lang]/page.content.ts"
|
|
173
|
+
```tsx fileName="app/routes/[lang]/page.content.ts"
|
|
187
174
|
import { t, type Dictionary } from "intlayer";
|
|
188
175
|
|
|
189
176
|
const pageContent = {
|
|
@@ -191,19 +178,23 @@ const pageContent = {
|
|
|
191
178
|
content: {
|
|
192
179
|
title: t({
|
|
193
180
|
en: "Welcome to React Router v7 + Intlayer",
|
|
194
|
-
|
|
181
|
+
es: "Bienvenido a React Router v7 + Intlayer",
|
|
182
|
+
fr: "Bienvenue sur React Router v7 + Intlayer",
|
|
195
183
|
}),
|
|
196
184
|
description: t({
|
|
197
185
|
en: "Build multilingual applications with ease using React Router v7 and Intlayer.",
|
|
198
|
-
|
|
186
|
+
es: "Cree aplicaciones multilingües fácilmente usando React Router v7 y Intlayer.",
|
|
187
|
+
fr: "Créez des applications multilingues facilement avec React Router v7 et Intlayer.",
|
|
199
188
|
}),
|
|
200
189
|
aboutLink: t({
|
|
201
|
-
en: "
|
|
202
|
-
|
|
190
|
+
en: "Hakkımızda Öğrenin",
|
|
191
|
+
es: "Aprender Sobre Nosotros",
|
|
192
|
+
fr: "En savoir plus sur nous",
|
|
203
193
|
}),
|
|
204
194
|
homeLink: t({
|
|
205
|
-
en: "
|
|
206
|
-
|
|
195
|
+
en: "Ana Sayfa",
|
|
196
|
+
es: "Inicio",
|
|
197
|
+
fr: "Accueil",
|
|
207
198
|
}),
|
|
208
199
|
},
|
|
209
200
|
} satisfies Dictionary;
|
|
@@ -211,163 +202,165 @@ const pageContent = {
|
|
|
211
202
|
export default pageContent;
|
|
212
203
|
```
|
|
213
204
|
|
|
214
|
-
> İçerik bildirimleriniz, `contentDir` dizinine dahil edildiği sürece
|
|
215
|
-
|
|
216
|
-
> Daha fazla detay için [içerik bildirim dokümantasyonuna](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md) bakın.
|
|
205
|
+
> İçerik bildirimleriniz, uygulamanızda `contentDir` dizinine (varsayılan olarak `./app`) dahil edildiği sürece herhangi bir yerde tanımlanabilir. Ve içerik bildirim dosya uzantısıyla eşleşmelidir (varsayılan olarak `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
|
|
217
206
|
|
|
218
|
-
|
|
207
|
+
> Daha fazla detay için [içerik bildirim dokümantasyonuna](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/dictionary/get_started.md) bakınız.
|
|
219
208
|
|
|
220
|
-
|
|
209
|
+
### Adım 7: Yerel Duyarlı Bileşenler Oluşturun
|
|
221
210
|
|
|
222
|
-
|
|
223
|
-
// app/components/localized-link.tsx
|
|
224
|
-
import { getLocalizedUrl } from "intlayer";
|
|
225
|
-
import { useLocale } from "react-intlayer";
|
|
226
|
-
import React from "react";
|
|
227
|
-
import { Link, useLocation } from "react-router";
|
|
211
|
+
Yerel duyarlı gezinme için bir `LocalizedLink` bileşeni oluşturun:
|
|
228
212
|
|
|
229
|
-
|
|
213
|
+
```tsx fileName="app/components/localized-link.tsx"
|
|
214
|
+
import type { FC } from "react";
|
|
230
215
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
216
|
+
import { getLocalizedUrl, type LocalesValues } from "intlayer";
|
|
217
|
+
import { useLocale } from "react-intlayer";
|
|
218
|
+
import { Link, type LinkProps, type To } from "react-router";
|
|
234
219
|
|
|
235
|
-
|
|
236
|
-
/^([a-z][a-z0-9+.-]*:)?\/\//i.test(path) || path.startsWith("mailto:");
|
|
220
|
+
const isExternalLink = (to: string) => /^(https?:)?\/\//.test(to);
|
|
237
221
|
|
|
222
|
+
// Belirtilen locale göre URL'yi yerelleştirir
|
|
223
|
+
export const locacalizeTo = (to: To, locale: LocalesValues): To => {
|
|
238
224
|
if (typeof to === "string") {
|
|
239
|
-
if (
|
|
240
|
-
return
|
|
225
|
+
if (isExternalLink(to)) {
|
|
226
|
+
return to;
|
|
241
227
|
}
|
|
242
|
-
|
|
228
|
+
|
|
229
|
+
return getLocalizedUrl(to, locale);
|
|
243
230
|
}
|
|
244
231
|
|
|
245
|
-
if (to
|
|
246
|
-
|
|
247
|
-
if (pathname && pathname.startsWith("/") && !isExternal(pathname)) {
|
|
248
|
-
return (
|
|
249
|
-
<Link
|
|
250
|
-
to={{ ...to, pathname: getLocalizedUrl(pathname, locale) }}
|
|
251
|
-
{...props}
|
|
252
|
-
/>
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
return <Link to={to} {...props} />;
|
|
232
|
+
if (isExternalLink(to.pathname ?? "")) {
|
|
233
|
+
return to;
|
|
256
234
|
}
|
|
257
235
|
|
|
258
|
-
return
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
```
|
|
236
|
+
return {
|
|
237
|
+
...to,
|
|
238
|
+
pathname: getLocalizedUrl(to.pathname ?? "", locale),
|
|
239
|
+
};
|
|
240
|
+
};
|
|
266
241
|
|
|
267
|
-
|
|
242
|
+
// Yerelleştirilmiş link bileşeni
|
|
243
|
+
export const LocalizedLink: FC<LinkProps> = (props) => {
|
|
244
|
+
const { locale } = useLocale();
|
|
268
245
|
|
|
269
|
-
|
|
246
|
+
return <Link {...props} to={locacalizeTo(props.to, locale)} />;
|
|
247
|
+
};
|
|
248
|
+
```
|
|
270
249
|
|
|
271
|
-
|
|
250
|
+
Yerelleştirilmiş rotalara gitmek istediğiniz durumlarda, `useLocalizedNavigate` kancasını kullanabilirsiniz:
|
|
272
251
|
|
|
273
|
-
```tsx fileName="app/
|
|
274
|
-
|
|
275
|
-
import {
|
|
276
|
-
import { Navigate } from "react-router";
|
|
252
|
+
```tsx fileName="app/hooks/useLocalizedNavigate.ts"
|
|
253
|
+
import { useLocale } from "intlayer";
|
|
254
|
+
import { type NavigateOptions, type To, useNavigate } from "react-router";
|
|
277
255
|
|
|
278
|
-
|
|
256
|
+
import { locacalizeTo } from "~/components/localized-link";
|
|
257
|
+
|
|
258
|
+
export const useLocalizedNavigate = () => {
|
|
259
|
+
const navigate = useNavigate();
|
|
279
260
|
const { locale } = useLocale();
|
|
280
261
|
|
|
281
|
-
|
|
282
|
-
|
|
262
|
+
const localizedNavigate = (to: To, options?: NavigateOptions) => {
|
|
263
|
+
const localedTo = locacalizeTo(to, locale);
|
|
264
|
+
|
|
265
|
+
navigate(localedTo, options);
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
return localizedNavigate;
|
|
269
|
+
};
|
|
283
270
|
```
|
|
284
271
|
|
|
272
|
+
### Adım 8: Sayfalarınızda Intlayer'ı Kullanın
|
|
273
|
+
|
|
274
|
+
Uygulamanız boyunca içerik sözlüklerinize erişin:
|
|
275
|
+
|
|
285
276
|
#### Yerelleştirilmiş Ana Sayfa
|
|
286
277
|
|
|
287
|
-
```tsx fileName="app/routes/[lang]/page.tsx"
|
|
278
|
+
```tsx fileName="app/routes/[lang]/page.tsx"
|
|
288
279
|
import { useIntlayer } from "react-intlayer";
|
|
289
|
-
import LocalizedLink from "~/components/localized-link";
|
|
280
|
+
import { LocalizedLink } from "~/components/localized-link";
|
|
290
281
|
|
|
291
282
|
export default function Page() {
|
|
292
|
-
const
|
|
283
|
+
const { title, description, aboutLink } = useIntlayer("page");
|
|
293
284
|
|
|
294
285
|
return (
|
|
295
|
-
<div
|
|
296
|
-
<h1>{
|
|
297
|
-
<p>{
|
|
298
|
-
<nav
|
|
299
|
-
<LocalizedLink
|
|
300
|
-
to="/about"
|
|
301
|
-
style={{
|
|
302
|
-
display: "inline-block",
|
|
303
|
-
padding: "0.5rem 1rem",
|
|
304
|
-
backgroundColor: "#007bff",
|
|
305
|
-
color: "white",
|
|
306
|
-
textDecoration: "none",
|
|
307
|
-
borderRadius: "4px",
|
|
308
|
-
}}
|
|
309
|
-
>
|
|
310
|
-
{content.aboutLink}
|
|
311
|
-
</LocalizedLink>
|
|
286
|
+
<div>
|
|
287
|
+
<h1>{title}</h1>
|
|
288
|
+
<p>{description}</p>
|
|
289
|
+
<nav>
|
|
290
|
+
<LocalizedLink to="/about">{aboutLink}</LocalizedLink>
|
|
312
291
|
</nav>
|
|
313
292
|
</div>
|
|
314
293
|
);
|
|
315
294
|
}
|
|
316
295
|
```
|
|
317
296
|
|
|
318
|
-
> `useIntlayer` kancası hakkında daha fazla bilgi edinmek için [
|
|
297
|
+
> `useIntlayer` kancası hakkında daha fazla bilgi edinmek için [belgelere](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/packages/react-intlayer/useIntlayer.md) bakabilirsiniz.
|
|
319
298
|
|
|
320
|
-
### Adım 9:
|
|
299
|
+
### Adım 9: Bir Dil Değiştirici Bileşeni Oluşturun
|
|
321
300
|
|
|
322
301
|
Kullanıcıların dilleri değiştirmesine izin veren bir bileşen oluşturun:
|
|
323
302
|
|
|
324
|
-
```tsx fileName="app/components/locale-switcher.tsx"
|
|
325
|
-
import {
|
|
326
|
-
import { useLocale } from "react-intlayer";
|
|
327
|
-
import { useLocation, useNavigate } from "react-router";
|
|
303
|
+
```tsx fileName="app/components/locale-switcher.tsx"
|
|
304
|
+
import type { FC } from "react";
|
|
328
305
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
306
|
+
import {
|
|
307
|
+
getHTMLTextDir,
|
|
308
|
+
getLocaleName,
|
|
309
|
+
getLocalizedUrl,
|
|
310
|
+
getPathWithoutLocale,
|
|
311
|
+
} from "intlayer";
|
|
312
|
+
import { setLocaleCookie, useIntlayer, useLocale } from "react-intlayer";
|
|
313
|
+
import { Link, useLocation } from "react-router";
|
|
333
314
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
};
|
|
315
|
+
export const LocaleSwitcher: FC = () => {
|
|
316
|
+
const { localeSwitcherLabel } = useIntlayer("locale-switcher");
|
|
317
|
+
const { pathname } = useLocation();
|
|
318
|
+
|
|
319
|
+
const { availableLocales, locale } = useLocale();
|
|
320
|
+
|
|
321
|
+
const pathWithoutLocale = getPathWithoutLocale(pathname);
|
|
342
322
|
|
|
343
323
|
return (
|
|
344
|
-
<
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
324
|
+
<ol>
|
|
325
|
+
{availableLocales.map((localeItem) => (
|
|
326
|
+
<li key={localeItem}>
|
|
327
|
+
<Link
|
|
328
|
+
aria-current={localeItem === locale ? "sayfa" : undefined}
|
|
329
|
+
aria-label={`${localeSwitcherLabel.value} ${getLocaleName(localeItem)}`}
|
|
330
|
+
onClick={() => setLocaleCookie(localeItem)}
|
|
331
|
+
to={getLocalizedUrl(pathWithoutLocale, localeItem)}
|
|
332
|
+
>
|
|
333
|
+
<span>
|
|
334
|
+
{/* Yerel - örn. FR */}
|
|
335
|
+
{localeItem}
|
|
336
|
+
</span>
|
|
337
|
+
<span>
|
|
338
|
+
{/* Dil kendi yerelinde - örn. Français */}
|
|
339
|
+
{getLocaleName(localeItem, locale)}
|
|
340
|
+
</span>
|
|
341
|
+
<span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
|
|
342
|
+
{/* Mevcut yerelde dil - örn. Locales.SPANISH olarak ayarlanmış mevcut yerelle Francés */}
|
|
343
|
+
{getLocaleName(localeItem)}
|
|
344
|
+
</span>
|
|
345
|
+
<span dir="ltr" lang={Locales.ENGLISH}>
|
|
346
|
+
{/* İngilizce dilinde - örn. French */}
|
|
347
|
+
{getLocaleName(localeItem, Locales.ENGLISH)}
|
|
348
|
+
</span>
|
|
349
|
+
</Link>
|
|
350
|
+
</li>
|
|
351
|
+
))}
|
|
352
|
+
</ol>
|
|
359
353
|
);
|
|
360
|
-
}
|
|
354
|
+
};
|
|
361
355
|
```
|
|
362
356
|
|
|
363
|
-
> `useLocale`
|
|
357
|
+
> `useLocale` hook'u hakkında daha fazla bilgi edinmek için [belgelere](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/packages/react-intlayer/useLocale.md) bakınız.
|
|
364
358
|
|
|
365
|
-
### Adım 10: HTML
|
|
359
|
+
### Adım 10: HTML Öznitelikleri Yönetimi Ekleme (İsteğe Bağlı)
|
|
366
360
|
|
|
367
|
-
HTML lang ve dir
|
|
361
|
+
HTML lang ve dir özniteliklerini yönetmek için bir hook oluşturun:
|
|
368
362
|
|
|
369
|
-
```tsx fileName="app/hooks/useI18nHTMLAttributes.tsx"
|
|
370
|
-
// app/hooks/useI18nHTMLAttributes.tsx
|
|
363
|
+
```tsx fileName="app/hooks/useI18nHTMLAttributes.tsx"
|
|
371
364
|
import { getHTMLTextDir } from "intlayer";
|
|
372
365
|
import { useEffect } from "react";
|
|
373
366
|
import { useLocale } from "react-intlayer";
|
|
@@ -384,15 +377,14 @@ export const useI18nHTMLAttributes = () => {
|
|
|
384
377
|
|
|
385
378
|
Ardından kök bileşeninizde kullanın:
|
|
386
379
|
|
|
387
|
-
```tsx fileName="app/
|
|
388
|
-
// app/routes/layout.tsx
|
|
380
|
+
```tsx fileName="app/routes/layout.tsx"
|
|
389
381
|
import { Outlet } from "react-router";
|
|
390
382
|
import { IntlayerProvider } from "react-intlayer";
|
|
391
383
|
|
|
392
|
-
import { useI18nHTMLAttributes } from "app/hooks/useI18nHTMLAttributes"; //
|
|
384
|
+
import { useI18nHTMLAttributes } from "app/hooks/useI18nHTMLAttributes"; // hook'u içe aktar
|
|
393
385
|
|
|
394
386
|
export default function RootLayout() {
|
|
395
|
-
useI18nHTMLAttributes(); //
|
|
387
|
+
useI18nHTMLAttributes(); // hook'u çağır
|
|
396
388
|
|
|
397
389
|
return (
|
|
398
390
|
<IntlayerProvider>
|
|
@@ -402,114 +394,76 @@ export default function RootLayout() {
|
|
|
402
394
|
}
|
|
403
395
|
```
|
|
404
396
|
|
|
405
|
-
### Adım 11:
|
|
406
|
-
|
|
407
|
-
İçerik sözlüklerini oluşturun ve uygulamanızı çalıştırın:
|
|
397
|
+
### Adım 11: Middleware ekleyin (İsteğe bağlı)
|
|
408
398
|
|
|
409
|
-
|
|
410
|
-
# Intlayer sözlüklerini oluşturun
|
|
411
|
-
npm run intlayer:build
|
|
399
|
+
Ayrıca uygulamanıza sunucu tarafı yönlendirme eklemek için `intlayerMiddleware` kullanabilirsiniz. Bu eklenti, URL'ye göre geçerli yerel ayarı otomatik olarak algılar ve uygun yerel ayar çerezini ayarlar. Hiçbir yerel ayar belirtilmemişse, eklenti kullanıcının tarayıcı dil tercihlerine göre en uygun yerel ayarı belirler. Hiçbir yerel ayar algılanmazsa, varsayılan yerel ayara yönlendirme yapar.
|
|
412
400
|
|
|
413
|
-
|
|
414
|
-
npm run dev
|
|
415
|
-
```
|
|
401
|
+
> Üretimde `intlayerMiddleware` kullanmak için, `vite-intlayer` paketini `devDependencies`'den `dependencies`'e geçirmeniz gerektiğini unutmayın.
|
|
416
402
|
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
|
|
403
|
+
```typescript {3,7} fileName="vite.config.ts"
|
|
404
|
+
import { defineConfig } from "vite";
|
|
405
|
+
import react from "@vitejs/plugin-react-swc";
|
|
406
|
+
import { intlayer, intlayerMiddleware } from "vite-intlayer";
|
|
420
407
|
|
|
421
|
-
|
|
422
|
-
|
|
408
|
+
// https://vitejs.dev/config/
|
|
409
|
+
export default defineConfig({
|
|
410
|
+
plugins: [react(), intlayer(), intlayerMiddleware()],
|
|
411
|
+
});
|
|
423
412
|
```
|
|
424
413
|
|
|
425
|
-
|
|
426
|
-
# Intlayer sözlüklerini oluşturun
|
|
427
|
-
yarn intlayer:build
|
|
428
|
-
|
|
429
|
-
# Geliştirme sunucusunu başlatın
|
|
430
|
-
yarn dev
|
|
431
|
-
```
|
|
414
|
+
---
|
|
432
415
|
|
|
433
|
-
|
|
416
|
+
## TypeScript'i Yapılandırma
|
|
434
417
|
|
|
435
|
-
Intlayer, TypeScript'
|
|
418
|
+
Intlayer, TypeScript'in avantajlarından yararlanmak ve kod tabanınızı daha güçlü hale getirmek için modül genişletme (module augmentation) kullanır.
|
|
436
419
|
|
|
437
|
-
TypeScript yapılandırmanızın otomatik
|
|
420
|
+
TypeScript yapılandırmanızın otomatik oluşturulan türleri içerdiğinden emin olun:
|
|
438
421
|
|
|
439
422
|
```json5 fileName="tsconfig.json"
|
|
440
423
|
{
|
|
441
|
-
|
|
442
|
-
// ... mevcut TypeScript yapılandırmalarınız
|
|
443
|
-
},
|
|
424
|
+
// ... mevcut yapılandırmalarınız
|
|
444
425
|
include: [
|
|
445
426
|
// ... mevcut dahil ettikleriniz
|
|
446
|
-
".intlayer/**/*.ts", // Otomatik
|
|
427
|
+
".intlayer/**/*.ts", // Otomatik oluşturulan türleri dahil et
|
|
447
428
|
],
|
|
448
429
|
}
|
|
449
430
|
```
|
|
450
431
|
|
|
451
|
-
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## Git Yapılandırması
|
|
452
435
|
|
|
453
|
-
Intlayer tarafından oluşturulan
|
|
436
|
+
Intlayer tarafından oluşturulan dosyaların göz ardı edilmesi önerilir. Bu, bu dosyaların Git deposuna eklenmesini önlemenizi sağlar.
|
|
454
437
|
|
|
455
|
-
Bunu yapmak için
|
|
438
|
+
Bunu yapmak için `.gitignore` dosyanıza aşağıdaki talimatları ekleyebilirsiniz:
|
|
456
439
|
|
|
457
440
|
```plaintext fileName=".gitignore"
|
|
458
|
-
# Intlayer tarafından oluşturulan dosyaları
|
|
441
|
+
# Intlayer tarafından oluşturulan dosyaları göz ardı et
|
|
459
442
|
.intlayer
|
|
460
443
|
```
|
|
461
444
|
|
|
462
445
|
---
|
|
463
446
|
|
|
464
|
-
##
|
|
465
|
-
|
|
466
|
-
Uygulamanızı dağıtırken:
|
|
467
|
-
|
|
468
|
-
1. **Uygulamanızı oluşturun:**
|
|
469
|
-
|
|
470
|
-
```bash
|
|
471
|
-
npm run build
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
2. **Intlayer sözlüklerini oluşturun:**
|
|
475
|
-
|
|
476
|
-
```bash
|
|
477
|
-
npm run intlayer:build
|
|
478
|
-
```
|
|
479
|
-
|
|
480
|
-
3. **Üretimde middleware kullanıyorsanız `vite-intlayer`'ı bağımlılıklara taşıyın:**
|
|
481
|
-
```bash
|
|
482
|
-
npm install vite-intlayer --save
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
Uygulamanız artık şunları destekleyecek:
|
|
486
|
-
|
|
487
|
-
- **URL Yapısı**: `/en`, `/en/about`, `/tr`, `/tr/about`
|
|
488
|
-
- **Tarayıcı tercihlerine göre otomatik yerel ayar algılama**
|
|
489
|
-
- **React Router v7 ile yerel ayar bilincine sahip yönlendirme**
|
|
490
|
-
- **Otomatik olarak oluşturulan türlerle TypeScript desteği**
|
|
491
|
-
- **Uygun yerel ayar yönetimi ile sunucu tarafı işleme**
|
|
492
|
-
|
|
493
|
-
## VS Code Uzantısı
|
|
447
|
+
## VS Code Eklentisi
|
|
494
448
|
|
|
495
|
-
Intlayer ile geliştirme deneyiminizi
|
|
449
|
+
Intlayer ile geliştirme deneyiminizi iyileştirmek için resmi **Intlayer VS Code Eklentisi**ni yükleyebilirsiniz.
|
|
496
450
|
|
|
497
|
-
[VS Code Marketplace'ten
|
|
451
|
+
[VS Code Marketplace'ten Yükleyin](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
498
452
|
|
|
499
|
-
Bu
|
|
453
|
+
Bu eklenti şunları sağlar:
|
|
500
454
|
|
|
501
|
-
-
|
|
502
|
-
-
|
|
503
|
-
-
|
|
504
|
-
-
|
|
455
|
+
- Çeviri anahtarları için **Otomatik Tamamlama**.
|
|
456
|
+
- Eksik çeviriler için **Gerçek Zamanlı Hata Tespiti**.
|
|
457
|
+
- Çevrilmiş içeriğin **Satır İçi Önizlemeleri**.
|
|
458
|
+
- Çevirileri kolayca oluşturup güncellemek için **Hızlı İşlemler**.
|
|
505
459
|
|
|
506
|
-
|
|
460
|
+
Eklentinin nasıl kullanılacağı hakkında daha fazla bilgi için [Intlayer VS Code Eklentisi dokümantasyonuna](https://intlayer.org/doc/vs-code-extension) bakabilirsiniz.
|
|
507
461
|
|
|
508
462
|
---
|
|
509
463
|
|
|
510
|
-
## Daha
|
|
464
|
+
## Daha İleri Gitmek İçin
|
|
511
465
|
|
|
512
|
-
Daha
|
|
466
|
+
Daha ileri gitmek için, [görsel editörü](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/intlayer_visual_editor.md) uygulayabilir veya içeriğinizi [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/intlayer_CMS.md) kullanarak dışa aktarabilirsiniz.
|
|
513
467
|
|
|
514
468
|
---
|
|
515
469
|
|
|
@@ -517,15 +471,16 @@ Daha fazla ilerlemek için, [görsel düzenleyiciyi](https://github.com/aymericz
|
|
|
517
471
|
|
|
518
472
|
- [Intlayer Dokümantasyonu](https://intlayer.org)
|
|
519
473
|
- [React Router v7 Dokümantasyonu](https://reactrouter.com/)
|
|
520
|
-
- [useIntlayer
|
|
521
|
-
- [useLocale
|
|
522
|
-
- [İçerik
|
|
523
|
-
- [Yapılandırma](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
474
|
+
- [useIntlayer hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/packages/react-intlayer/useIntlayer.md)
|
|
475
|
+
- [useLocale hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/packages/react-intlayer/useLocale.md)
|
|
476
|
+
- [İçerik Beyanı](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/dictionary/get_started.md)
|
|
477
|
+
- [Yapılandırma](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/configuration.md)
|
|
524
478
|
|
|
525
|
-
Bu kapsamlı
|
|
479
|
+
Bu kapsamlı rehber, Intlayer'ı React Router v7 ile tam uluslararasılaştırılmış, yerel farkındalıklı yönlendirme ve TypeScript desteği olan bir uygulama için entegre etmeniz gereken her şeyi sağlar.
|
|
526
480
|
|
|
527
|
-
##
|
|
481
|
+
## Doküman Geçmişi
|
|
528
482
|
|
|
529
|
-
| Sürüm | Tarih
|
|
530
|
-
| ----- |
|
|
531
|
-
|
|
|
483
|
+
| Sürüm | Tarih | Değişiklikler |
|
|
484
|
+
| ----- | ---------- | ---------------------------- |
|
|
485
|
+
| 6.1.5 | 2025-10-03 | Doküman güncellendi |
|
|
486
|
+
| 5.8.2 | 2025-09-04 | React Router v7 için eklendi |
|