@intlayer/docs 7.3.15 → 7.5.0-canary.0
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/ar/intlayer_with_i18next.md +2 -0
- package/blog/ar/intlayer_with_next-i18next.md +2 -0
- package/blog/ar/intlayer_with_next-intl.md +2 -0
- package/blog/ar/intlayer_with_react-i18next.md +2 -0
- package/blog/ar/intlayer_with_react-intl.md +2 -0
- package/blog/ar/intlayer_with_vue-i18n.md +2 -0
- package/blog/de/intlayer_with_i18next.md +2 -0
- package/blog/de/intlayer_with_next-i18next.md +1 -0
- package/blog/de/intlayer_with_next-intl.md +2 -0
- package/blog/de/intlayer_with_react-i18next.md +2 -0
- package/blog/de/intlayer_with_react-intl.md +2 -0
- package/blog/de/intlayer_with_vue-i18n.md +2 -0
- package/blog/en/intlayer_with_i18next.md +6 -0
- package/blog/en/intlayer_with_next-i18next.md +3 -0
- package/blog/en/intlayer_with_next-intl.md +3 -0
- package/blog/en/intlayer_with_react-i18next.md +3 -0
- package/blog/en/intlayer_with_react-intl.md +3 -0
- package/blog/en/intlayer_with_vue-i18n.md +3 -0
- package/blog/en-GB/intlayer_with_i18next.md +2 -0
- package/blog/en-GB/intlayer_with_next-i18next.md +2 -0
- package/blog/en-GB/intlayer_with_next-intl.md +2 -0
- package/blog/en-GB/intlayer_with_react-i18next.md +2 -0
- package/blog/en-GB/intlayer_with_react-intl.md +2 -0
- package/blog/en-GB/intlayer_with_vue-i18n.md +2 -0
- package/blog/es/intlayer_with_i18next.md +2 -0
- package/blog/es/intlayer_with_next-i18next.md +2 -0
- package/blog/es/intlayer_with_next-intl.md +2 -0
- package/blog/es/intlayer_with_react-i18next.md +2 -0
- package/blog/es/intlayer_with_react-intl.md +2 -0
- package/blog/es/intlayer_with_vue-i18n.md +2 -0
- package/blog/fr/intlayer_with_i18next.md +2 -0
- package/blog/fr/intlayer_with_next-i18next.md +2 -0
- package/blog/fr/intlayer_with_next-intl.md +2 -0
- package/blog/fr/intlayer_with_react-i18next.md +2 -0
- package/blog/fr/intlayer_with_react-intl.md +2 -0
- package/blog/fr/intlayer_with_vue-i18n.md +2 -0
- package/blog/hi/intlayer_with_i18next.md +2 -0
- package/blog/hi/intlayer_with_next-i18next.md +2 -0
- package/blog/hi/intlayer_with_next-intl.md +2 -0
- package/blog/hi/intlayer_with_react-i18next.md +2 -0
- package/blog/hi/intlayer_with_react-intl.md +2 -0
- package/blog/hi/intlayer_with_vue-i18n.md +2 -0
- package/blog/id/intlayer_with_i18next.md +2 -0
- package/blog/id/intlayer_with_next-i18next.md +2 -0
- package/blog/id/intlayer_with_next-intl.md +2 -0
- package/blog/id/intlayer_with_react-i18next.md +2 -0
- package/blog/id/intlayer_with_react-intl.md +2 -0
- package/blog/id/intlayer_with_vue-i18n.md +2 -0
- package/blog/it/intlayer_with_i18next.md +2 -0
- package/blog/it/intlayer_with_next-i18next.md +2 -0
- package/blog/it/intlayer_with_next-intl.md +2 -0
- package/blog/it/intlayer_with_react-i18next.md +2 -0
- package/blog/it/intlayer_with_react-intl.md +2 -0
- package/blog/it/intlayer_with_vue-i18n.md +2 -0
- package/blog/ja/intlayer_with_i18next.md +2 -0
- package/blog/ja/intlayer_with_next-i18next.md +1 -0
- package/blog/ja/intlayer_with_next-intl.md +2 -0
- package/blog/ja/intlayer_with_react-i18next.md +2 -0
- package/blog/ja/intlayer_with_react-intl.md +2 -0
- package/blog/ja/intlayer_with_vue-i18n.md +2 -0
- package/blog/ko/intlayer_with_i18next.md +2 -0
- package/blog/ko/intlayer_with_next-i18next.md +2 -0
- package/blog/ko/intlayer_with_next-intl.md +2 -0
- package/blog/ko/intlayer_with_react-i18next.md +2 -0
- package/blog/ko/intlayer_with_react-intl.md +2 -0
- package/blog/ko/intlayer_with_vue-i18n.md +2 -0
- package/blog/pl/intlayer_with_i18next.md +2 -0
- package/blog/pl/intlayer_with_next-i18next.md +2 -0
- package/blog/pl/intlayer_with_next-intl.md +2 -0
- package/blog/pl/intlayer_with_react-i18next.md +2 -0
- package/blog/pl/intlayer_with_react-intl.md +2 -0
- package/blog/pl/intlayer_with_vue-i18n.md +2 -0
- package/blog/pt/intlayer_with_i18next.md +2 -0
- package/blog/pt/intlayer_with_next-i18next.md +2 -0
- package/blog/pt/intlayer_with_next-intl.md +2 -0
- package/blog/pt/intlayer_with_react-i18next.md +2 -0
- package/blog/pt/intlayer_with_react-intl.md +2 -0
- package/blog/pt/intlayer_with_vue-i18n.md +2 -0
- package/blog/ru/intlayer_with_i18next.md +2 -0
- package/blog/ru/intlayer_with_next-i18next.md +2 -0
- package/blog/ru/intlayer_with_next-intl.md +2 -0
- package/blog/ru/intlayer_with_react-i18next.md +2 -0
- package/blog/ru/intlayer_with_react-intl.md +2 -0
- package/blog/ru/intlayer_with_vue-i18n.md +2 -0
- package/blog/tr/intlayer_with_i18next.md +2 -0
- package/blog/tr/intlayer_with_next-i18next.md +2 -0
- package/blog/tr/intlayer_with_next-intl.md +2 -0
- package/blog/tr/intlayer_with_react-i18next.md +2 -0
- package/blog/tr/intlayer_with_react-intl.md +2 -0
- package/blog/tr/intlayer_with_vue-i18n.md +2 -0
- package/blog/vi/intlayer_with_i18next.md +2 -0
- package/blog/vi/intlayer_with_next-i18next.md +2 -0
- package/blog/vi/intlayer_with_next-intl.md +2 -0
- package/blog/vi/intlayer_with_react-i18next.md +2 -0
- package/blog/vi/intlayer_with_react-intl.md +2 -0
- package/blog/vi/intlayer_with_vue-i18n.md +2 -0
- package/blog/zh/intlayer_with_i18next.md +2 -0
- package/blog/zh/intlayer_with_next-i18next.md +2 -0
- package/blog/zh/intlayer_with_next-intl.md +2 -0
- package/blog/zh/intlayer_with_react-i18next.md +2 -0
- package/blog/zh/intlayer_with_react-intl.md +2 -0
- package/blog/zh/intlayer_with_vue-i18n.md +2 -0
- package/docs/ar/dictionary/content_file.md +24 -1
- package/docs/ar/intlayer_with_astro.md +1 -1
- package/docs/ar/intlayer_with_express.md +1 -1
- package/docs/ar/intlayer_with_nestjs.md +1 -1
- package/docs/ar/intlayer_with_next-i18next.md +1 -0
- package/docs/ar/intlayer_with_next-intl.md +1 -0
- package/docs/ar/intlayer_with_tanstack.md +122 -3
- package/docs/ar/plugins/sync-json.md +27 -2
- package/docs/de/dictionary/content_file.md +24 -1
- package/docs/de/intlayer_with_astro.md +1 -1
- package/docs/de/intlayer_with_express.md +1 -1
- package/docs/de/intlayer_with_nestjs.md +1 -1
- package/docs/de/intlayer_with_next-i18next.md +1 -0
- package/docs/de/intlayer_with_next-intl.md +1 -0
- package/docs/de/intlayer_with_tanstack.md +122 -3
- package/docs/de/plugins/sync-json.md +27 -2
- package/docs/en/dictionary/content_file.md +24 -1
- package/docs/en/intlayer_with_astro.md +1 -1
- package/docs/en/intlayer_with_express.md +1 -1
- package/docs/en/intlayer_with_nestjs.md +1 -2
- package/docs/en/intlayer_with_next-i18next.md +1 -0
- package/docs/en/intlayer_with_next-intl.md +1 -0
- package/docs/en/intlayer_with_tanstack.md +120 -1
- package/docs/en/plugins/sync-json.md +53 -2
- package/docs/en-GB/dictionary/content_file.md +24 -1
- package/docs/en-GB/intlayer_with_astro.md +1 -1
- package/docs/en-GB/intlayer_with_express.md +1 -1
- package/docs/en-GB/intlayer_with_nestjs.md +1 -1
- package/docs/en-GB/intlayer_with_next-i18next.md +1 -0
- package/docs/en-GB/intlayer_with_next-intl.md +1 -0
- package/docs/en-GB/intlayer_with_tanstack.md +121 -2
- package/docs/en-GB/plugins/sync-json.md +26 -1
- package/docs/es/dictionary/content_file.md +24 -1
- package/docs/es/intlayer_with_astro.md +1 -1
- package/docs/es/intlayer_with_express.md +1 -1
- package/docs/es/intlayer_with_nestjs.md +1 -1
- package/docs/es/intlayer_with_next-i18next.md +1 -0
- package/docs/es/intlayer_with_next-intl.md +1 -0
- package/docs/es/intlayer_with_tanstack.md +122 -3
- package/docs/es/plugins/sync-json.md +27 -2
- package/docs/fr/dictionary/content_file.md +24 -1
- package/docs/fr/intlayer_with_astro.md +1 -1
- package/docs/fr/intlayer_with_express.md +1 -1
- package/docs/fr/intlayer_with_nestjs.md +1 -1
- package/docs/fr/intlayer_with_next-i18next.md +1 -0
- package/docs/fr/intlayer_with_next-intl.md +1 -0
- package/docs/fr/intlayer_with_tanstack.md +122 -3
- package/docs/fr/plugins/sync-json.md +27 -2
- package/docs/hi/dictionary/content_file.md +24 -1
- package/docs/hi/intlayer_with_astro.md +1 -1
- package/docs/hi/intlayer_with_express.md +1 -1
- package/docs/hi/intlayer_with_nestjs.md +1 -1
- package/docs/hi/intlayer_with_next-i18next.md +1 -0
- package/docs/hi/intlayer_with_next-intl.md +1 -0
- package/docs/hi/intlayer_with_tanstack.md +122 -3
- package/docs/hi/plugins/sync-json.md +27 -2
- package/docs/id/dictionary/content_file.md +24 -1
- package/docs/id/intlayer_with_astro.md +1 -1
- package/docs/id/intlayer_with_express.md +1 -1
- package/docs/id/intlayer_with_nestjs.md +1 -1
- package/docs/id/intlayer_with_next-i18next.md +1 -0
- package/docs/id/intlayer_with_next-intl.md +1 -0
- package/docs/id/intlayer_with_tanstack.md +122 -3
- package/docs/id/plugins/sync-json.md +27 -2
- package/docs/it/dictionary/content_file.md +24 -1
- package/docs/it/intlayer_with_astro.md +1 -1
- package/docs/it/intlayer_with_express.md +1 -1
- package/docs/it/intlayer_with_nestjs.md +1 -1
- package/docs/it/intlayer_with_next-i18next.md +1 -0
- package/docs/it/intlayer_with_next-intl.md +1 -0
- package/docs/it/intlayer_with_tanstack.md +122 -3
- package/docs/it/plugins/sync-json.md +27 -2
- package/docs/ja/dictionary/content_file.md +24 -1
- package/docs/ja/intlayer_with_astro.md +1 -1
- package/docs/ja/intlayer_with_express.md +1 -1
- package/docs/ja/intlayer_with_nestjs.md +1 -1
- package/docs/ja/intlayer_with_next-i18next.md +1 -0
- package/docs/ja/intlayer_with_next-intl.md +1 -0
- package/docs/ja/intlayer_with_tanstack.md +122 -3
- package/docs/ja/plugins/sync-json.md +27 -2
- package/docs/ko/dictionary/content_file.md +44 -1
- package/docs/ko/intlayer_with_astro.md +1 -1
- package/docs/ko/intlayer_with_express.md +1 -1
- package/docs/ko/intlayer_with_nestjs.md +1 -1
- package/docs/ko/intlayer_with_next-i18next.md +1 -0
- package/docs/ko/intlayer_with_next-intl.md +1 -0
- package/docs/ko/intlayer_with_tanstack.md +122 -3
- package/docs/ko/plugins/sync-json.md +27 -2
- package/docs/pl/dictionary/content_file.md +24 -1
- package/docs/pl/intlayer_with_astro.md +2 -2
- package/docs/pl/intlayer_with_express.md +1 -1
- package/docs/pl/intlayer_with_nestjs.md +1 -1
- package/docs/pl/intlayer_with_next-i18next.md +1 -0
- package/docs/pl/intlayer_with_next-intl.md +1 -0
- package/docs/pl/intlayer_with_tanstack.md +122 -3
- package/docs/pl/plugins/sync-json.md +24 -2
- package/docs/pt/dictionary/content_file.md +24 -1
- package/docs/pt/intlayer_with_astro.md +1 -1
- package/docs/pt/intlayer_with_express.md +1 -1
- package/docs/pt/intlayer_with_nestjs.md +1 -1
- package/docs/pt/intlayer_with_next-i18next.md +1 -0
- package/docs/pt/intlayer_with_next-intl.md +1 -0
- package/docs/pt/intlayer_with_tanstack.md +122 -3
- package/docs/pt/plugins/sync-json.md +27 -2
- package/docs/ru/dictionary/content_file.md +44 -1
- package/docs/ru/intlayer_with_astro.md +1 -1
- package/docs/ru/intlayer_with_express.md +1 -1
- package/docs/ru/intlayer_with_nestjs.md +1 -1
- package/docs/ru/intlayer_with_next-i18next.md +1 -0
- package/docs/ru/intlayer_with_next-intl.md +1 -0
- package/docs/ru/intlayer_with_tanstack.md +122 -3
- package/docs/ru/plugins/sync-json.md +27 -2
- package/docs/tr/dictionary/content_file.md +44 -1
- package/docs/tr/intlayer_with_astro.md +1 -1
- package/docs/tr/intlayer_with_express.md +1 -1
- package/docs/tr/intlayer_with_next-i18next.md +1 -0
- package/docs/tr/intlayer_with_next-intl.md +1 -0
- package/docs/tr/intlayer_with_tanstack.md +122 -3
- package/docs/tr/plugins/sync-json.md +27 -2
- package/docs/vi/dictionary/content_file.md +24 -1
- package/docs/vi/intlayer_with_astro.md +1 -1
- package/docs/vi/intlayer_with_express.md +1 -1
- package/docs/vi/intlayer_with_nestjs.md +1 -1
- package/docs/vi/intlayer_with_next-i18next.md +1 -0
- package/docs/vi/intlayer_with_next-intl.md +1 -0
- package/docs/vi/intlayer_with_tanstack.md +122 -3
- package/docs/vi/plugins/sync-json.md +27 -2
- package/docs/zh/dictionary/content_file.md +44 -1
- package/docs/zh/intlayer_with_astro.md +1 -1
- package/docs/zh/intlayer_with_express.md +1 -1
- package/docs/zh/intlayer_with_nestjs.md +1 -1
- package/docs/zh/intlayer_with_next-i18next.md +1 -0
- package/docs/zh/intlayer_with_next-intl.md +1 -0
- package/docs/zh/intlayer_with_tanstack.md +122 -3
- package/docs/zh/plugins/sync-json.md +27 -2
- package/package.json +6 -6
|
@@ -98,6 +98,7 @@ const config: IntlayerConfig = {
|
|
|
98
98
|
},
|
|
99
99
|
plugins: [
|
|
100
100
|
syncJSON({
|
|
101
|
+
format: "vue-i18n",
|
|
101
102
|
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
102
103
|
}),
|
|
103
104
|
],
|
|
@@ -149,6 +150,7 @@ const config: IntlayerConfig = {
|
|
|
149
150
|
* Carregará e escreverá a saída e as traduções de volta nos arquivos JSON no diretório de locais
|
|
150
151
|
*/
|
|
151
152
|
syncJSON({
|
|
153
|
+
format: "vue-i18n",
|
|
152
154
|
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
153
155
|
priority: 0,
|
|
154
156
|
}),
|
|
@@ -100,6 +100,7 @@ const config: IntlayerConfig = {
|
|
|
100
100
|
},
|
|
101
101
|
plugins: [
|
|
102
102
|
syncJSON({
|
|
103
|
+
format: "i18next",
|
|
103
104
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
104
105
|
}),
|
|
105
106
|
],
|
|
@@ -149,6 +150,7 @@ const config: IntlayerConfig = {
|
|
|
149
150
|
* Загрузит и запишет результат и переводы обратно в JSON файлы в директории locales
|
|
150
151
|
*/
|
|
151
152
|
syncJSON({
|
|
153
|
+
format: "i18next",
|
|
152
154
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
153
155
|
priority: 0,
|
|
154
156
|
}),
|
|
@@ -108,6 +108,7 @@ const config: IntlayerConfig = {
|
|
|
108
108
|
},
|
|
109
109
|
plugins: [
|
|
110
110
|
syncJSON({
|
|
111
|
+
format: "i18next",
|
|
111
112
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
112
113
|
}),
|
|
113
114
|
],
|
|
@@ -159,6 +160,7 @@ const config: IntlayerConfig = {
|
|
|
159
160
|
* Загрузит, а также запишет результаты и переводы обратно в JSON-файлы в директории локалей
|
|
160
161
|
*/
|
|
161
162
|
syncJSON({
|
|
163
|
+
format: "i18next",
|
|
162
164
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
163
165
|
priority: 0,
|
|
164
166
|
}),
|
|
@@ -94,6 +94,7 @@ const config: IntlayerConfig = {
|
|
|
94
94
|
},
|
|
95
95
|
plugins: [
|
|
96
96
|
syncJSON({
|
|
97
|
+
format: "icu",
|
|
97
98
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
98
99
|
}),
|
|
99
100
|
],
|
|
@@ -144,6 +145,7 @@ const config: IntlayerConfig = {
|
|
|
144
145
|
* Загрузит и запишет результаты и переводы обратно в JSON-файлы в директории locales
|
|
145
146
|
*/
|
|
146
147
|
syncJSON({
|
|
148
|
+
format: "icu",
|
|
147
149
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
148
150
|
priority: 0,
|
|
149
151
|
}),
|
|
@@ -98,6 +98,7 @@ const config: IntlayerConfig = {
|
|
|
98
98
|
},
|
|
99
99
|
plugins: [
|
|
100
100
|
syncJSON({
|
|
101
|
+
format: "i18next",
|
|
101
102
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
102
103
|
}),
|
|
103
104
|
],
|
|
@@ -147,6 +148,7 @@ const config: IntlayerConfig = {
|
|
|
147
148
|
* Загрузит и запишет результат и переводы обратно в JSON-файлы в директории locales
|
|
148
149
|
*/
|
|
149
150
|
syncJSON({
|
|
151
|
+
format: "i18next",
|
|
150
152
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
151
153
|
priority: 0,
|
|
152
154
|
}),
|
|
@@ -96,6 +96,7 @@ const config: IntlayerConfig = {
|
|
|
96
96
|
},
|
|
97
97
|
plugins: [
|
|
98
98
|
syncJSON({
|
|
99
|
+
format: "icu",
|
|
99
100
|
source: ({ key, locale }) => `./intl/messages/${locale}/${key}.json`,
|
|
100
101
|
}),
|
|
101
102
|
],
|
|
@@ -145,6 +146,7 @@ const config: IntlayerConfig = {
|
|
|
145
146
|
* Загрузит и запишет результат и переводы обратно в JSON-файлы в директории locales
|
|
146
147
|
*/
|
|
147
148
|
syncJSON({
|
|
149
|
+
format: "icu",
|
|
148
150
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
149
151
|
priority: 0,
|
|
150
152
|
}),
|
|
@@ -98,6 +98,7 @@ const config: IntlayerConfig = {
|
|
|
98
98
|
},
|
|
99
99
|
plugins: [
|
|
100
100
|
syncJSON({
|
|
101
|
+
format: "vue-i18n",
|
|
101
102
|
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
102
103
|
}),
|
|
103
104
|
],
|
|
@@ -149,6 +150,7 @@ const config: IntlayerConfig = {
|
|
|
149
150
|
* Загрузит, а также запишет результат и переводы обратно в JSON-файлы в директории locales
|
|
150
151
|
*/
|
|
151
152
|
syncJSON({
|
|
153
|
+
format: "vue-i18n",
|
|
152
154
|
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
153
155
|
priority: 0,
|
|
154
156
|
}),
|
|
@@ -100,6 +100,7 @@ const config: IntlayerConfig = {
|
|
|
100
100
|
},
|
|
101
101
|
plugins: [
|
|
102
102
|
syncJSON({
|
|
103
|
+
format: "i18next",
|
|
103
104
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
104
105
|
}),
|
|
105
106
|
],
|
|
@@ -149,6 +150,7 @@ const config: IntlayerConfig = {
|
|
|
149
150
|
* locales dizinindeki JSON dosyalarını yükler ve çıktı ile çevirileri geri yazar
|
|
150
151
|
*/
|
|
151
152
|
syncJSON({
|
|
153
|
+
format: "i18next",
|
|
152
154
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
153
155
|
priority: 0,
|
|
154
156
|
}),
|
|
@@ -119,6 +119,7 @@ const config: IntlayerConfig = {
|
|
|
119
119
|
},
|
|
120
120
|
plugins: [
|
|
121
121
|
syncJSON({
|
|
122
|
+
format: 'i18next',
|
|
122
123
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
123
124
|
}),
|
|
124
125
|
],
|
|
@@ -170,6 +171,7 @@ const config: IntlayerConfig = {
|
|
|
170
171
|
* Yerel dizindeki JSON dosyalarına çıktıyı ve çevirileri geri yazacak ve yükleyecek
|
|
171
172
|
*/
|
|
172
173
|
syncJSON({
|
|
174
|
+
format: "i18next",
|
|
173
175
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
174
176
|
priority: 0,
|
|
175
177
|
}),
|
|
@@ -95,6 +95,7 @@ const config: IntlayerConfig = {
|
|
|
95
95
|
},
|
|
96
96
|
plugins: [
|
|
97
97
|
syncJSON({
|
|
98
|
+
format: "icu",
|
|
98
99
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
99
100
|
}),
|
|
100
101
|
],
|
|
@@ -144,6 +145,7 @@ const config: IntlayerConfig = {
|
|
|
144
145
|
* locales dizinindeki JSON dosyalarını yükler ve çıktı ile çevirileri bu dosyalara geri yazar
|
|
145
146
|
*/
|
|
146
147
|
syncJSON({
|
|
148
|
+
format: "icu",
|
|
147
149
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
148
150
|
priority: 0,
|
|
149
151
|
}),
|
|
@@ -98,6 +98,7 @@ const config: IntlayerConfig = {
|
|
|
98
98
|
},
|
|
99
99
|
plugins: [
|
|
100
100
|
syncJSON({
|
|
101
|
+
format: "i18next",
|
|
101
102
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
102
103
|
}),
|
|
103
104
|
],
|
|
@@ -147,6 +148,7 @@ const config: IntlayerConfig = {
|
|
|
147
148
|
* locales dizinindeki JSON dosyalarını yükler ve çıktı ile çevirileri geri yazar
|
|
148
149
|
*/
|
|
149
150
|
syncJSON({
|
|
151
|
+
format: "i18next",
|
|
150
152
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
151
153
|
priority: 0,
|
|
152
154
|
}),
|
|
@@ -93,6 +93,7 @@ const config: IntlayerConfig = {
|
|
|
93
93
|
},
|
|
94
94
|
plugins: [
|
|
95
95
|
syncJSON({
|
|
96
|
+
format: "icu",
|
|
96
97
|
source: ({ key, locale }) => `./intl/messages/${locale}/${key}.json`,
|
|
97
98
|
}),
|
|
98
99
|
],
|
|
@@ -142,6 +143,7 @@ const config: IntlayerConfig = {
|
|
|
142
143
|
* locales dizinindeki JSON dosyalarını yükler ve çıktı ile çevirileri geri yazar
|
|
143
144
|
*/
|
|
144
145
|
syncJSON({
|
|
146
|
+
format: "icu",
|
|
145
147
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
146
148
|
priority: 0,
|
|
147
149
|
}),
|
|
@@ -98,6 +98,7 @@ const config: IntlayerConfig = {
|
|
|
98
98
|
},
|
|
99
99
|
plugins: [
|
|
100
100
|
syncJSON({
|
|
101
|
+
format: "vue-i18n",
|
|
101
102
|
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
102
103
|
}),
|
|
103
104
|
],
|
|
@@ -149,6 +150,7 @@ const config: IntlayerConfig = {
|
|
|
149
150
|
* locales dizinindeki JSON dosyalarını yükler ve çıktı ile çevirileri geri yazar
|
|
150
151
|
*/
|
|
151
152
|
syncJSON({
|
|
153
|
+
format: "vue-i18n",
|
|
152
154
|
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
153
155
|
priority: 0,
|
|
154
156
|
}),
|
|
@@ -100,6 +100,7 @@ const config: IntlayerConfig = {
|
|
|
100
100
|
},
|
|
101
101
|
plugins: [
|
|
102
102
|
syncJSON({
|
|
103
|
+
format: "i18next",
|
|
103
104
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
104
105
|
}),
|
|
105
106
|
],
|
|
@@ -149,6 +150,7 @@ const config: IntlayerConfig = {
|
|
|
149
150
|
* Sẽ tải, và ghi đầu ra cùng các bản dịch trở lại các tệp JSON trong thư mục locales
|
|
150
151
|
*/
|
|
151
152
|
syncJSON({
|
|
153
|
+
format: "i18next",
|
|
152
154
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
153
155
|
priority: 0,
|
|
154
156
|
}),
|
|
@@ -108,6 +108,7 @@ const config: IntlayerConfig = {
|
|
|
108
108
|
},
|
|
109
109
|
plugins: [
|
|
110
110
|
syncJSON({
|
|
111
|
+
format: "i18next",
|
|
111
112
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
112
113
|
}),
|
|
113
114
|
],
|
|
@@ -159,6 +160,7 @@ const config: IntlayerConfig = {
|
|
|
159
160
|
* Sẽ tải và ghi lại đầu ra cùng các bản dịch trở lại các file JSON trong thư mục locales
|
|
160
161
|
*/
|
|
161
162
|
syncJSON({
|
|
163
|
+
format: "i18next",
|
|
162
164
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
163
165
|
priority: 0,
|
|
164
166
|
}),
|
|
@@ -95,6 +95,7 @@ const config: IntlayerConfig = {
|
|
|
95
95
|
},
|
|
96
96
|
plugins: [
|
|
97
97
|
syncJSON({
|
|
98
|
+
format: "icu",
|
|
98
99
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
99
100
|
}),
|
|
100
101
|
],
|
|
@@ -144,6 +145,7 @@ const config: IntlayerConfig = {
|
|
|
144
145
|
* Sẽ tải và ghi đầu ra cùng các bản dịch trở lại các tệp JSON trong thư mục locales
|
|
145
146
|
*/
|
|
146
147
|
syncJSON({
|
|
148
|
+
format: "icu",
|
|
147
149
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
148
150
|
priority: 0,
|
|
149
151
|
}),
|
|
@@ -98,6 +98,7 @@ const config: IntlayerConfig = {
|
|
|
98
98
|
},
|
|
99
99
|
plugins: [
|
|
100
100
|
syncJSON({
|
|
101
|
+
format: "i18next",
|
|
101
102
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
102
103
|
}),
|
|
103
104
|
],
|
|
@@ -147,6 +148,7 @@ const config: IntlayerConfig = {
|
|
|
147
148
|
* Sẽ tải và ghi đầu ra cùng các bản dịch trở lại các tệp JSON trong thư mục locales
|
|
148
149
|
*/
|
|
149
150
|
syncJSON({
|
|
151
|
+
format: "i18next",
|
|
150
152
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
151
153
|
priority: 0,
|
|
152
154
|
}),
|
|
@@ -96,6 +96,7 @@ const config: IntlayerConfig = {
|
|
|
96
96
|
},
|
|
97
97
|
plugins: [
|
|
98
98
|
syncJSON({
|
|
99
|
+
format: "icu",
|
|
99
100
|
source: ({ key, locale }) => `./intl/messages/${locale}/${key}.json`,
|
|
100
101
|
}),
|
|
101
102
|
],
|
|
@@ -145,6 +146,7 @@ const config: IntlayerConfig = {
|
|
|
145
146
|
* Sẽ tải và ghi đầu ra cùng các bản dịch trở lại các tệp JSON trong thư mục locales
|
|
146
147
|
*/
|
|
147
148
|
syncJSON({
|
|
149
|
+
format: "icu",
|
|
148
150
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
149
151
|
priority: 0,
|
|
150
152
|
}),
|
|
@@ -98,6 +98,7 @@ const config: IntlayerConfig = {
|
|
|
98
98
|
},
|
|
99
99
|
plugins: [
|
|
100
100
|
syncJSON({
|
|
101
|
+
format: "vue-i18n",
|
|
101
102
|
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
102
103
|
}),
|
|
103
104
|
],
|
|
@@ -149,6 +150,7 @@ const config: IntlayerConfig = {
|
|
|
149
150
|
* Sẽ tải và ghi đầu ra cùng các bản dịch trở lại các tệp JSON trong thư mục locales
|
|
150
151
|
*/
|
|
151
152
|
syncJSON({
|
|
153
|
+
format: "vue-i18n",
|
|
152
154
|
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
153
155
|
priority: 0,
|
|
154
156
|
}),
|
|
@@ -100,6 +100,7 @@ const config: IntlayerConfig = {
|
|
|
100
100
|
},
|
|
101
101
|
plugins: [
|
|
102
102
|
syncJSON({
|
|
103
|
+
format: "i18next",
|
|
103
104
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
104
105
|
}),
|
|
105
106
|
],
|
|
@@ -149,6 +150,7 @@ const config: IntlayerConfig = {
|
|
|
149
150
|
* 将加载并将输出和翻译写回到 locales 目录中的 JSON 文件
|
|
150
151
|
*/
|
|
151
152
|
syncJSON({
|
|
153
|
+
format: "i18next",
|
|
152
154
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
153
155
|
priority: 0,
|
|
154
156
|
}),
|
|
@@ -108,6 +108,7 @@ const config: IntlayerConfig = {
|
|
|
108
108
|
},
|
|
109
109
|
plugins: [
|
|
110
110
|
syncJSON({
|
|
111
|
+
format: "i18next",
|
|
111
112
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
112
113
|
}),
|
|
113
114
|
],
|
|
@@ -159,6 +160,7 @@ const config: IntlayerConfig = {
|
|
|
159
160
|
* 将输出和翻译写回到 locales 目录中的 JSON 文件
|
|
160
161
|
*/
|
|
161
162
|
syncJSON({
|
|
163
|
+
format: "i18next",
|
|
162
164
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
163
165
|
priority: 0,
|
|
164
166
|
}),
|
|
@@ -94,6 +94,7 @@ const config: IntlayerConfig = {
|
|
|
94
94
|
},
|
|
95
95
|
plugins: [
|
|
96
96
|
syncJSON({
|
|
97
|
+
format: "icu",
|
|
97
98
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
98
99
|
}),
|
|
99
100
|
],
|
|
@@ -144,6 +145,7 @@ const config: IntlayerConfig = {
|
|
|
144
145
|
* 将加载并将输出和翻译写回到 locales 目录中的 JSON 文件
|
|
145
146
|
*/
|
|
146
147
|
syncJSON({
|
|
148
|
+
format: "icu",
|
|
147
149
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
148
150
|
priority: 0,
|
|
149
151
|
}),
|
|
@@ -98,6 +98,7 @@ const config: IntlayerConfig = {
|
|
|
98
98
|
},
|
|
99
99
|
plugins: [
|
|
100
100
|
syncJSON({
|
|
101
|
+
format: "i18next",
|
|
101
102
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
102
103
|
}),
|
|
103
104
|
],
|
|
@@ -147,6 +148,7 @@ const config: IntlayerConfig = {
|
|
|
147
148
|
* 将加载并将输出和翻译写回到 locales 目录中的 JSON 文件
|
|
148
149
|
*/
|
|
149
150
|
syncJSON({
|
|
151
|
+
format: "i18next",
|
|
150
152
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
151
153
|
priority: 0,
|
|
152
154
|
}),
|
|
@@ -96,6 +96,7 @@ const config: IntlayerConfig = {
|
|
|
96
96
|
},
|
|
97
97
|
plugins: [
|
|
98
98
|
syncJSON({
|
|
99
|
+
format: "icu",
|
|
99
100
|
source: ({ key, locale }) => `./intl/messages/${locale}/${key}.json`,
|
|
100
101
|
}),
|
|
101
102
|
],
|
|
@@ -145,6 +146,7 @@ const config: IntlayerConfig = {
|
|
|
145
146
|
* 将加载并将输出和翻译写回 locales 目录中的 JSON 文件
|
|
146
147
|
*/
|
|
147
148
|
syncJSON({
|
|
149
|
+
format: "icu",
|
|
148
150
|
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
149
151
|
priority: 0,
|
|
150
152
|
}),
|
|
@@ -98,6 +98,7 @@ const config: IntlayerConfig = {
|
|
|
98
98
|
},
|
|
99
99
|
plugins: [
|
|
100
100
|
syncJSON({
|
|
101
|
+
format: "vue-i18n",
|
|
101
102
|
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
102
103
|
}),
|
|
103
104
|
],
|
|
@@ -149,6 +150,7 @@ const config: IntlayerConfig = {
|
|
|
149
150
|
* 将加载并将输出和翻译写回到 locales 目录中的 JSON 文件
|
|
150
151
|
*/
|
|
151
152
|
syncJSON({
|
|
153
|
+
format: "vue-i18n",
|
|
152
154
|
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
153
155
|
priority: 0,
|
|
154
156
|
}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-02-07
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-12-13
|
|
4
4
|
title: ملف المحتوى
|
|
5
5
|
description: تعلّم كيفية تخصيص الامتدادات لملفات إعلان المحتوى الخاصة بك. اتبع هذا التوثيق لتنفيذ الشروط بكفاءة في مشروعك.
|
|
6
6
|
keywords:
|
|
@@ -12,6 +12,9 @@ slugs:
|
|
|
12
12
|
- concept
|
|
13
13
|
- content
|
|
14
14
|
history:
|
|
15
|
+
- version: 7.5.0
|
|
16
|
+
date: 2025-12-13
|
|
17
|
+
changes: إضافة دعم تنسيقات ICU و i18next
|
|
15
18
|
- version: 6.0.0
|
|
16
19
|
date: 2025-09-20
|
|
17
20
|
changes: إضافة توثيق الحقول
|
|
@@ -387,6 +390,26 @@ module.exports = {
|
|
|
387
390
|
}
|
|
388
391
|
```
|
|
389
392
|
|
|
393
|
+
#### `format` ('intlayer' | 'icu' | 'i18next')
|
|
394
|
+
|
|
395
|
+
يحدد المُنسق الذي سيتم استخدامه لمحتوى القاموس. يسمح هذا باستخدام صيغ تنسيق رسائل مختلفة.
|
|
396
|
+
|
|
397
|
+
- `'intlayer'`: مُنسق Intlayer الافتراضي.
|
|
398
|
+
- `'icu'`: يستخدم تنسيق رسائل ICU.
|
|
399
|
+
- `'i18next'`: يستخدم تنسيق رسائل i18next.
|
|
400
|
+
|
|
401
|
+
**مثال:**
|
|
402
|
+
|
|
403
|
+
```typescript
|
|
404
|
+
{
|
|
405
|
+
key: "my-dictionary",
|
|
406
|
+
format: "icu",
|
|
407
|
+
content: {
|
|
408
|
+
message: "Hello {name}, you have {count, plural, one {# message} other {# messages}}"
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
390
413
|
#### `locale` (LocalesValues)
|
|
391
414
|
|
|
392
415
|
يقوم بتحويل القاموس إلى قاموس لكل لغة حيث يتم تلقائيًا تحويل كل حقل معلن في المحتوى إلى عقدة ترجمة. عند تعيين هذه الخاصية:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2024-03-07
|
|
3
3
|
updatedAt: 2025-10-03
|
|
4
4
|
title: كيفية ترجمة تطبيق Astro – دليل i18n 2025
|
|
5
|
-
description: تعلّم كيفية إضافة التدويل (i18n) إلى
|
|
5
|
+
description: تعلّم كيفية إضافة التدويل (i18n) إلى موقع Astro الخاص بك باستخدام Intlayer. اتبع هذا الدليل لجعل موقعك متعدد اللغات.
|
|
6
6
|
keywords:
|
|
7
7
|
- التدويل
|
|
8
8
|
- التوثيق
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2024-08-11
|
|
3
3
|
updatedAt: 2025-06-29
|
|
4
4
|
title: كيفية ترجمة تطبيق Express backend – دليل i18n 2025
|
|
5
|
-
description: اكتشف كيفية جعل الواجهة الخلفية لـ
|
|
5
|
+
description: اكتشف كيفية جعل الواجهة الخلفية لـ Express متعددة اللغات. اتبع الوثائق لتدويل (i18n) وترجمتها.
|
|
6
6
|
keywords:
|
|
7
7
|
- دولية
|
|
8
8
|
- توثيق
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2025-09-09
|
|
3
3
|
updatedAt: 2025-09-09
|
|
4
4
|
title: كيفية ترجمة تطبيق Nest backend – دليل i18n 2025
|
|
5
|
-
description: اكتشف كيفية جعل خلفية
|
|
5
|
+
description: اكتشف كيفية جعل خلفية NestJS الخاصة بك متعددة اللغات. اتبع الوثائق لتدويل (i18n) وترجمتها.
|
|
6
6
|
keywords:
|
|
7
7
|
- التدويل
|
|
8
8
|
- الوثائق
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-09-09
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-12-11
|
|
4
4
|
title: كيفية ترجمة تطبيق Tanstack Start – دليل i18n 2025
|
|
5
5
|
description: تعلّم كيفية إضافة التدويل (i18n) إلى تطبيق Tanstack Start الخاص بك باستخدام Intlayer. اتبع هذا الدليل الشامل لجعل تطبيقك متعدد اللغات مع توجيه يعتمد على اللغة.
|
|
6
6
|
keywords:
|
|
@@ -19,9 +19,12 @@ slugs:
|
|
|
19
19
|
applicationTemplate: https://github.com/aymericzip/intlayer-tanstack-start-template
|
|
20
20
|
youtubeVideo: https://www.youtube.com/watch?v=_XTdKVWaeqg
|
|
21
21
|
history:
|
|
22
|
+
- version: 7.4.0
|
|
23
|
+
date: 2025-12-11
|
|
24
|
+
changes: أضف validatePrefix وشرح خطوة 14: معالجة صفحات 404 مع الطرق المعتمدة على اللغة.
|
|
22
25
|
- version: 7.3.9
|
|
23
26
|
date: 2025-12-05
|
|
24
|
-
changes:
|
|
27
|
+
changes: أضف خطوة 13: كيفية جلب اللغة الحالية داخل عمليات الخادم (اختياري)
|
|
25
28
|
- version: 5.8.1
|
|
26
29
|
date: 2025-09-09
|
|
27
30
|
changes: أضيف لـ Tanstack Start
|
|
@@ -599,7 +602,123 @@ export const getLocaleServer = createServerFn().handler(async () => {
|
|
|
599
602
|
|
|
600
603
|
---
|
|
601
604
|
|
|
602
|
-
### الخطوة 14:
|
|
605
|
+
### الخطوة 14: إدارة الصفحات غير الموجودة (اختياري)
|
|
606
|
+
|
|
607
|
+
عندما يزور المستخدم صفحة غير موجودة، يمكنك عرض صفحة مخصصة "غير موجودة" وقد يؤثر بادئة اللغة على طريقة تشغيل صفحة "غير موجودة".
|
|
608
|
+
|
|
609
|
+
#### فهم معالجة 404 في TanStack Router مع بادئات اللغة
|
|
610
|
+
|
|
611
|
+
في TanStack Router، يتطلب التعامل مع صفحات 404 باستخدام المسارات المترجمة نهجًا متعدد الطبقات:
|
|
612
|
+
|
|
613
|
+
1. **مسار 404 مخصص**: مسار محدد لعرض واجهة المستخدم 404
|
|
614
|
+
2. **التحقق على مستوى المسار**: يتحقق من بادئات اللغة ويعيد توجيه غير الصالحة إلى 404
|
|
615
|
+
3. **مسار catch-all**: يلتقط أي مسارات غير متطابقة داخل مقطع اللغة
|
|
616
|
+
|
|
617
|
+
```tsx fileName="src/routes/{-$locale}/404.tsx"
|
|
618
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
619
|
+
|
|
620
|
+
// هذا ينشئ مسارًا مخصصًا /[locale]/404
|
|
621
|
+
// يتم استخدامه كمسار مباشر واستيراده كعنصر في ملفات أخرى
|
|
622
|
+
export const Route = createFileRoute("/{-$locale}/404")({
|
|
623
|
+
component: NotFoundComponent,
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
// يتم تصديره بشكل منفصل حتى يمكن إعادة استخدامه في notFoundComponent والمسارات catch-all
|
|
627
|
+
export function NotFoundComponent() {
|
|
628
|
+
return (
|
|
629
|
+
<div>
|
|
630
|
+
<h1>404</h1>
|
|
631
|
+
</div>
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
```tsx fileName="src/routes/{-$locale}/route.tsx"
|
|
637
|
+
import { createFileRoute, Outlet, redirect } from "@tanstack/react-router";
|
|
638
|
+
import { validatePrefix } from "intlayer";
|
|
639
|
+
import { IntlayerProvider, useLocale } from "react-intlayer";
|
|
640
|
+
|
|
641
|
+
import { LocaleSwitcher } from "@/components/locale-switcher";
|
|
642
|
+
import { NotFoundComponent } from "./404";
|
|
643
|
+
|
|
644
|
+
export const Route = createFileRoute("/{-$locale}")({
|
|
645
|
+
// beforeLoad يعمل قبل عرض المسار (على كل من الخادم والعميل)
|
|
646
|
+
// إنه المكان المثالي للتحقق من بادئة اللغة
|
|
647
|
+
beforeLoad: ({ params }) => {
|
|
648
|
+
// الحصول على اللغة من معاملات المسار (وليس من رؤوس الخادم، حيث يعمل beforeLoad على كل من العميل والخادم)
|
|
649
|
+
const localeParam = params.locale;
|
|
650
|
+
|
|
651
|
+
// validatePrefix يتحقق مما إذا كانت اللغة صالحة وفقًا لتكوين intlayer الخاص بك
|
|
652
|
+
// إرجاع: { isValid: boolean, localePrefix: string }
|
|
653
|
+
// - isValid: true إذا كانت البادئة تطابق لغة مُكوَّنة (أو فارغة عندما تكون البادئة اختيارية)
|
|
654
|
+
// - localePrefix: البادئة المُتحقق منها أو بادئة اللغة الافتراضية لإعادة التوجيه
|
|
655
|
+
const { isValid, localePrefix } = validatePrefix(localeParam);
|
|
656
|
+
|
|
657
|
+
if (isValid) {
|
|
658
|
+
// اللغة صالحة، السماح للمسار بالعرض بشكل طبيعي
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// بادئة لغة غير صالحة (على سبيل المثال، /xyz/about حيث "xyz" ليست لغة صالحة)
|
|
663
|
+
// إعادة التوجيه إلى صفحة 404 ببادئة لغة صالحة
|
|
664
|
+
// يضمن هذا أن صفحة 404 لا تزال محلية بشكل صحيح
|
|
665
|
+
throw redirect({
|
|
666
|
+
to: "/{-$locale}/404",
|
|
667
|
+
params: { locale: localePrefix },
|
|
668
|
+
});
|
|
669
|
+
},
|
|
670
|
+
component: RouteComponent,
|
|
671
|
+
// يتم استدعاء notFoundComponent عندما لا يوجد مسار فرعي
|
|
672
|
+
// على سبيل المثال، /en/صفحة-غير-موجودة يطلق هذا داخل تخطيط /en
|
|
673
|
+
notFoundComponent: NotFoundLayout,
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
function RouteComponent() {
|
|
677
|
+
const { defaultLocale } = useLocale();
|
|
678
|
+
const { locale } = Route.useParams();
|
|
679
|
+
|
|
680
|
+
return (
|
|
681
|
+
// لف كامل مقطع اللغة بـ IntlayerProvider
|
|
682
|
+
// يعود إلى defaultLocale عندما تكون معلمة اللغة undefined (وضع البادئة الاختياري)
|
|
683
|
+
<IntlayerProvider locale={locale ?? defaultLocale}>
|
|
684
|
+
<Outlet />
|
|
685
|
+
</IntlayerProvider>
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// NotFoundLayout يلف عنصر 404 بـ IntlayerProvider
|
|
690
|
+
// يضمن هذا أن الترجمات لا تزال تعمل على صفحة 404
|
|
691
|
+
function NotFoundLayout() {
|
|
692
|
+
const { defaultLocale } = useLocale();
|
|
693
|
+
const { locale } = Route.useParams();
|
|
694
|
+
|
|
695
|
+
return (
|
|
696
|
+
<IntlayerProvider locale={locale ?? defaultLocale}>
|
|
697
|
+
<NotFoundComponent />
|
|
698
|
+
{/* تضمين LocaleSwitcher حتى يتمكن المستخدمون من تغيير اللغة حتى على 404 */}
|
|
699
|
+
<LocaleSwitcher />
|
|
700
|
+
</IntlayerProvider>
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
```tsx fileName="src/routes/{-$locale}/$.tsx"
|
|
706
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
707
|
+
|
|
708
|
+
import { NotFoundComponent } from "./404";
|
|
709
|
+
|
|
710
|
+
// المسار $ (splat/catch-all) يطابق أي مسار لا يطابق المسارات الأخرى
|
|
711
|
+
// على سبيل المثال، /en/بعض/المسار/المتداخل/بعمق/غير-صالح
|
|
712
|
+
// يضمن هذا أن جميع المسارات غير المتطابقة داخل اللغة تعرض صفحة 404
|
|
713
|
+
// بدون هذا، قد تعرض المسارات العميقة غير المتطابقة صفحة فارغة أو خطأ
|
|
714
|
+
export const Route = createFileRoute("/{-$locale}/$")({
|
|
715
|
+
component: NotFoundComponent,
|
|
716
|
+
});
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
---
|
|
720
|
+
|
|
721
|
+
### الخطوة 15: تكوين TypeScript (اختياري)
|
|
603
722
|
|
|
604
723
|
يستخدم Intlayer توسيع الوحدات (module augmentation) للاستفادة من TypeScript وجعل قاعدة الشيفرة الخاصة بك أقوى.
|
|
605
724
|
|