@intlayer/docs 7.3.10 → 7.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/generated/docs.entry.cjs +19 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +19 -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_nuxt.md +305 -421
- package/docs/ar/intlayer_with_react_router_v7.md +33 -4
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +516 -0
- package/docs/ar/intlayer_with_tanstack.md +2 -12
- package/docs/ar/intlayer_with_vite+vue.md +1 -0
- package/docs/de/intlayer_with_nuxt.md +296 -394
- package/docs/de/intlayer_with_react_router_v7.md +33 -4
- package/docs/de/intlayer_with_react_router_v7_fs_routes.md +573 -0
- package/docs/de/intlayer_with_tanstack.md +1 -0
- package/docs/de/intlayer_with_vite+vue.md +1 -0
- package/docs/en/intlayer_with_nuxt.md +242 -321
- package/docs/en/intlayer_with_react_router_v7.md +24 -0
- package/docs/en/intlayer_with_react_router_v7_fs_routes.md +570 -0
- package/docs/en/intlayer_with_tanstack.md +2 -12
- package/docs/en/intlayer_with_vite+vue.md +49 -48
- package/docs/en-GB/intlayer_with_nuxt.md +262 -358
- package/docs/en-GB/intlayer_with_react_router_v7.md +33 -4
- package/docs/en-GB/intlayer_with_react_router_v7_fs_routes.md +513 -0
- package/docs/en-GB/intlayer_with_tanstack.md +2 -12
- package/docs/en-GB/intlayer_with_vite+vue.md +1 -0
- package/docs/es/intlayer_with_nuxt.md +284 -375
- package/docs/es/intlayer_with_react_router_v7.md +33 -4
- package/docs/es/intlayer_with_react_router_v7_fs_routes.md +575 -0
- package/docs/es/intlayer_with_tanstack.md +1 -0
- package/docs/es/intlayer_with_vite+vue.md +1 -2
- package/docs/fr/intlayer_with_nuxt.md +288 -387
- package/docs/fr/intlayer_with_react_router_v7.md +34 -5
- package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/fr/intlayer_with_tanstack.md +1 -0
- package/docs/fr/intlayer_with_vite+vue.md +1 -0
- package/docs/hi/intlayer_with_nuxt.md +318 -434
- package/docs/hi/intlayer_with_react_router_v7.md +33 -4
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +518 -0
- package/docs/hi/intlayer_with_tanstack.md +2 -12
- package/docs/hi/intlayer_with_vite+vue.md +1 -0
- package/docs/id/intlayer_with_nuxt.md +275 -376
- package/docs/id/intlayer_with_react_router_v7.md +29 -4
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +521 -0
- package/docs/id/intlayer_with_tanstack.md +2 -12
- package/docs/id/intlayer_with_vite+vue.md +1 -0
- package/docs/it/intlayer_with_nuxt.md +312 -408
- package/docs/it/intlayer_with_react_router_v7.md +33 -4
- package/docs/it/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/it/intlayer_with_tanstack.md +1 -0
- package/docs/ja/intlayer_with_nuxt.md +319 -414
- package/docs/ja/intlayer_with_react_router_v7.md +33 -4
- package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/ja/intlayer_with_tanstack.md +2 -12
- package/docs/ja/intlayer_with_vite+vue.md +1 -0
- package/docs/ko/intlayer_with_nuxt.md +307 -406
- package/docs/ko/intlayer_with_react_router_v7.md +33 -4
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +515 -0
- package/docs/ko/intlayer_with_tanstack.md +2 -12
- package/docs/ko/intlayer_with_vite+vue.md +1 -0
- package/docs/pl/intlayer_with_nuxt.md +282 -457
- package/docs/pl/intlayer_with_react_router_v7.md +32 -5
- package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +615 -0
- package/docs/pl/intlayer_with_tanstack.md +2 -12
- package/docs/pl/intlayer_with_vite+vue.md +1 -0
- package/docs/pt/intlayer_with_nuxt.md +288 -403
- package/docs/pt/intlayer_with_react_router_v7.md +28 -0
- package/docs/pt/intlayer_with_tanstack.md +1 -0
- package/docs/ru/intlayer_with_nuxt.md +300 -410
- package/docs/ru/intlayer_with_react_router_v7.md +33 -4
- package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/ru/intlayer_with_tanstack.md +1 -0
- package/docs/ru/intlayer_with_vite+vue.md +1 -0
- package/docs/tr/intlayer_with_nuxt.md +327 -392
- package/docs/tr/intlayer_with_react_router_v7.md +33 -4
- package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +572 -0
- package/docs/tr/intlayer_with_tanstack.md +2 -12
- package/docs/tr/intlayer_with_vite+vue.md +1 -0
- package/docs/vi/intlayer_with_nuxt.md +282 -399
- package/docs/vi/intlayer_with_react_router_v7.md +29 -4
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +523 -0
- package/docs/vi/intlayer_with_tanstack.md +2 -12
- package/docs/vi/intlayer_with_vite+vue.md +1 -0
- package/docs/zh/intlayer_with_nuxt.md +311 -444
- package/docs/zh/intlayer_with_react_router_v7.md +33 -4
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +516 -0
- package/docs/zh/intlayer_with_tanstack.md +2 -12
- package/docs/zh/intlayer_with_vite+vue.md +1 -0
- package/package.json +6 -6
- package/src/generated/docs.entry.ts +19 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt: 2025-
|
|
3
|
-
updatedAt: 2025-
|
|
4
|
-
title: Nuxt
|
|
5
|
-
description: Nuxt ve Vue web sitenizi çok dilli hale
|
|
2
|
+
createdAt: 2025-06-18
|
|
3
|
+
updatedAt: 2025-12-07
|
|
4
|
+
title: Nuxt ve Vue uygulamanızı nasıl çevirirsiniz – i18n rehberi 2025
|
|
5
|
+
description: Nuxt ve Vue web sitenizi çok dilli hale nasıl getireceğinizi keşfedin. Uluslararasılaştırma (i18n) ve çeviri için dokümantasyonu takip edin.
|
|
6
6
|
keywords:
|
|
7
7
|
- Uluslararasılaştırma
|
|
8
8
|
- Dokümantasyon
|
|
@@ -14,16 +14,22 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- nuxt-and-vue
|
|
17
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-nuxt-template
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-nuxt-4-template
|
|
18
|
+
youtubeVideo: https://www.youtube.com/watch?v=IE3XWkZ6a5U
|
|
18
19
|
history:
|
|
20
|
+
- version: 7.3.11
|
|
21
|
+
date: 2025-12-07
|
|
22
|
+
changes: LocaleSwitcher, SEO, metadata güncellendi
|
|
19
23
|
- version: 5.5.10
|
|
20
24
|
date: 2025-06-29
|
|
21
|
-
changes:
|
|
25
|
+
changes: Geçmiş başlatıldı
|
|
22
26
|
---
|
|
23
27
|
|
|
24
|
-
# Intlayer
|
|
28
|
+
# Intlayer kullanarak Nuxt ve Vue web sitenizi çevirin | Uluslararasılaştırma (i18n)
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
## İçindekiler
|
|
31
|
+
|
|
32
|
+
<TOC/>
|
|
27
33
|
|
|
28
34
|
## Intlayer Nedir?
|
|
29
35
|
|
|
@@ -31,18 +37,47 @@ GitHub'da [Uygulama Şablonu](https://github.com/aymericzip/intlayer-nuxt-templa
|
|
|
31
37
|
|
|
32
38
|
Intlayer ile şunları yapabilirsiniz:
|
|
33
39
|
|
|
34
|
-
- **Bileşen
|
|
35
|
-
- **Meta verileri, rotaları ve içeriği dinamik olarak yerelleştirin
|
|
36
|
-
- **Otomatik tamamlama ve hata
|
|
37
|
-
- **Dinamik
|
|
40
|
+
- **Bileşen seviyesinde deklaratif sözlükler kullanarak çevirileri kolayca yönetin.**
|
|
41
|
+
- **Meta verileri, rotaları ve içeriği dinamik olarak yerelleştirin.**
|
|
42
|
+
- **Otomatik oluşturulan tiplerle TypeScript desteğini sağlayarak otomatik tamamlama ve hata tespitini geliştirin.**
|
|
43
|
+
- **Dinamik dil algılama ve değiştirme gibi gelişmiş özelliklerden faydalanın.**
|
|
38
44
|
|
|
39
45
|
---
|
|
40
46
|
|
|
41
|
-
## Nuxt Uygulamasında Intlayer Kurulumu Adım Adım
|
|
47
|
+
## Nuxt Uygulamasında Intlayer Kurulumu Adım Adım Rehber
|
|
48
|
+
|
|
49
|
+
<iframe
|
|
50
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-nuxt-4-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
51
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
52
|
+
title="Demo CodeSandbox - Intlayer kullanarak uygulamanızı nasıl uluslararasılaştırırsınız"
|
|
53
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
54
|
+
loading="lazy"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
### Adım 1: Bağımlılıkları Yükleyin
|
|
58
|
+
|
|
59
|
+
<Tab defaultTab="video">
|
|
60
|
+
<TabItem label="Video" value="video">
|
|
61
|
+
|
|
62
|
+
<iframe title="Nuxt ve Vue uygulamanızı Intlayer kullanarak nasıl çevirirsiniz? Intlayer'ı keşfedin" class="m-auto aspect-[16/9] w-full overflow-hidden rounded-lg border-0" allow="autoplay; gyroscope;" loading="lazy" width="1080" height="auto" src="https://www.youtube.com/embed/IE3XWkZ6a5U?autoplay=0&origin=http://intlayer.org&controls=0&rel=1"/>
|
|
63
|
+
|
|
64
|
+
</TabItem>
|
|
65
|
+
<TabItem label="Kod" value="code">
|
|
66
|
+
|
|
67
|
+
<iframe
|
|
68
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-nuxt-4-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
69
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
70
|
+
title="Demo CodeSandbox - Intlayer kullanarak uygulamanızı nasıl uluslararasılaştırırsınız"
|
|
71
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
72
|
+
loading="lazy"
|
|
73
|
+
/>
|
|
42
74
|
|
|
43
|
-
|
|
75
|
+
</TabItem>
|
|
76
|
+
</Tab>
|
|
44
77
|
|
|
45
|
-
|
|
78
|
+
GitHub'da [Uygulama Şablonunu](https://github.com/aymericzip/intlayer-nuxt-4-template) inceleyin.
|
|
79
|
+
|
|
80
|
+
Gerekli paketleri npm kullanarak yükleyin:
|
|
46
81
|
|
|
47
82
|
```bash packageManager="npm"
|
|
48
83
|
npm install intlayer vue-intlayer
|
|
@@ -61,17 +96,17 @@ yarn add --save-dev nuxt-intlayer
|
|
|
61
96
|
|
|
62
97
|
- **intlayer**
|
|
63
98
|
|
|
64
|
-
|
|
99
|
+
Konfigürasyon yönetimi, çeviri, [içerik beyanı](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/dictionary/content_file.md), transpile etme ve [CLI komutları](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/cli/index.md) için uluslararasılaştırma araçları sağlayan temel paket.
|
|
65
100
|
|
|
66
101
|
- **vue-intlayer**
|
|
67
|
-
Intlayer'ı Vue
|
|
102
|
+
Intlayer'ı Vue uygulamasıyla entegre eden paket. Vue bileşenleri için composables sağlar.
|
|
68
103
|
|
|
69
104
|
- **nuxt-intlayer**
|
|
70
|
-
Intlayer'ı
|
|
105
|
+
Nuxt uygulamalarıyla Intlayer'ı entegre eden Nuxt modülü. Otomatik kurulum, yerel algılama için middleware, çerez yönetimi ve URL yönlendirmesi sağlar.
|
|
71
106
|
|
|
72
|
-
### Adım 2:
|
|
107
|
+
### Adım 2: Projenizin yapılandırması
|
|
73
108
|
|
|
74
|
-
Uygulamanızın dillerini yapılandırmak için bir
|
|
109
|
+
Uygulamanızın dillerini yapılandırmak için bir konfigürasyon dosyası oluşturun:
|
|
75
110
|
|
|
76
111
|
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
77
112
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
@@ -82,13 +117,10 @@ const config: IntlayerConfig = {
|
|
|
82
117
|
Locales.ENGLISH,
|
|
83
118
|
Locales.FRENCH,
|
|
84
119
|
Locales.SPANISH,
|
|
85
|
-
// Diğer
|
|
120
|
+
// Diğer dilleriniz
|
|
86
121
|
],
|
|
87
122
|
defaultLocale: Locales.ENGLISH,
|
|
88
123
|
},
|
|
89
|
-
content: {
|
|
90
|
-
contentDir: ["."], // Çünkü varsayılan olarak Intayer, içerik bildirim dosyalarını `./src` dizininden izleyecek
|
|
91
|
-
},
|
|
92
124
|
};
|
|
93
125
|
|
|
94
126
|
export default config;
|
|
@@ -104,13 +136,10 @@ const config = {
|
|
|
104
136
|
Locales.ENGLISH,
|
|
105
137
|
Locales.FRENCH,
|
|
106
138
|
Locales.SPANISH,
|
|
107
|
-
// Diğer
|
|
139
|
+
// Diğer dilleriniz
|
|
108
140
|
],
|
|
109
141
|
defaultLocale: Locales.ENGLISH,
|
|
110
142
|
},
|
|
111
|
-
content: {
|
|
112
|
-
contentDir: ["."],
|
|
113
|
-
},
|
|
114
143
|
};
|
|
115
144
|
|
|
116
145
|
export default config;
|
|
@@ -126,21 +155,18 @@ const config = {
|
|
|
126
155
|
Locales.ENGLISH,
|
|
127
156
|
Locales.FRENCH,
|
|
128
157
|
Locales.SPANISH,
|
|
129
|
-
// Diğer
|
|
158
|
+
// Diğer dilleriniz
|
|
130
159
|
],
|
|
131
160
|
defaultLocale: Locales.ENGLISH,
|
|
132
161
|
},
|
|
133
|
-
content: {
|
|
134
|
-
contentDir: ["."],
|
|
135
|
-
},
|
|
136
162
|
};
|
|
137
163
|
|
|
138
164
|
module.exports = config;
|
|
139
165
|
```
|
|
140
166
|
|
|
141
|
-
> Bu yapılandırma dosyası aracılığıyla, yerelleştirilmiş URL'
|
|
167
|
+
> Bu yapılandırma dosyası aracılığıyla, yerelleştirilmiş URL'leri, middleware yönlendirmesini, çerez isimlerini, içerik bildirimlerinizin konumunu ve uzantısını ayarlayabilir, Intlayer loglarını 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.
|
|
142
168
|
|
|
143
|
-
### Adım 3:
|
|
169
|
+
### Adım 3: Intlayer'ı Nuxt Yapılandırmanıza Entegre Edin
|
|
144
170
|
|
|
145
171
|
Intlayer modülünü Nuxt yapılandırmanıza ekleyin:
|
|
146
172
|
|
|
@@ -153,203 +179,46 @@ export default defineNuxtConfig({
|
|
|
153
179
|
});
|
|
154
180
|
```
|
|
155
181
|
|
|
156
|
-
> `nuxt-intlayer` modülü, Intlayer'ın Nuxt ile entegrasyonunu otomatik olarak yönetir. İçerik
|
|
182
|
+
> `nuxt-intlayer` modülü, Intlayer'ın Nuxt ile entegrasyonunu otomatik olarak yönetir. İçerik bildirimlerinin oluşturulmasını ayarlar, geliştirme modunda dosyaları izler, yerel tespit için middleware sağlar ve yerelleştirilmiş yönlendirmeyi yönetir.
|
|
157
183
|
|
|
158
184
|
### Adım 4: İçeriğinizi Bildirin
|
|
159
185
|
|
|
160
186
|
Çevirileri depolamak için içerik bildirimlerinizi oluşturun ve yönetin:
|
|
161
187
|
|
|
162
|
-
```tsx fileName="
|
|
163
|
-
import {
|
|
188
|
+
```tsx fileName="content/home-page.content.ts" contentDeclarationFormat="typescript"
|
|
189
|
+
import { type Dictionary, t } from "intlayer";
|
|
164
190
|
|
|
165
|
-
const
|
|
166
|
-
key: "
|
|
191
|
+
const content = {
|
|
192
|
+
key: "home-page",
|
|
167
193
|
content: {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
173
|
-
}),
|
|
174
|
-
checkOut: t({ en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
|
|
175
|
-
nuxtIntlayer: t({
|
|
176
|
-
en: "Nuxt Intlayer documentation",
|
|
177
|
-
fr: "Documentation de Nuxt Intlayer",
|
|
178
|
-
es: "Documentación de Nuxt Intlayer",
|
|
179
|
-
}),
|
|
180
|
-
learnMore: t({
|
|
181
|
-
en: "Learn more about Nuxt in the ",
|
|
182
|
-
fr: "En savoir plus sur Nuxt dans la ",
|
|
183
|
-
es: "Aprenda más sobre Nuxt en la ",
|
|
194
|
+
title: t({
|
|
195
|
+
en: "Hello world",
|
|
196
|
+
fr: "Bonjour le monde",
|
|
197
|
+
es: "Hola mundo",
|
|
184
198
|
}),
|
|
185
|
-
|
|
186
|
-
en: "
|
|
187
|
-
fr: "
|
|
188
|
-
es: "
|
|
199
|
+
metaTitle: t({
|
|
200
|
+
en: "Welcome | My Application",
|
|
201
|
+
fr: "Bienvenue | Mon Application",
|
|
202
|
+
es: "Bienvenido | Mi Aplicación",
|
|
189
203
|
}),
|
|
190
|
-
|
|
191
|
-
en: "
|
|
192
|
-
fr: "
|
|
193
|
-
es: "
|
|
204
|
+
metaDescription: t({
|
|
205
|
+
en: "Discover your multilingual Nuxt app homepage powered by Intlayer.",
|
|
206
|
+
fr: "Découvrez la page d'accueil multilingue de votre application Nuxt propulsée par Intlayer.",
|
|
207
|
+
es: "Descubre la página de inicio multilingüe de tu aplicación Nuxt impulsada por Intlayer.",
|
|
194
208
|
}),
|
|
195
209
|
},
|
|
196
210
|
} satisfies Dictionary;
|
|
197
211
|
|
|
198
|
-
export default
|
|
212
|
+
export default content;
|
|
199
213
|
```
|
|
200
214
|
|
|
201
|
-
|
|
202
|
-
import { t } from "intlayer";
|
|
203
|
-
|
|
204
|
-
/** @type {import('intlayer').Dictionary} */
|
|
205
|
-
const helloWorldContent = {
|
|
206
|
-
key: "helloworld",
|
|
207
|
-
content: {
|
|
208
|
-
count: t({ en: "count is ", fr: "le compte est ", es: "el recuento es " }),
|
|
209
|
-
edit: t({
|
|
210
|
-
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
211
|
-
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
212
|
-
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
213
|
-
}),
|
|
214
|
-
checkOut: t({ en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
|
|
215
|
-
nuxtIntlayer: t({
|
|
216
|
-
en: "Nuxt Intlayer documentation",
|
|
217
|
-
fr: "Documentation de Nuxt Intlayer",
|
|
218
|
-
es: "Documentación de Nuxt Intlayer",
|
|
219
|
-
}),
|
|
220
|
-
learnMore: t({
|
|
221
|
-
en: "Learn more about Nuxt in the ",
|
|
222
|
-
fr: "En savoir plus sur Nuxt dans la ",
|
|
223
|
-
es: "Aprenda más sobre Nuxt en la ",
|
|
224
|
-
}),
|
|
225
|
-
nuxtDocs: t({
|
|
226
|
-
en: "Nuxt Documentation",
|
|
227
|
-
fr: "Documentation Nuxt",
|
|
228
|
-
es: "Documentación de Nuxt",
|
|
229
|
-
}),
|
|
230
|
-
readTheDocs: t({
|
|
231
|
-
en: "Click on the Nuxt logo to learn more",
|
|
232
|
-
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
233
|
-
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
234
|
-
}),
|
|
235
|
-
},
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
export default helloWorldContent;
|
|
239
|
-
```
|
|
215
|
+
> İçerik bildirimleriniz, uygulamanızın herhangi bir yerinde tanımlanabilir, yeter ki `contentDir` dizini içinde yer alsın (varsayılan olarak `./src`). Ve içerik bildirim dosya uzantısıyla eşleşsin (varsayılan olarak `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
|
|
240
216
|
|
|
241
|
-
|
|
242
|
-
const { t } = require("intlayer");
|
|
217
|
+
> Daha fazla detay için [içerik bildirim dokümantasyonuna](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/dictionary/content_file.md) bakınız.
|
|
243
218
|
|
|
244
|
-
|
|
245
|
-
const helloWorldContent = {
|
|
246
|
-
key: "helloworld",
|
|
247
|
-
content: {
|
|
248
|
-
count: t({ en: "count is ", fr: "le compte est ", es: "el recuento es " }),
|
|
249
|
-
edit: t({
|
|
250
|
-
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
251
|
-
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
252
|
-
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
253
|
-
}),
|
|
254
|
-
checkOut: t({ en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
|
|
255
|
-
nuxtIntlayer: t({
|
|
256
|
-
en: "Nuxt Intlayer documentation",
|
|
257
|
-
fr: "Documentation de Nuxt Intlayer",
|
|
258
|
-
es: "Documentación de Nuxt Intlayer",
|
|
259
|
-
}),
|
|
260
|
-
learnMore: t({
|
|
261
|
-
en: "Learn more about Nuxt in the ",
|
|
262
|
-
fr: "En savoir plus sur Nuxt dans la ",
|
|
263
|
-
es: "Aprenda más sobre Nuxt en la ",
|
|
264
|
-
}),
|
|
265
|
-
nuxtDocs: t({
|
|
266
|
-
en: "Nuxt Documentation",
|
|
267
|
-
fr: "Documentation Nuxt",
|
|
268
|
-
es: "Documentación de Nuxt",
|
|
269
|
-
}),
|
|
270
|
-
readTheDocs: t({
|
|
271
|
-
en: "Click on the Nuxt logo to learn more",
|
|
272
|
-
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
273
|
-
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
274
|
-
}),
|
|
275
|
-
},
|
|
276
|
-
};
|
|
219
|
+
### Adım 5: Intlayer'ı Kodunuzda Kullanın
|
|
277
220
|
|
|
278
|
-
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
```json fileName="components/helloWorld.content.json" contentDeclarationFormat="json"
|
|
282
|
-
{
|
|
283
|
-
"$schema": "https://intlayer.org/schema.json",
|
|
284
|
-
"key": "helloworld",
|
|
285
|
-
"content": {
|
|
286
|
-
"count": {
|
|
287
|
-
"nodeType": "translation",
|
|
288
|
-
"translation": {
|
|
289
|
-
"en": "count is ",
|
|
290
|
-
"fr": "le compte est ",
|
|
291
|
-
"es": "el recuento es "
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
"edit": {
|
|
295
|
-
"nodeType": "translation",
|
|
296
|
-
"translation": {
|
|
297
|
-
"en": "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
298
|
-
"fr": "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
299
|
-
"es": "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR"
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
"checkOut": {
|
|
303
|
-
"nodeType": "translation",
|
|
304
|
-
"translation": {
|
|
305
|
-
"en": "Check out ",
|
|
306
|
-
"fr": "Vérifiez ",
|
|
307
|
-
"es": "Compruebe "
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
"nuxtIntlayer": {
|
|
311
|
-
"nodeType": "translation",
|
|
312
|
-
"translation": {
|
|
313
|
-
"en": "Nuxt Intlayer documentation",
|
|
314
|
-
"fr": "Documentation de Nuxt Intlayer",
|
|
315
|
-
"es": "Documentación de Nuxt Intlayer"
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
"learnMore": {
|
|
319
|
-
"nodeType": "translation",
|
|
320
|
-
"translation": {
|
|
321
|
-
"en": "Learn more about Nuxt in the ",
|
|
322
|
-
"fr": "En savoir plus sur Nuxt dans la ",
|
|
323
|
-
"es": "Aprenda más sobre Nuxt en la "
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
"nuxtDocs": {
|
|
327
|
-
"nodeType": "translation",
|
|
328
|
-
"translation": {
|
|
329
|
-
"en": "Nuxt Documentation",
|
|
330
|
-
"fr": "Documentation Nuxt",
|
|
331
|
-
"es": "Documentación de Nuxt"
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
"readTheDocs": {
|
|
335
|
-
"nodeType": "translation",
|
|
336
|
-
"translation": {
|
|
337
|
-
"en": "Click on the Nuxt logo to learn more",
|
|
338
|
-
"fr": "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
339
|
-
"es": "Haga clic en el logotipo de Nuxt para obtener más información"
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
> İçerik bildirimleriniz, `contentDir` dizinine dahil edildiği sürece uygulamanızın herhangi bir yerinde tanımlanabilir (varsayılan olarak, `./src`). Ve içerik bildirim dosyası uzantısıyla eşleşmelidir (varsayılan olarak, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
|
|
347
|
-
|
|
348
|
-
> Daha fazla detay için [içerik bildirim dokümantasyonuna](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md) bakın.
|
|
349
|
-
|
|
350
|
-
### Adım 5: Kodunuzda Intlayer'ı Kullanın
|
|
351
|
-
|
|
352
|
-
`useIntlayer` composable'ını kullanarak Nuxt uygulamanız boyunca içerik sözlüklerinize erişin:
|
|
221
|
+
Nuxt uygulamanızın her yerinde içerik sözlüklerinize `useIntlayer` composable'ı ile erişin:
|
|
353
222
|
|
|
354
223
|
```vue fileName="components/HelloWorld.vue"
|
|
355
224
|
<script setup lang="ts">
|
|
@@ -403,81 +272,71 @@ const countRef = ref(0);
|
|
|
403
272
|
Intlayer, içeriğinize erişmek için farklı API'ler sunar:
|
|
404
273
|
|
|
405
274
|
- **Bileşen tabanlı sözdizimi** (önerilen):
|
|
406
|
-
|
|
275
|
+
`<myContent />` veya `<Component :is="myContent" />` sözdizimini kullanarak içeriği bir Intlayer Node olarak render edin. Bu, [Visual Editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/intlayer_visual_editor.md) ve [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/intlayer_CMS.md) ile sorunsuz bir şekilde entegre olur.
|
|
407
276
|
|
|
408
|
-
- **
|
|
409
|
-
|
|
277
|
+
- **Metin tabanlı sözdizimi**:
|
|
278
|
+
İçeriği Visual Editor desteği olmadan düz metin olarak render etmek için `{{ myContent }}` kullanın.
|
|
410
279
|
|
|
411
|
-
- **Ham HTML sözdizimi**:
|
|
412
|
-
|
|
280
|
+
- **Ham HTML sözdizimi**:
|
|
281
|
+
İçeriği Visual Editor desteği olmadan ham HTML olarak render etmek için `<div v-html="myContent" />` kullanın.
|
|
413
282
|
|
|
414
|
-
- **
|
|
415
|
-
`useIntlayer` composable
|
|
416
|
-
- `const content = useIntlayer("myContent");`
|
|
417
|
-
-
|
|
283
|
+
- **Yapı bozma (Destructuration) sözdizimi**:
|
|
284
|
+
`useIntlayer` composable, içerikle birlikte bir Proxy döner. Bu proxy, reaktiviteyi koruyarak içeriğe erişmek için yapı bozma yöntemiyle ayrıştırılabilir.
|
|
285
|
+
- `const content = useIntlayer("myContent");` kullanın ve `{{ content.myContent }}` / `<content.myContent />` şeklinde render edin.
|
|
286
|
+
- Ya da içeriği yapı bozma ile almak için `const { myContent } = useIntlayer("myContent");` kullanın ve `{{ myContent}}` / `<myContent/>` şeklinde render edin.
|
|
418
287
|
|
|
419
|
-
### (İsteğe Bağlı) Adım 6: İçeriğinizin dilini
|
|
288
|
+
### (İsteğe Bağlı) Adım 6: İçeriğinizin dilini değiştirin
|
|
420
289
|
|
|
421
|
-
İçeriğinizin dilini değiştirmek için
|
|
290
|
+
İçeriğinizin dilini değiştirmek için `useLocale` composable tarafından sağlanan `setLocale` fonksiyonunu kullanabilirsiniz. Bu fonksiyon, uygulamanın yerel ayarını belirlemenize ve içeriği buna göre güncellemenize olanak tanır.
|
|
422
291
|
|
|
423
|
-
|
|
292
|
+
`NuxtLink` kullanarak diller arasında geçiş yapmak için bir bileşen oluşturun. **Dil değiştirme için butonlar yerine link kullanmak, SEO ve sayfa keşfedilebilirliği açısından en iyi uygulamadır**, çünkü bu sayede arama motorları sayfalarınızın tüm yerelleştirilmiş versiyonlarını tarayabilir ve indeksleyebilir.
|
|
424
293
|
|
|
425
294
|
```vue fileName="components/LocaleSwitcher.vue"
|
|
426
|
-
<template>
|
|
427
|
-
<div class="locale-switcher">
|
|
428
|
-
<select v-model="selectedLocale" @change="changeLocale">
|
|
429
|
-
<option v-for="loc in availableLocales" :key="loc" :value="loc">
|
|
430
|
-
{{ getLocaleName(loc) }}
|
|
431
|
-
</option>
|
|
432
|
-
</select>
|
|
433
|
-
</div>
|
|
434
|
-
</template>
|
|
435
|
-
|
|
436
295
|
<script setup lang="ts">
|
|
437
|
-
import {
|
|
438
|
-
import { getLocaleName } from "intlayer";
|
|
296
|
+
import { getLocaleName, getLocalizedUrl } from "intlayer";
|
|
439
297
|
import { useLocale } from "vue-intlayer";
|
|
440
298
|
|
|
441
|
-
//
|
|
299
|
+
// Nuxt useRoute'u otomatik olarak import eder
|
|
300
|
+
const route = useRoute();
|
|
442
301
|
const { locale, availableLocales, setLocale } = useLocale();
|
|
443
|
-
|
|
444
|
-
// Seçilen yerel ayarı bir ref ile takip edin
|
|
445
|
-
const selectedLocale = ref(locale.value);
|
|
446
|
-
|
|
447
|
-
// Seçim değiştiğinde yerel ayarı güncelleyin
|
|
448
|
-
const changeLocale = () => setLocale(selectedLocale.value);
|
|
449
|
-
|
|
450
|
-
// Seçilen yerel ayarı küresel yerel ayar ile senkronize tutun
|
|
451
|
-
watch(
|
|
452
|
-
() => locale.value,
|
|
453
|
-
(newLocale) => {
|
|
454
|
-
selectedLocale.value = newLocale;
|
|
455
|
-
}
|
|
456
|
-
);
|
|
457
302
|
</script>
|
|
303
|
+
|
|
304
|
+
<template>
|
|
305
|
+
<nav class="locale-switcher">
|
|
306
|
+
<NuxtLink
|
|
307
|
+
v-for="localeEl in availableLocales"
|
|
308
|
+
:key="localeEl"
|
|
309
|
+
:to="getLocalizedUrl(route.fullPath, localeEl)"
|
|
310
|
+
class="locale-link"
|
|
311
|
+
:class="{ 'active-locale': localeEl === locale }"
|
|
312
|
+
@click="setLocale(localeEl)"
|
|
313
|
+
>
|
|
314
|
+
{{ getLocaleName(localeEl) }}
|
|
315
|
+
</NuxtLink>
|
|
316
|
+
</nav>
|
|
458
317
|
</template>
|
|
318
|
+
```
|
|
459
319
|
|
|
460
|
-
|
|
461
|
-
.locale-switcher {
|
|
462
|
-
margin: 1rem 0;
|
|
463
|
-
}
|
|
320
|
+
> `NuxtLink`'i uygun `href` öznitelikleriyle ( `getLocalizedUrl` aracılığıyla) kullanmak, arama motorlarının sayfalarınızın tüm dil varyantlarını keşfetmesini sağlar. Bu, arama motoru tarayıcılarının takip etmeyebileceği yalnızca JavaScript ile yapılan dil değiştirmeye tercih edilir.
|
|
464
321
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
322
|
+
Sonra, `app.vue` dosyanızı layout kullanacak şekilde ayarlayın:
|
|
323
|
+
|
|
324
|
+
```vue fileName="app.vue"
|
|
325
|
+
<template>
|
|
326
|
+
<NuxtLayout>
|
|
327
|
+
<NuxtPage />
|
|
328
|
+
</NuxtLayout>
|
|
329
|
+
</template>
|
|
471
330
|
```
|
|
472
331
|
|
|
473
|
-
|
|
332
|
+
### (İsteğe Bağlı) Adım 6b: Navigasyonlu Bir Layout Oluşturun
|
|
474
333
|
|
|
475
|
-
|
|
334
|
+
Nuxt layout'ları, sayfalarınız için ortak bir yapı tanımlamanıza olanak tanır. Dil değiştirici ve navigasyonu içeren varsayılan bir layout oluşturun:
|
|
335
|
+
|
|
336
|
+
```vue fileName="layouts/default.vue"
|
|
476
337
|
<script setup lang="ts">
|
|
477
|
-
import
|
|
338
|
+
import Links from "~/components/Links.vue";
|
|
478
339
|
import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
|
|
479
|
-
|
|
480
|
-
const content = useIntlayer("app"); // İlgili intlayer bildirim dosyası oluşturun
|
|
481
340
|
</script>
|
|
482
341
|
|
|
483
342
|
<template>
|
|
@@ -486,15 +345,20 @@ const content = useIntlayer("app"); // İlgili intlayer bildirim dosyası oluşt
|
|
|
486
345
|
<LocaleSwitcher />
|
|
487
346
|
</header>
|
|
488
347
|
<main>
|
|
489
|
-
<
|
|
348
|
+
<slot />
|
|
490
349
|
</main>
|
|
350
|
+
|
|
351
|
+
<Links href="/">Ana Sayfa</Links>
|
|
352
|
+
<Links href="/about">Hakkında</Links>
|
|
491
353
|
</div>
|
|
492
354
|
</template>
|
|
493
355
|
```
|
|
494
356
|
|
|
495
|
-
|
|
357
|
+
`Links` bileşeni (aşağıda gösterilmiştir), dahili navigasyon bağlantılarının otomatik olarak yerelleştirilmesini sağlar.
|
|
358
|
+
|
|
359
|
+
### (İsteğe Bağlı) Adım 7: Uygulamanıza yerelleştirilmiş Yönlendirme ekleyin
|
|
496
360
|
|
|
497
|
-
`nuxt-intlayer` modülünü
|
|
361
|
+
Nuxt, `nuxt-intlayer` modülünü kullandığınızda yerelleştirilmiş yönlendirmeyi otomatik olarak yönetir. Bu, sayfalar dizin yapınıza dayanarak her dil için otomatik olarak rotalar oluşturur.
|
|
498
362
|
|
|
499
363
|
Örnek:
|
|
500
364
|
|
|
@@ -506,266 +370,337 @@ pages/
|
|
|
506
370
|
└── index.vue → /contact, /fr/contact, /es/contact
|
|
507
371
|
```
|
|
508
372
|
|
|
509
|
-
Yerelleştirilmiş
|
|
373
|
+
Yerelleştirilmiş sayfalar oluşturmak için, `pages/` dizininde Vue dosyalarınızı oluşturmanız yeterlidir. İşte iki örnek sayfa:
|
|
510
374
|
|
|
511
|
-
|
|
375
|
+
**Ana Sayfa (`pages/index.vue`):**
|
|
376
|
+
|
|
377
|
+
```vue fileName="pages/index.vue"
|
|
512
378
|
<script setup lang="ts">
|
|
513
379
|
import { useIntlayer } from "vue-intlayer";
|
|
514
380
|
|
|
515
|
-
const content = useIntlayer("
|
|
381
|
+
const content = useIntlayer("home-page");
|
|
382
|
+
|
|
383
|
+
useHead({
|
|
384
|
+
title: content.metaTitle.value,
|
|
385
|
+
meta: [
|
|
386
|
+
{
|
|
387
|
+
name: "description",
|
|
388
|
+
content: content.metaDescription.value,
|
|
389
|
+
},
|
|
390
|
+
],
|
|
391
|
+
});
|
|
516
392
|
</script>
|
|
517
393
|
|
|
518
394
|
<template>
|
|
519
|
-
<
|
|
520
|
-
<h1>{{ content.title }}</h1>
|
|
521
|
-
<p>{{ content.description }}</p>
|
|
522
|
-
</div>
|
|
395
|
+
<h1><content.title /></h1>
|
|
523
396
|
</template>
|
|
524
397
|
```
|
|
525
398
|
|
|
526
|
-
`
|
|
399
|
+
**Hakkında Sayfası (`pages/about.vue`):**
|
|
527
400
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
- Yerel ayar çerezlerini yönetir
|
|
532
|
-
- Kullanıcıları uygun yerelleştirilmiş URL'ye yönlendirir
|
|
401
|
+
```vue fileName="pages/about.vue"
|
|
402
|
+
<script setup lang="ts">
|
|
403
|
+
import { useIntlayer } from "vue-intlayer";
|
|
533
404
|
|
|
534
|
-
|
|
405
|
+
const content = useIntlayer("about-page");
|
|
535
406
|
|
|
536
|
-
|
|
407
|
+
useHead({
|
|
408
|
+
title: content.metaTitle.raw, // Primitif string erişimi için .raw kullanın
|
|
409
|
+
meta: [
|
|
410
|
+
{
|
|
411
|
+
name: "description",
|
|
412
|
+
content: content.metaDescription.raw, // Primitif string erişimi için .raw kullanın
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
});
|
|
416
|
+
</script>
|
|
537
417
|
|
|
538
|
-
```vue fileName="components/LocalizedLink.vue"
|
|
539
418
|
<template>
|
|
540
|
-
<
|
|
541
|
-
<slot />
|
|
542
|
-
</NuxtLink>
|
|
419
|
+
<h1><content.title /></h1>
|
|
543
420
|
</template>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
> Not: `useHead` Nuxt'ta otomatik olarak içe aktarılır. İçerik değerlerine ihtiyaçlarınıza bağlı olarak `.value` (reaktif) veya `.raw` (primitif string) ile erişebilirsiniz.
|
|
424
|
+
|
|
425
|
+
`nuxt-intlayer` modülü otomatik olarak:
|
|
426
|
+
|
|
427
|
+
- Kullanıcının tercih ettiği yerel dili algılar
|
|
428
|
+
- URL üzerinden yerel dil değişimini yönetir
|
|
429
|
+
- Uygun `<html lang="">` özniteliğini ayarlar
|
|
430
|
+
- Yerel dil çerezlerini yönetir
|
|
431
|
+
- Kullanıcıları uygun yerelleştirilmiş URL'ye yönlendirir
|
|
432
|
+
|
|
433
|
+
### (İsteğe Bağlı) Adım 8: Yerelleştirilmiş Bir Link Bileşeni Oluşturma
|
|
434
|
+
|
|
435
|
+
Uygulamanızın navigasyonunun mevcut locale'a uygun olmasını sağlamak için özel bir `Links` bileşeni oluşturabilirsiniz. Bu bileşen, dahili URL'lerin önüne otomatik olarak mevcut dili ekler; bu, **SEO ve sayfa keşfedilebilirliği** için çok önemlidir.
|
|
544
436
|
|
|
437
|
+
```vue fileName="components/Links.vue"
|
|
545
438
|
<script setup lang="ts">
|
|
546
|
-
import { computed } from "vue";
|
|
547
439
|
import { getLocalizedUrl } from "intlayer";
|
|
548
440
|
import { useLocale } from "vue-intlayer";
|
|
549
441
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
},
|
|
555
|
-
});
|
|
442
|
+
interface Props {
|
|
443
|
+
href: string;
|
|
444
|
+
locale?: string;
|
|
445
|
+
}
|
|
556
446
|
|
|
557
|
-
const
|
|
447
|
+
const props = defineProps<Props>();
|
|
558
448
|
|
|
559
|
-
|
|
560
|
-
const isExternalLink = computed(() => /^https?:\/\//.test(props.to || ""));
|
|
449
|
+
const { locale: currentLocale } = useLocale();
|
|
561
450
|
|
|
562
|
-
//
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
);
|
|
451
|
+
// Son yolu hesapla
|
|
452
|
+
const finalPath = computed(() => {
|
|
453
|
+
// 1. Linkin harici olup olmadığını kontrol et
|
|
454
|
+
const isExternal = /^https?:\/\//.test(props.href || "");
|
|
455
|
+
|
|
456
|
+
// 2. Eğer harici ise, olduğu gibi döndür (NuxtLink <a> etiketi oluşturmayı yönetir)
|
|
457
|
+
if (isExternal) return props.href;
|
|
458
|
+
|
|
459
|
+
// 3. Eğer dahili ise, URL'yi yerelleştir
|
|
460
|
+
const targetLocale = props.locale || currentLocale.value;
|
|
461
|
+
return getLocalizedUrl(props.href, targetLocale);
|
|
462
|
+
});
|
|
566
463
|
</script>
|
|
464
|
+
|
|
465
|
+
<template>
|
|
466
|
+
<NuxtLink :to="finalPath" v-bind="$attrs">
|
|
467
|
+
<slot />
|
|
468
|
+
</NuxtLink>
|
|
469
|
+
</template>
|
|
567
470
|
```
|
|
568
471
|
|
|
569
|
-
|
|
472
|
+
Sonra bu bileşeni uygulamanızın her yerinde kullanabilirsiniz:
|
|
473
|
+
|
|
474
|
+
```vue fileName="layouts/default.vue"
|
|
475
|
+
<script setup lang="ts">
|
|
476
|
+
import Links from "~/components/Links.vue";
|
|
477
|
+
import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
|
|
478
|
+
</script>
|
|
570
479
|
|
|
571
|
-
```vue fileName="pages/index.vue"
|
|
572
480
|
<template>
|
|
573
481
|
<div>
|
|
574
|
-
<
|
|
575
|
-
|
|
576
|
-
</
|
|
577
|
-
<
|
|
578
|
-
|
|
579
|
-
</
|
|
482
|
+
<header>
|
|
483
|
+
<LocaleSwitcher />
|
|
484
|
+
</header>
|
|
485
|
+
<main>
|
|
486
|
+
<slot />
|
|
487
|
+
</main>
|
|
488
|
+
|
|
489
|
+
<Links href="/">Anasayfa</Links>
|
|
490
|
+
<Links href="/about">Hakkında</Links>
|
|
580
491
|
</div>
|
|
581
492
|
</template>
|
|
582
|
-
|
|
583
|
-
<script setup lang="ts">
|
|
584
|
-
import { useIntlayer } from "vue-intlayer";
|
|
585
|
-
import LocalizedLink from "~/components/LocalizedLink.vue";
|
|
586
|
-
|
|
587
|
-
const content = useIntlayer("home");
|
|
588
|
-
</script>
|
|
589
493
|
```
|
|
590
494
|
|
|
495
|
+
> `NuxtLink`'i yerelleştirilmiş yollarla kullanarak şunları sağlarsınız:
|
|
496
|
+
>
|
|
497
|
+
> - Arama motorları sayfalarınızın tüm dil versiyonlarını tarayabilir ve dizine ekleyebilir
|
|
498
|
+
> - Kullanıcılar yerelleştirilmiş URL'leri doğrudan paylaşabilir
|
|
499
|
+
> - Tarayıcı geçmişi, dil önekli URL'lerle doğru şekilde çalışır
|
|
500
|
+
|
|
591
501
|
### (İsteğe Bağlı) Adım 9: Meta Verileri ve SEO'yu Yönetme
|
|
592
502
|
|
|
593
|
-
Nuxt, mükemmel SEO yetenekleri
|
|
503
|
+
Nuxt, `useHead` composable (otomatik olarak içe aktarılır) aracılığıyla mükemmel SEO yetenekleri sunar. Intlayer'ı, yerelleştirilmiş meta verileri yönetmek için `.raw` veya `.value` erişicisini kullanarak temel string değerini almak için kullanabilirsiniz:
|
|
594
504
|
|
|
595
505
|
```vue fileName="pages/about.vue"
|
|
596
506
|
<script setup lang="ts">
|
|
597
|
-
import {
|
|
598
|
-
import { getIntlayer } from "intlayer";
|
|
599
|
-
import { useLocale } from "vue-intlayer";
|
|
507
|
+
import { useIntlayer } from "vue-intlayer";
|
|
600
508
|
|
|
601
|
-
|
|
602
|
-
const content =
|
|
509
|
+
// useHead Nuxt'ta otomatik olarak içe aktarılır
|
|
510
|
+
const content = useIntlayer("about-page");
|
|
603
511
|
|
|
604
|
-
|
|
605
|
-
title: content.
|
|
606
|
-
|
|
512
|
+
useHead({
|
|
513
|
+
title: content.metaTitle.raw, // Temel string erişimi için .raw kullanın
|
|
514
|
+
meta: [
|
|
515
|
+
{
|
|
516
|
+
name: "description",
|
|
517
|
+
content: content.metaDescription.raw, // İlkel string erişimi için .raw kullanın
|
|
518
|
+
},
|
|
519
|
+
],
|
|
607
520
|
});
|
|
608
521
|
</script>
|
|
609
522
|
|
|
610
523
|
<template>
|
|
611
|
-
<
|
|
612
|
-
<h1>{{ content.pageTitle }}</h1>
|
|
613
|
-
<p>{{ content.pageContent }}</p>
|
|
614
|
-
</div>
|
|
524
|
+
<h1><content.title /></h1>
|
|
615
525
|
</template>
|
|
616
526
|
```
|
|
617
527
|
|
|
618
|
-
|
|
528
|
+
> Alternatif olarak, Vue reaktivitesi olmadan içeriği almak için `import { getIntlayer } from "intlayer"` fonksiyonunu kullanabilirsiniz.
|
|
529
|
+
|
|
530
|
+
> **İçerik değerlerine erişim:**
|
|
531
|
+
>
|
|
532
|
+
> - İlkel string değeri almak için `.raw` kullanın (reaktif değil)
|
|
533
|
+
> - Reaktif değeri almak için `.value` kullanın
|
|
534
|
+
> - Görsel Editör desteği için `<content.key />` bileşen sözdizimini kullanın
|
|
535
|
+
|
|
536
|
+
İlgili içerik bildirimi oluşturun:
|
|
619
537
|
|
|
620
|
-
```ts fileName="pages/about-
|
|
538
|
+
```ts fileName="pages/about-page.content.ts" contentDeclarationFormat="typescript"
|
|
621
539
|
import { t, type Dictionary } from "intlayer";
|
|
622
|
-
import type { useSeoMeta } from "nuxt/app";
|
|
623
540
|
|
|
624
|
-
const
|
|
625
|
-
key: "about-
|
|
541
|
+
const aboutPageContent = {
|
|
542
|
+
key: "about-page",
|
|
626
543
|
content: {
|
|
627
|
-
|
|
628
|
-
en: "
|
|
544
|
+
metaTitle: t({
|
|
545
|
+
en: "Hakkımızda - Şirketim",
|
|
629
546
|
fr: "À Propos - Ma Société",
|
|
630
547
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
631
548
|
}),
|
|
632
|
-
|
|
633
|
-
en: "
|
|
549
|
+
metaDescription: t({
|
|
550
|
+
en: "Şirketimiz ve misyonumuz hakkında daha fazla bilgi edinin",
|
|
634
551
|
fr: "En savoir plus sur notre société et notre mission",
|
|
635
552
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
636
553
|
}),
|
|
554
|
+
title: t({
|
|
555
|
+
en: "Hakkımızda",
|
|
556
|
+
fr: "À Propos",
|
|
557
|
+
es: "Acerca de Nosotros",
|
|
558
|
+
}),
|
|
637
559
|
},
|
|
638
|
-
} satisfies Dictionary
|
|
560
|
+
} satisfies Dictionary;
|
|
639
561
|
|
|
640
|
-
export default
|
|
562
|
+
export default aboutPageContent;
|
|
641
563
|
```
|
|
642
564
|
|
|
643
|
-
```
|
|
565
|
+
```javascript fileName="pages/about-page.content.mjs" contentDeclarationFormat="esm"
|
|
644
566
|
import { t } from "intlayer";
|
|
645
567
|
|
|
646
568
|
/** @type {import('intlayer').Dictionary} */
|
|
647
|
-
const
|
|
648
|
-
key: "about-
|
|
569
|
+
const aboutPageContent = {
|
|
570
|
+
key: "about-page",
|
|
649
571
|
content: {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
en: "About Us - My Company",
|
|
572
|
+
metaTitle: t({
|
|
573
|
+
en: "Hakkımızda - Şirketim",
|
|
653
574
|
fr: "À Propos - Ma Société",
|
|
654
575
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
655
576
|
}),
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
en: "Learn more about our company and our mission",
|
|
577
|
+
metaDescription: t({
|
|
578
|
+
en: "Şirketimiz ve misyonumuz hakkında daha fazla bilgi edinin",
|
|
659
579
|
fr: "En savoir plus sur notre société et notre mission",
|
|
660
580
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
661
581
|
}),
|
|
582
|
+
title: t({
|
|
583
|
+
en: "Hakkımızda",
|
|
584
|
+
fr: "À Propos",
|
|
585
|
+
es: "Acerca de Nosotros",
|
|
586
|
+
}),
|
|
662
587
|
},
|
|
663
588
|
};
|
|
664
589
|
|
|
665
|
-
export default
|
|
590
|
+
export default aboutPageContent;
|
|
666
591
|
```
|
|
667
592
|
|
|
668
|
-
```
|
|
593
|
+
```javascript fileName="pages/about-page.content.cjs" contentDeclarationFormat="commonjs"
|
|
669
594
|
const { t } = require("intlayer");
|
|
670
595
|
|
|
671
596
|
/** @type {import('intlayer').Dictionary} */
|
|
672
|
-
const
|
|
673
|
-
key: "about-
|
|
597
|
+
const aboutPageContent = {
|
|
598
|
+
key: "about-page",
|
|
674
599
|
content: {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
en: "About Us - My Company",
|
|
600
|
+
metaTitle: t({
|
|
601
|
+
en: "Hakkımızda - Şirketim",
|
|
678
602
|
fr: "À Propos - Ma Société",
|
|
679
603
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
680
604
|
}),
|
|
681
|
-
|
|
682
|
-
zh: "了解更多关于我们公司和我们的使命",
|
|
605
|
+
metaDescription: t({
|
|
683
606
|
en: "Learn more about our company and our mission",
|
|
684
607
|
fr: "En savoir plus sur notre société et notre mission",
|
|
685
608
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
686
609
|
}),
|
|
610
|
+
title: t({
|
|
611
|
+
en: "About Us",
|
|
612
|
+
fr: "À Propos",
|
|
613
|
+
es: "Acerca de Nosotros",
|
|
614
|
+
}),
|
|
687
615
|
},
|
|
688
616
|
};
|
|
689
617
|
|
|
690
|
-
module.exports =
|
|
618
|
+
module.exports = aboutPageContent;
|
|
691
619
|
```
|
|
692
620
|
|
|
693
|
-
```json fileName="pages/about-
|
|
621
|
+
```json fileName="pages/about-page.content.json" contentDeclarationFormat="json"
|
|
694
622
|
{
|
|
695
|
-
"
|
|
623
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
624
|
+
"key": "about-page",
|
|
696
625
|
"content": {
|
|
697
|
-
"
|
|
626
|
+
"metaTitle": {
|
|
698
627
|
"nodeType": "translation",
|
|
699
|
-
"
|
|
700
|
-
"zh": "关于我们 - 我的公司",
|
|
628
|
+
"translation": {
|
|
701
629
|
"en": "About Us - My Company",
|
|
702
630
|
"fr": "À Propos - Ma Société",
|
|
703
631
|
"es": "Acerca de Nosotros - Mi Empresa"
|
|
704
632
|
}
|
|
705
633
|
},
|
|
706
|
-
"
|
|
634
|
+
"metaDescription": {
|
|
707
635
|
"nodeType": "translation",
|
|
708
|
-
"
|
|
709
|
-
"zh": "了解更多关于我们公司和我们的使命",
|
|
636
|
+
"translation": {
|
|
710
637
|
"en": "Learn more about our company and our mission",
|
|
711
638
|
"fr": "En savoir plus sur notre société et notre mission",
|
|
712
|
-
"es": "Conozca más sobre nuestra empresa y nuestra misión"
|
|
639
|
+
"es": "Conozca más sobre nuestra empresa y nuestra misión",
|
|
640
|
+
"tr": "Şirketimiz ve misyonumuz hakkında daha fazla bilgi edinin"
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
"title": {
|
|
644
|
+
"nodeType": "translation",
|
|
645
|
+
"translation": {
|
|
646
|
+
"en": "About Us",
|
|
647
|
+
"fr": "À Propos",
|
|
648
|
+
"es": "Acerca de Nosotros",
|
|
649
|
+
"tr": "Hakkımızda"
|
|
713
650
|
}
|
|
714
651
|
}
|
|
715
652
|
}
|
|
716
653
|
}
|
|
717
654
|
```
|
|
718
655
|
|
|
719
|
-
### TypeScript Yapılandırma
|
|
656
|
+
### TypeScript'i Yapılandırma
|
|
720
657
|
|
|
721
|
-
Intlayer, TypeScript'
|
|
658
|
+
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.
|
|
722
659
|
|
|
723
|
-

|
|
724
661
|
|
|
725
|
-

|
|
726
663
|
|
|
727
|
-
TypeScript yapılandırmanızın otomatik
|
|
664
|
+
TypeScript yapılandırmanızın otomatik oluşturulan türleri içerdiğinden emin olun.
|
|
728
665
|
|
|
729
666
|
```json5 fileName="tsconfig.json"
|
|
730
667
|
{
|
|
731
668
|
// ... Mevcut TypeScript yapılandırmalarınız
|
|
732
669
|
"include": [
|
|
733
670
|
// ... Mevcut TypeScript yapılandırmalarınız
|
|
734
|
-
".intlayer/**/*.ts", // Otomatik
|
|
671
|
+
".intlayer/**/*.ts", // Otomatik oluşturulan türleri dahil et
|
|
735
672
|
],
|
|
736
673
|
}
|
|
737
674
|
```
|
|
738
675
|
|
|
739
|
-
### Git
|
|
676
|
+
### Git Yapılandırması
|
|
740
677
|
|
|
741
|
-
Intlayer tarafından oluşturulan
|
|
678
|
+
Intlayer tarafından oluşturulan dosyaların göz ardı edilmesi önerilir. Bu, bu dosyaların Git deposuna commit edilmesini önler.
|
|
742
679
|
|
|
743
|
-
Bunu yapmak için
|
|
680
|
+
Bunu yapmak için `.gitignore` dosyanıza aşağıdaki talimatları ekleyebilirsiniz:
|
|
744
681
|
|
|
745
682
|
```plaintext fileName=".gitignore"
|
|
746
|
-
# Intlayer tarafından oluşturulan dosyaları
|
|
683
|
+
# Intlayer tarafından oluşturulan dosyaları göz ardı et
|
|
747
684
|
.intlayer
|
|
748
685
|
```
|
|
749
686
|
|
|
750
|
-
### VS Code
|
|
687
|
+
### VS Code Eklentisi
|
|
751
688
|
|
|
752
|
-
Intlayer ile geliştirme deneyiminizi
|
|
689
|
+
Intlayer ile geliştirme deneyiminizi iyileştirmek için resmi **Intlayer VS Code Uzantısı**nı yükleyebilirsiniz.
|
|
753
690
|
|
|
754
|
-
[VS Code Marketplace'ten
|
|
691
|
+
[VS Code Marketplace'ten Yükleyin](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
755
692
|
|
|
756
693
|
Bu uzantı şunları sağlar:
|
|
757
694
|
|
|
758
|
-
-
|
|
759
|
-
-
|
|
760
|
-
-
|
|
761
|
-
-
|
|
695
|
+
- Çeviri anahtarları için **Otomatik tamamlama**.
|
|
696
|
+
- Eksik çeviriler için **Gerçek zamanlı hata tespiti**.
|
|
697
|
+
- Çevrilmiş içeriğin **Satır içi önizlemeleri**.
|
|
698
|
+
- Çevirileri kolayca oluşturup güncellemek için **Hızlı işlemler**.
|
|
762
699
|
|
|
763
|
-
Uzantının nasıl kullanılacağı hakkında daha fazla
|
|
700
|
+
Uzantının nasıl kullanılacağı hakkında daha fazla bilgi için [Intlayer VS Code Uzantısı dokümantasyonuna](https://intlayer.org/doc/vs-code-extension) bakabilirsiniz.
|
|
764
701
|
|
|
765
702
|
---
|
|
766
703
|
|
|
767
|
-
### Daha
|
|
704
|
+
### Daha İleri Gitmek
|
|
768
705
|
|
|
769
|
-
Daha
|
|
770
|
-
|
|
771
|
-
---
|
|
706
|
+
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.
|