@intlayer/docs 8.4.0 → 8.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blog/ar/per-component_vs_centralized_i18n.md +1 -1
- package/blog/de/i18n_using_next-i18next.md +1 -1
- package/blog/de/i18n_using_next-intl.md +1 -1
- package/blog/de/per-component_vs_centralized_i18n.md +1 -1
- package/blog/en/___per-component_vs_centralized_i18n.md +1 -1
- package/blog/en/per-component_vs_centralized_i18n.md +1 -1
- package/blog/en-GB/per-component_vs_centralized_i18n.md +1 -1
- package/blog/es/per-component_vs_centralized_i18n.md +1 -1
- package/blog/fr/i18n_using_next-i18next.md +1 -1
- package/blog/fr/i18n_using_next-intl.md +1 -1
- package/blog/fr/per-component_vs_centralized_i18n.md +1 -1
- package/blog/hi/i18n_using_next-i18next.md +1 -1
- package/blog/hi/i18n_using_next-intl.md +1 -1
- package/blog/hi/per-component_vs_centralized_i18n.md +1 -1
- package/blog/id/per-component_vs_centralized_i18n.md +1 -1
- package/blog/ja/per-component_vs_centralized_i18n.md +1 -1
- package/blog/ko/i18n_using_next-i18next.md +1 -1
- package/blog/ko/i18n_using_next-intl.md +1 -1
- package/blog/ko/per-component_vs_centralized_i18n.md +1 -1
- package/blog/pl/per-component_vs_centralized_i18n.md +1 -1
- package/blog/pt/per-component_vs_centralized_i18n.md +1 -1
- package/blog/ru/per-component_vs_centralized_i18n.md +1 -1
- package/blog/tr/i18n_using_next-i18next.md +1 -1
- package/blog/tr/i18n_using_next-intl.md +1 -1
- package/blog/tr/per-component_vs_centralized_i18n.md +1 -1
- package/blog/uk/per-component_vs_centralized_i18n.md +2 -2
- package/blog/vi/per-component_vs_centralized_i18n.md +1 -1
- package/dist/cjs/blog.cjs +1 -1
- package/dist/cjs/blog.cjs.map +1 -1
- package/dist/cjs/common-a-l0ULP6.cjs +2 -0
- package/dist/cjs/common-a-l0ULP6.cjs.map +1 -0
- package/dist/cjs/common.cjs +1 -2
- package/dist/cjs/doc.cjs +1 -1
- package/dist/cjs/doc.cjs.map +1 -1
- package/dist/cjs/frequentQuestions.cjs +1 -1
- package/dist/cjs/frequentQuestions.cjs.map +1 -1
- package/dist/cjs/generated/blog.entry.cjs +1 -1
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +1 -1
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +1 -1
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/cjs/legal.cjs +1 -1
- package/dist/cjs/legal.cjs.map +1 -1
- package/dist/types/blog.d.ts +2 -2
- package/dist/types/blog.entry-D5IgxPXY.d.ts +35 -0
- package/dist/types/blog.entry-D5IgxPXY.d.ts.map +1 -0
- package/dist/types/common-B45TZvLQ.d.ts +37 -0
- package/dist/types/common-B45TZvLQ.d.ts.map +1 -0
- package/dist/types/common.d.ts +2 -37
- package/dist/types/doc.d.ts +2 -2
- package/dist/types/docs.entry-CergjAYt.d.ts +157 -0
- package/dist/types/docs.entry-CergjAYt.d.ts.map +1 -0
- package/dist/types/frequentQuestions.d.ts +2 -2
- package/dist/types/frequentQuestions.entry-BHglVS-U.d.ts +24 -0
- package/dist/types/frequentQuestions.entry-BHglVS-U.d.ts.map +1 -0
- package/dist/types/generated/blog.entry.d.ts +2 -35
- package/dist/types/generated/docs.entry.d.ts +2 -157
- package/dist/types/generated/frequentQuestions.entry.d.ts +2 -24
- package/dist/types/generated/legal.entry.d.ts +2 -10
- package/dist/types/legal.d.ts +2 -2
- package/dist/types/legal.entry-B5Lg5eeH.d.ts +10 -0
- package/dist/types/legal.entry-B5Lg5eeH.d.ts.map +1 -0
- package/docs/ar/intlayer_with_adonisjs.md +3 -3
- package/docs/ar/intlayer_with_svelte_kit.md +5 -12
- package/docs/ar/intlayer_with_tanstack.md +3 -3
- package/docs/de/intlayer_with_adonisjs.md +3 -3
- package/docs/de/intlayer_with_svelte_kit.md +5 -12
- package/docs/de/intlayer_with_tanstack.md +3 -3
- package/docs/en/intlayer_with_adonisjs.md +3 -3
- package/docs/en/intlayer_with_svelte_kit.md +5 -12
- package/docs/en/intlayer_with_tanstack.md +3 -3
- package/docs/en-GB/intlayer_with_adonisjs.md +3 -3
- package/docs/en-GB/intlayer_with_svelte_kit.md +9 -10
- package/docs/en-GB/intlayer_with_tanstack.md +3 -3
- package/docs/es/intlayer_with_adonisjs.md +3 -3
- package/docs/es/intlayer_with_svelte_kit.md +5 -12
- package/docs/es/intlayer_with_tanstack.md +3 -3
- package/docs/fr/intlayer_with_adonisjs.md +3 -3
- package/docs/fr/intlayer_with_svelte_kit.md +5 -12
- package/docs/hi/intlayer_with_adonisjs.md +3 -3
- package/docs/hi/intlayer_with_svelte_kit.md +5 -12
- package/docs/hi/intlayer_with_tanstack.md +3 -3
- package/docs/id/intlayer_with_adonisjs.md +3 -3
- package/docs/id/intlayer_with_svelte_kit.md +5 -12
- package/docs/id/intlayer_with_tanstack.md +3 -3
- package/docs/it/intlayer_with_adonisjs.md +3 -3
- package/docs/it/intlayer_with_svelte_kit.md +5 -12
- package/docs/it/intlayer_with_tanstack.md +3 -3
- package/docs/ja/intlayer_with_adonisjs.md +3 -3
- package/docs/ko/intlayer_with_adonisjs.md +3 -3
- package/docs/ko/intlayer_with_svelte_kit.md +5 -12
- package/docs/ko/intlayer_with_tanstack.md +3 -3
- package/docs/pl/intlayer_with_svelte_kit.md +5 -12
- package/docs/pl/intlayer_with_tanstack.md +3 -3
- package/docs/pt/intlayer_with_adonisjs.md +3 -3
- package/docs/pt/intlayer_with_svelte_kit.md +5 -12
- package/docs/pt/intlayer_with_tanstack.md +3 -3
- package/docs/ru/intlayer_with_adonisjs.md +3 -3
- package/docs/ru/intlayer_with_svelte_kit.md +5 -12
- package/docs/ru/intlayer_with_tanstack.md +3 -3
- package/docs/ru/packages/intlayer/getCanonicalPath.md +1 -1
- package/docs/tr/intlayer_with_adonisjs.md +3 -3
- package/docs/tr/intlayer_with_svelte_kit.md +5 -12
- package/docs/tr/intlayer_with_tanstack.md +3 -3
- package/docs/uk/intlayer_with_adonisjs.md +3 -3
- package/docs/uk/intlayer_with_svelte_kit.md +5 -12
- package/docs/uk/intlayer_with_tanstack.md +3 -3
- package/docs/uk/packages/express-intlayer/t.md +1 -1
- package/docs/uk/packages/intlayer/getHTMLTextDir.md +1 -1
- package/docs/uk/packages/intlayer/getLocalizedUrl.md +1 -1
- package/docs/uk/packages/react-intlayer/t.md +1 -1
- package/docs/vi/intlayer_with_adonisjs.md +2 -2
- package/docs/vi/intlayer_with_svelte_kit.md +5 -12
- package/docs/vi/intlayer_with_tanstack.md +3 -3
- package/docs/zh/intlayer_with_adonisjs.md +3 -3
- package/docs/zh/intlayer_with_svelte_kit.md +5 -12
- package/docs/zh/intlayer_with_tanstack.md +3 -3
- package/frequent_questions/fr/error-vite-env-only.md +1 -1
- package/frequent_questions/id/error-vite-env-only.md +1 -1
- package/frequent_questions/pl/error-vite-env-only.md +1 -1
- package/frequent_questions/pt/error-vite-env-only.md +1 -1
- package/package.json +7 -7
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +0 -1
- package/dist/cjs/common.cjs.map +0 -1
- package/dist/types/common.d.ts.map +0 -1
- package/dist/types/generated/blog.entry.d.ts.map +0 -1
- package/dist/types/generated/docs.entry.d.ts.map +0 -1
- package/dist/types/generated/frequentQuestions.entry.d.ts.map +0 -1
- package/dist/types/generated/legal.entry.d.ts.map +0 -1
|
@@ -14,7 +14,7 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- adonisjs
|
|
17
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-adonis-template
|
|
18
18
|
history:
|
|
19
19
|
- version: 8.0.0
|
|
20
20
|
date: 2025-12-30
|
|
@@ -42,14 +42,14 @@ history:
|
|
|
42
42
|
## 시작하기
|
|
43
43
|
|
|
44
44
|
<iframe
|
|
45
|
-
src="https://stackblitz.com/github/aymericzip/intlayer-
|
|
45
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-adonis-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
46
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
47
|
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
48
48
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
49
49
|
loading="lazy"
|
|
50
50
|
/>
|
|
51
51
|
|
|
52
|
-
See [Application Template](https://github.com/aymericzip/intlayer-
|
|
52
|
+
See [Application Template](https://github.com/aymericzip/intlayer-adonis-template) on GitHub.
|
|
53
53
|
|
|
54
54
|
### 설치
|
|
55
55
|
|
|
@@ -494,14 +494,9 @@ export const getLocale = (event: RequestEvent): Locale => {
|
|
|
494
494
|
|
|
495
495
|
로케일이 구성되지 않은 경우 404 오류를 반환하고자 합니다. 이를 쉽게 하기 위해 로케일이 유효한지 확인하는 `match` 함수를 만들 수 있습니다:
|
|
496
496
|
|
|
497
|
-
```ts fileName="/src/params/locale.ts"
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
export const match = (
|
|
501
|
-
param: Locale = configuration.internationalization.defaultLocale
|
|
502
|
-
): boolean => {
|
|
503
|
-
return configuration.internationalization.locales.includes(param);
|
|
504
|
-
};
|
|
497
|
+
```ts fileName="/src/params/locale.ts"import { defaultLocale, locales, type Locale } from "intlayer";
|
|
498
|
+
export const match = (param: Locale = defaultLocale): boolean =>
|
|
499
|
+
locales.includes(param);
|
|
505
500
|
```
|
|
506
501
|
|
|
507
502
|
> **참고:** `src/app.d.ts` 파일에 로케일 정의가 포함되어 있는지 확인하세요:
|
|
@@ -540,15 +535,13 @@ export const match = (
|
|
|
540
535
|
|
|
541
536
|
```ts fileName="src/routes/[[locale=locale]]/+layout.ts"
|
|
542
537
|
import type { Load } from "@sveltejs/kit";
|
|
543
|
-
import {
|
|
538
|
+
import { defaultLocale, type Locale } from "intlayer";
|
|
544
539
|
|
|
545
540
|
export const prerender = true;
|
|
546
541
|
|
|
547
542
|
// 제네릭 Load 타입 사용
|
|
548
543
|
export const load: Load = ({ params }) => {
|
|
549
|
-
const locale: Locale =
|
|
550
|
-
(params.locale as Locale) ??
|
|
551
|
-
configuration.internationalization.defaultLocale;
|
|
544
|
+
const locale: Locale = (params.locale as Locale) ?? defaultLocale;
|
|
552
545
|
|
|
553
546
|
return {
|
|
554
547
|
locale,
|
|
@@ -24,13 +24,13 @@ history:
|
|
|
24
24
|
changes: init 명령어 추가
|
|
25
25
|
- version: 7.4.0
|
|
26
26
|
date: 2025-12-11
|
|
27
|
-
changes: validatePrefix를 도입하고 14단계: 현지화된 경로로 404 페이지 처리하기 추가.
|
|
27
|
+
changes: "validatePrefix를 도입하고 14단계: 현지화된 경로로 404 페이지 처리하기 추가."
|
|
28
28
|
- version: 7.3.9
|
|
29
29
|
date: 2025-12-05
|
|
30
|
-
changes: 13단계: 서버 액션에서 로케일 가져오기(선택 사항) 추가.
|
|
30
|
+
changes: "13단계: 서버 액션에서 로케일 가져오기(선택 사항) 추가."
|
|
31
31
|
- version: 7.2.3
|
|
32
32
|
date: 2025-11-18
|
|
33
|
-
changes: 13단계: Nitro 적응 추가.
|
|
33
|
+
changes: "13단계: Nitro 적응 추가."
|
|
34
34
|
- version: 7.1.0
|
|
35
35
|
date: 2025-11-17
|
|
36
36
|
changes: getPrefix 함수를 추가하여 기본 접두사 수정, useLocalizedNavigate, LocaleSwitcher 및 LocalizedLink 사용.
|
|
@@ -496,14 +496,9 @@ export const getLocale = (event: RequestEvent): Locale => {
|
|
|
496
496
|
|
|
497
497
|
Jeśli lokalizacja nie jest skonfigurowana, chcemy zwrócić błąd 404. Aby to ułatwić, możemy stworzyć funkcję `match`, która sprawdzi, czy lokalizacja jest poprawna:
|
|
498
498
|
|
|
499
|
-
```ts fileName="/src/params/locale.ts"
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
export const match = (
|
|
503
|
-
param: Locale = configuration.internationalization.defaultLocale
|
|
504
|
-
): boolean => {
|
|
505
|
-
return configuration.internationalization.locales.includes(param);
|
|
506
|
-
};
|
|
499
|
+
```ts fileName="/src/params/locale.ts"import { defaultLocale, locales, type Locale } from "intlayer";
|
|
500
|
+
export const match = (param: Locale = defaultLocale): boolean =>
|
|
501
|
+
locales.includes(param);
|
|
507
502
|
```
|
|
508
503
|
|
|
509
504
|
> **Uwaga:** Upewnij się, że Twój plik `src/app.d.ts` zawiera definicję lokalizacji:
|
|
@@ -542,15 +537,13 @@ Następnie utwórz nową stronę i layout w grupie `[[locale=locale]]`:
|
|
|
542
537
|
|
|
543
538
|
```ts fileName="src/routes/[[locale=locale]]/+layout.ts"
|
|
544
539
|
import type { Load } from "@sveltejs/kit";
|
|
545
|
-
import {
|
|
540
|
+
import { defaultLocale, type Locale } from "intlayer";
|
|
546
541
|
|
|
547
542
|
export const prerender = true;
|
|
548
543
|
|
|
549
544
|
// Użyj generycznego typu Load
|
|
550
545
|
export const load: Load = ({ params }) => {
|
|
551
|
-
const locale: Locale =
|
|
552
|
-
(params.locale as Locale) ??
|
|
553
|
-
configuration.internationalization.defaultLocale;
|
|
546
|
+
const locale: Locale = (params.locale as Locale) ?? defaultLocale;
|
|
554
547
|
|
|
555
548
|
return {
|
|
556
549
|
locale,
|
|
@@ -24,13 +24,13 @@ history:
|
|
|
24
24
|
changes: Dodaj polecenie init
|
|
25
25
|
- version: 7.4.0
|
|
26
26
|
date: 2025-12-11
|
|
27
|
-
changes: Wprowadzenie validatePrefix oraz dodanie kroku 14: Obsługa stron 404 z lokalizowanymi trasami.
|
|
27
|
+
changes: "Wprowadzenie validatePrefix oraz dodanie kroku 14: Obsługa stron 404 z lokalizowanymi trasami."
|
|
28
28
|
- version: 7.3.9
|
|
29
29
|
date: 2025-12-05
|
|
30
|
-
changes: Dodany krok 13: Pobieranie lokalizacji w akcjach serwerowych (Opcjonalnie)
|
|
30
|
+
changes: "Dodany krok 13: Pobieranie lokalizacji w akcjach serwerowych (Opcjonalnie)"
|
|
31
31
|
- version: 7.2.3
|
|
32
32
|
date: 2025-11-18
|
|
33
|
-
changes: Dodaj krok 13: Adaptacja Nitro
|
|
33
|
+
changes: "Dodaj krok 13: Adaptacja Nitro"
|
|
34
34
|
- version: 7.1.0
|
|
35
35
|
date: 2025-11-17
|
|
36
36
|
changes: Naprawienie domyślnego prefiksu poprzez dodanie funkcji getPrefix useLocalizedNavigate, LocaleSwitcher i LocalizedLink.
|
|
@@ -14,7 +14,7 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- adonisjs
|
|
17
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-adonis-template
|
|
18
18
|
history:
|
|
19
19
|
- version: 8.0.0
|
|
20
20
|
date: 2025-12-30
|
|
@@ -42,14 +42,14 @@ Ao internacionalizar o backend, sua aplicação não apenas respeita as diferen
|
|
|
42
42
|
## Primeiros Passos
|
|
43
43
|
|
|
44
44
|
<iframe
|
|
45
|
-
src="https://stackblitz.com/github/aymericzip/intlayer-
|
|
45
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-adonis-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
46
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
47
|
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
48
48
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
49
49
|
loading="lazy"
|
|
50
50
|
/>
|
|
51
51
|
|
|
52
|
-
See [Application Template](https://github.com/aymericzip/intlayer-
|
|
52
|
+
See [Application Template](https://github.com/aymericzip/intlayer-adonis-template) on GitHub.
|
|
53
53
|
|
|
54
54
|
### Instalação
|
|
55
55
|
|
|
@@ -496,14 +496,9 @@ export const getLocale = (event: RequestEvent): Locale => {
|
|
|
496
496
|
|
|
497
497
|
Se o locale não estiver configurado, queremos retornar um erro 404. Para facilitar, podemos criar uma função `match` para verificar se o locale é válido:
|
|
498
498
|
|
|
499
|
-
```ts fileName="/src/params/locale.ts"
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
export const match = (
|
|
503
|
-
param: Locale = configuration.internationalization.defaultLocale
|
|
504
|
-
): boolean => {
|
|
505
|
-
return configuration.internationalization.locales.includes(param);
|
|
506
|
-
};
|
|
499
|
+
```ts fileName="/src/params/locale.ts"import { defaultLocale, locales, type Locale } from "intlayer";
|
|
500
|
+
export const match = (param: Locale = defaultLocale): boolean =>
|
|
501
|
+
locales.includes(param);
|
|
507
502
|
```
|
|
508
503
|
|
|
509
504
|
> **Nota:** Certifique-se de que seu arquivo `src/app.d.ts` inclua a definição do locale:
|
|
@@ -542,15 +537,13 @@ Em seguida, crie uma nova página e layout dentro do grupo `[[locale=locale]]`:
|
|
|
542
537
|
|
|
543
538
|
```ts fileName="src/routes/[[locale=locale]]/+layout.ts"
|
|
544
539
|
import type { Load } from "@sveltejs/kit";
|
|
545
|
-
import {
|
|
540
|
+
import { defaultLocale, type Locale } from "intlayer";
|
|
546
541
|
|
|
547
542
|
export const prerender = true;
|
|
548
543
|
|
|
549
544
|
// Use o tipo genérico Load
|
|
550
545
|
export const load: Load = ({ params }) => {
|
|
551
|
-
const locale: Locale =
|
|
552
|
-
(params.locale as Locale) ??
|
|
553
|
-
configuration.internationalization.defaultLocale;
|
|
546
|
+
const locale: Locale = (params.locale as Locale) ?? defaultLocale;
|
|
554
547
|
|
|
555
548
|
return {
|
|
556
549
|
locale,
|
|
@@ -24,13 +24,13 @@ history:
|
|
|
24
24
|
changes: Adicionar comando init
|
|
25
25
|
- version: 7.4.0
|
|
26
26
|
date: 2025-12-11
|
|
27
|
-
changes: Introduz validatePrefix e adiciona o passo 14: Tratamento de páginas 404 com rotas localizadas.
|
|
27
|
+
changes: "Introduz validatePrefix e adiciona o passo 14: Tratamento de páginas 404 com rotas localizadas."
|
|
28
28
|
- version: 7.3.9
|
|
29
29
|
date: 2025-12-05
|
|
30
|
-
changes: Adiciona o passo 13: Recuperar o locale em suas server actions (Opcional)
|
|
30
|
+
changes: "Adiciona o passo 13: Recuperar o locale em suas server actions (Opcional)"
|
|
31
31
|
- version: 7.2.3
|
|
32
32
|
date: 2025-11-18
|
|
33
|
-
changes: Adiciona o passo 13: Adaptar Nitro
|
|
33
|
+
changes: "Adiciona o passo 13: Adaptar Nitro"
|
|
34
34
|
- version: 7.1.0
|
|
35
35
|
date: 2025-11-17
|
|
36
36
|
changes: Fix prefix default ao adicionar a função getPrefix useLocalizedNavigate, LocaleSwitcher e LocalizedLink.
|
|
@@ -14,7 +14,7 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- adonisjs
|
|
17
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-adonis-template
|
|
18
18
|
history:
|
|
19
19
|
- version: 8.0.0
|
|
20
20
|
date: 2025-12-30
|
|
@@ -42,14 +42,14 @@ history:
|
|
|
42
42
|
## Начало работы
|
|
43
43
|
|
|
44
44
|
<iframe
|
|
45
|
-
src="https://stackblitz.com/github/aymericzip/intlayer-
|
|
45
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-adonis-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
46
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
47
|
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
48
48
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
49
49
|
loading="lazy"
|
|
50
50
|
/>
|
|
51
51
|
|
|
52
|
-
See [Application Template](https://github.com/aymericzip/intlayer-
|
|
52
|
+
See [Application Template](https://github.com/aymericzip/intlayer-adonis-template) on GitHub.
|
|
53
53
|
|
|
54
54
|
### Установка
|
|
55
55
|
|
|
@@ -494,14 +494,9 @@ export const getLocale = (event: RequestEvent): Locale => {
|
|
|
494
494
|
|
|
495
495
|
Если локаль не настроена, мы хотим возвращать ошибку 404. Чтобы упростить это, можно создать функцию `match` для проверки валидности локали:
|
|
496
496
|
|
|
497
|
-
```ts fileName="/src/params/locale.ts"
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
export const match = (
|
|
501
|
-
param: Locale = configuration.internationalization.defaultLocale
|
|
502
|
-
): boolean => {
|
|
503
|
-
return configuration.internationalization.locales.includes(param);
|
|
504
|
-
};
|
|
497
|
+
```ts fileName="/src/params/locale.ts"import { defaultLocale, locales, type Locale } from "intlayer";
|
|
498
|
+
export const match = (param: Locale = defaultLocale): boolean =>
|
|
499
|
+
locales.includes(param);
|
|
505
500
|
```
|
|
506
501
|
|
|
507
502
|
> **Примечание:** Убедитесь, что в вашем файле `src/app.d.ts` определена локаль:
|
|
@@ -540,15 +535,13 @@ export const match = (
|
|
|
540
535
|
|
|
541
536
|
```ts fileName="src/routes/[[locale=locale]]/+layout.ts"
|
|
542
537
|
import type { Load } from "@sveltejs/kit";
|
|
543
|
-
import {
|
|
538
|
+
import { defaultLocale, type Locale } from "intlayer";
|
|
544
539
|
|
|
545
540
|
export const prerender = true;
|
|
546
541
|
|
|
547
542
|
// Используем универсальный тип Load
|
|
548
543
|
export const load: Load = ({ params }) => {
|
|
549
|
-
const locale: Locale =
|
|
550
|
-
(params.locale as Locale) ??
|
|
551
|
-
configuration.internationalization.defaultLocale;
|
|
544
|
+
const locale: Locale = (params.locale as Locale) ?? defaultLocale;
|
|
552
545
|
|
|
553
546
|
return {
|
|
554
547
|
locale,
|
|
@@ -24,13 +24,13 @@ history:
|
|
|
24
24
|
changes: Добавить команду init
|
|
25
25
|
- version: 7.4.0
|
|
26
26
|
date: 2025-12-11
|
|
27
|
-
changes: Внедрена validatePrefix и добавлен шаг 14: Обработка страниц 404 с локализованными маршрутами.
|
|
27
|
+
changes: "Внедрена validatePrefix и добавлен шаг 14: Обработка страниц 404 с локализованными маршрутами."
|
|
28
28
|
- version: 7.3.9
|
|
29
29
|
date: 2025-12-05
|
|
30
|
-
changes: Добавлен шаг 13: Получение текущей локали в ваших server actions (опционально)
|
|
30
|
+
changes: "Добавлен шаг 13: Получение текущей локали в ваших server actions (опционально)"
|
|
31
31
|
- version: 7.2.3
|
|
32
32
|
date: 2025-11-18
|
|
33
|
-
changes: Добавить шаг 13: Адаптация Nitro
|
|
33
|
+
changes: "Добавить шаг 13: Адаптация Nitro"
|
|
34
34
|
- version: 7.1.0
|
|
35
35
|
date: 2025-11-17
|
|
36
36
|
changes: Исправлено значение префикса по умолчанию путем добавления функции getPrefix useLocalizedNavigate, LocaleSwitcher и LocalizedLink.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2026-01-22
|
|
3
3
|
updatedAt: 2026-01-22
|
|
4
|
-
title: Документация: функция getCanonicalPath | intlayer
|
|
4
|
+
title: "Документация: функция getCanonicalPath | intlayer"
|
|
5
5
|
description: Инструкция по использованию функции getCanonicalPath в пакете intlayer
|
|
6
6
|
keywords:
|
|
7
7
|
- getCanonicalPath
|
|
@@ -14,7 +14,7 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- adonisjs
|
|
17
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-adonis-template
|
|
18
18
|
history:
|
|
19
19
|
- version: 8.0.0
|
|
20
20
|
date: 2025-12-30
|
|
@@ -42,14 +42,14 @@ Backend'i uluslararasılaştırarak, uygulamanız sadece kültürel farklılıkl
|
|
|
42
42
|
## Başlarken
|
|
43
43
|
|
|
44
44
|
<iframe
|
|
45
|
-
src="https://stackblitz.com/github/aymericzip/intlayer-
|
|
45
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-adonis-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
46
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
47
|
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
48
48
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
49
49
|
loading="lazy"
|
|
50
50
|
/>
|
|
51
51
|
|
|
52
|
-
See [Application Template](https://github.com/aymericzip/intlayer-
|
|
52
|
+
See [Application Template](https://github.com/aymericzip/intlayer-adonis-template) on GitHub.
|
|
53
53
|
|
|
54
54
|
### Kurulum
|
|
55
55
|
|
|
@@ -494,14 +494,9 @@ export const getLocale = (event: RequestEvent): Locale => {
|
|
|
494
494
|
|
|
495
495
|
Eğer yerel ayar yapılandırılmamışsa, 404 hatası döndürmek isteriz. Bunu kolaylaştırmak için, yerel ayarın geçerli olup olmadığını kontrol eden bir `match` fonksiyonu oluşturabiliriz:
|
|
496
496
|
|
|
497
|
-
```ts fileName="/src/params/locale.ts"
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
export const match = (
|
|
501
|
-
param: Locale = configuration.internationalization.defaultLocale
|
|
502
|
-
): boolean => {
|
|
503
|
-
return configuration.internationalization.locales.includes(param);
|
|
504
|
-
};
|
|
497
|
+
```ts fileName="/src/params/locale.ts"import { defaultLocale, locales, type Locale } from "intlayer";
|
|
498
|
+
export const match = (param: Locale = defaultLocale): boolean =>
|
|
499
|
+
locales.includes(param);
|
|
505
500
|
```
|
|
506
501
|
|
|
507
502
|
> **Not:** `src/app.d.ts` dosyanızın yerel ayar tanımını içerdiğinden emin olun:
|
|
@@ -540,15 +535,13 @@ Sonra, `[[locale=locale]]` grubu altında yeni bir sayfa ve layout oluşturun:
|
|
|
540
535
|
|
|
541
536
|
```ts fileName="src/routes/[[locale=locale]]/+layout.ts"
|
|
542
537
|
import type { Load } from "@sveltejs/kit";
|
|
543
|
-
import {
|
|
538
|
+
import { defaultLocale, type Locale } from "intlayer";
|
|
544
539
|
|
|
545
540
|
export const prerender = true;
|
|
546
541
|
|
|
547
542
|
// Genel Load tipini kullan
|
|
548
543
|
export const load: Load = ({ params }) => {
|
|
549
|
-
const locale: Locale =
|
|
550
|
-
(params.locale as Locale) ??
|
|
551
|
-
configuration.internationalization.defaultLocale;
|
|
544
|
+
const locale: Locale = (params.locale as Locale) ?? defaultLocale;
|
|
552
545
|
|
|
553
546
|
return {
|
|
554
547
|
locale,
|
|
@@ -24,13 +24,13 @@ history:
|
|
|
24
24
|
changes: init komutu ekle
|
|
25
25
|
- version: 7.4.0
|
|
26
26
|
date: 2025-12-11
|
|
27
|
-
changes: validatePrefix'i tanıt ve 14. adımı ekle: Yerelleştirilmiş rotalarla 404 sayfalarını ele alma.
|
|
27
|
+
changes: "validatePrefix'i tanıt ve 14. adımı ekle: Yerelleştirilmiş rotalarla 404 sayfalarını ele alma."
|
|
28
28
|
- version: 7.3.9
|
|
29
29
|
date: 2025-12-05
|
|
30
|
-
changes: 13. adımı ekle: Sunucu işlemlerinde locale bilgisini almak (Opsiyonel)
|
|
30
|
+
changes: "13. adımı ekle: Sunucu işlemlerinde locale bilgisini almak (Opsiyonel)"
|
|
31
31
|
- version: 7.2.3
|
|
32
32
|
date: 2025-11-18
|
|
33
|
-
changes: 13. adımı ekle: Nitro'yu uyarla
|
|
33
|
+
changes: "13. adımı ekle: Nitro'yu uyarla"
|
|
34
34
|
- version: 7.1.0
|
|
35
35
|
date: 2025-11-17
|
|
36
36
|
changes: getPrefix fonksiyonunu ekleyerek useLocalizedNavigate, LocaleSwitcher ve LocalizedLink için önek varsayılanını düzelt.
|
|
@@ -14,7 +14,7 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- adonisjs
|
|
17
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-adonis-template
|
|
18
18
|
history:
|
|
19
19
|
- version: 8.0.0
|
|
20
20
|
date: 2025-12-30
|
|
@@ -42,14 +42,14 @@ history:
|
|
|
42
42
|
## Початок роботи
|
|
43
43
|
|
|
44
44
|
<iframe
|
|
45
|
-
src="https://stackblitz.com/github/aymericzip/intlayer-
|
|
45
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-adonis-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
46
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
47
|
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
48
48
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
49
49
|
loading="lazy"
|
|
50
50
|
/>
|
|
51
51
|
|
|
52
|
-
Дивіться [Application Template](https://github.com/aymericzip/intlayer-
|
|
52
|
+
Дивіться [Application Template](https://github.com/aymericzip/intlayer-adonis-template) на GitHub.
|
|
53
53
|
|
|
54
54
|
### Встановлення
|
|
55
55
|
|
|
@@ -323,14 +323,9 @@ export const getLocale = (event: RequestEvent): Locale => {
|
|
|
323
323
|
|
|
324
324
|
Якщо локаль не налаштована, ми хочемо повернути помилку 404. Щоб спростити це, ми можемо створити функцію `match`, яка перевіряє, чи є локаль валідною:
|
|
325
325
|
|
|
326
|
-
```ts fileName="/src/params/locale.ts"
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
export const match = (
|
|
330
|
-
param: Locale = configuration.internationalization.defaultLocale
|
|
331
|
-
): boolean => {
|
|
332
|
-
return configuration.internationalization.locales.includes(param);
|
|
333
|
-
};
|
|
326
|
+
```ts fileName="/src/params/locale.ts"import { defaultLocale, locales, type Locale } from "intlayer";
|
|
327
|
+
export const match = (param: Locale = defaultLocale): boolean =>
|
|
328
|
+
locales.includes(param);
|
|
334
329
|
```
|
|
335
330
|
|
|
336
331
|
> **Примітка:** Переконайтеся, що у вашому `src/app.d.ts` міститься визначення локалі:
|
|
@@ -369,15 +364,13 @@ export const match = (
|
|
|
369
364
|
|
|
370
365
|
```ts fileName="src/routes/[[locale=locale]]/+layout.ts"
|
|
371
366
|
import type { Load } from "@sveltejs/kit";
|
|
372
|
-
import {
|
|
367
|
+
import { defaultLocale, type Locale } from "intlayer";
|
|
373
368
|
|
|
374
369
|
export const prerender = true;
|
|
375
370
|
|
|
376
371
|
// Використовуйте загальний тип Load
|
|
377
372
|
export const load: Load = ({ params }) => {
|
|
378
|
-
const locale: Locale =
|
|
379
|
-
(params.locale as Locale) ??
|
|
380
|
-
configuration.internationalization.defaultLocale;
|
|
373
|
+
const locale: Locale = (params.locale as Locale) ?? defaultLocale;
|
|
381
374
|
|
|
382
375
|
return {
|
|
383
376
|
locale,
|
|
@@ -24,13 +24,13 @@ history:
|
|
|
24
24
|
changes: Додано команду init
|
|
25
25
|
- version: 7.4.0
|
|
26
26
|
date: 2025-12-11
|
|
27
|
-
changes: Представлено validatePrefix та додано крок 14: Обробка сторінок 404 з локалізованими маршрутами.
|
|
27
|
+
changes: "Представлено validatePrefix та додано крок 14: Обробка сторінок 404 з локалізованими маршрутами."
|
|
28
28
|
- version: 7.3.9
|
|
29
29
|
date: 2025-12-05
|
|
30
|
-
changes: Додано крок 13: Отримання локалі у server actions (необов'язково)
|
|
30
|
+
changes: "Додано крок 13: Отримання локалі у server actions (необов'язково)"
|
|
31
31
|
- version: 7.2.3
|
|
32
32
|
date: 2025-11-18
|
|
33
|
-
changes: Додано крок 13: Адаптувати Nitro
|
|
33
|
+
changes: "Додано крок 13: Адаптувати Nitro"
|
|
34
34
|
- version: 7.1.0
|
|
35
35
|
date: 2025-11-17
|
|
36
36
|
changes: Виправлено значення префікса за замовчуванням, додавши функцію getPrefix, useLocalizedNavigate, LocaleSwitcher та LocalizedLink.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-12-02
|
|
3
3
|
updatedAt: 2025-06-29
|
|
4
|
-
title: Документація: функція `t` у `express-intlayer`
|
|
4
|
+
title: "Документація: функція `t` у `express-intlayer`"
|
|
5
5
|
description: Дізнайтеся, як використовувати функцію `t` у пакеті `express-intlayer`
|
|
6
6
|
keywords:
|
|
7
7
|
- t
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-08-23
|
|
3
3
|
updatedAt: 2025-08-23
|
|
4
|
-
title: Документація: функція getHTMLTextDir | intlayer
|
|
4
|
+
title: "Документація: функція getHTMLTextDir | intlayer"
|
|
5
5
|
description: Дізнайтеся, як використовувати функцію getHTMLTextDir у пакеті intlayer
|
|
6
6
|
keywords:
|
|
7
7
|
- getHTMLTextDir
|
|
@@ -21,7 +21,7 @@ slugs:
|
|
|
21
21
|
history:
|
|
22
22
|
- version: 7.1.0
|
|
23
23
|
date: 2025-11-16
|
|
24
|
-
changes: Рефакторинг: використання параметра options з полем mode замість prefixDefault
|
|
24
|
+
changes: "Рефакторинг: використання параметра options з полем mode замість prefixDefault"
|
|
25
25
|
- version: 5.5.10
|
|
26
26
|
date: 2025-06-29
|
|
27
27
|
changes: Ініціалізація історії
|
|
@@ -14,7 +14,7 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- adonisjs
|
|
17
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-adonis-template
|
|
18
18
|
history:
|
|
19
19
|
- version: 8.0.0
|
|
20
20
|
date: 2025-12-30
|
|
@@ -42,7 +42,7 @@ Bằng cách quốc tế hóa backend, ứng dụng của bạn không chỉ tô
|
|
|
42
42
|
## Bắt đầu
|
|
43
43
|
|
|
44
44
|
<iframe
|
|
45
|
-
src="https://stackblitz.com/github/aymericzip/intlayer-
|
|
45
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-adonis-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
46
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
47
|
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
48
48
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
@@ -494,14 +494,9 @@ export const getLocale = (event: RequestEvent): Locale => {
|
|
|
494
494
|
|
|
495
495
|
Nếu locale chưa được cấu hình, chúng ta muốn trả về lỗi 404. Để dễ dàng hơn, ta có thể tạo một hàm `match` để kiểm tra xem locale có hợp lệ hay không:
|
|
496
496
|
|
|
497
|
-
```ts fileName="/src/params/locale.ts"
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
export const match = (
|
|
501
|
-
param: Locale = configuration.internationalization.defaultLocale
|
|
502
|
-
): boolean => {
|
|
503
|
-
return configuration.internationalization.locales.includes(param);
|
|
504
|
-
};
|
|
497
|
+
```ts fileName="/src/params/locale.ts"import { defaultLocale, locales, type Locale } from "intlayer";
|
|
498
|
+
export const match = (param: Locale = defaultLocale): boolean =>
|
|
499
|
+
locales.includes(param);
|
|
505
500
|
```
|
|
506
501
|
|
|
507
502
|
> **Lưu ý:** Đảm bảo rằng file `src/app.d.ts` của bạn bao gồm định nghĩa locale:
|
|
@@ -540,15 +535,13 @@ Sau đó, tạo một trang và layout mới trong nhóm `[[locale=locale]]`:
|
|
|
540
535
|
|
|
541
536
|
```ts fileName="src/routes/[[locale=locale]]/+layout.ts"
|
|
542
537
|
import type { Load } from "@sveltejs/kit";
|
|
543
|
-
import {
|
|
538
|
+
import { defaultLocale, type Locale } from "intlayer";
|
|
544
539
|
|
|
545
540
|
export const prerender = true;
|
|
546
541
|
|
|
547
542
|
// Sử dụng kiểu Load chung
|
|
548
543
|
export const load: Load = ({ params }) => {
|
|
549
|
-
const locale: Locale =
|
|
550
|
-
(params.locale as Locale) ??
|
|
551
|
-
configuration.internationalization.defaultLocale;
|
|
544
|
+
const locale: Locale = (params.locale as Locale) ?? defaultLocale;
|
|
552
545
|
|
|
553
546
|
return {
|
|
554
547
|
locale,
|
|
@@ -24,13 +24,13 @@ history:
|
|
|
24
24
|
changes: Thêm lệnh init
|
|
25
25
|
- version: 7.4.0
|
|
26
26
|
date: 2025-12-11
|
|
27
|
-
changes: Giới thiệu validatePrefix và thêm bước 14: Xử lý trang 404 với các tuyến đường được bản địa hóa.
|
|
27
|
+
changes: "Giới thiệu validatePrefix và thêm bước 14: Xử lý trang 404 với các tuyến đường được bản địa hóa."
|
|
28
28
|
- version: 7.3.9
|
|
29
29
|
date: 2025-12-05
|
|
30
|
-
changes: Thêm bước 13: Lấy locale trong server actions của bạn (Tùy chọn)
|
|
30
|
+
changes: "Thêm bước 13: Lấy locale trong server actions của bạn (Tùy chọn)"
|
|
31
31
|
- version: 7.2.3
|
|
32
32
|
date: 2025-11-18
|
|
33
|
-
changes: Thêm bước 13: Thích ứng Nitro
|
|
33
|
+
changes: "Thêm bước 13: Thích ứng Nitro"
|
|
34
34
|
- version: 7.1.0
|
|
35
35
|
date: 2025-11-17
|
|
36
36
|
changes: Sửa prefix mặc định bằng cách thêm hàm getPrefix useLocalizedNavigate, LocaleSwitcher và LocalizedLink.
|
|
@@ -14,7 +14,7 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- adonisjs
|
|
17
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-adonis-template
|
|
18
18
|
history:
|
|
19
19
|
- version: 8.0.0
|
|
20
20
|
date: 2025-12-30
|
|
@@ -42,14 +42,14 @@ history:
|
|
|
42
42
|
## 入门
|
|
43
43
|
|
|
44
44
|
<iframe
|
|
45
|
-
src="https://stackblitz.com/github/aymericzip/intlayer-
|
|
45
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-adonis-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
46
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
47
|
title="Demo CodeSandbox - 如何使用 Intlayer 实现应用国际化"
|
|
48
48
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
49
49
|
loading="lazy"
|
|
50
50
|
/>
|
|
51
51
|
|
|
52
|
-
See [Application Template](https://github.com/aymericzip/intlayer-
|
|
52
|
+
See [Application Template](https://github.com/aymericzip/intlayer-adonis-template) on GitHub.
|
|
53
53
|
|
|
54
54
|
### 安装
|
|
55
55
|
|