@intlayer/docs 8.6.10 → 8.7.0-canary.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/i18n_using_next-i18next.md +1 -1
- package/blog/ar/next-i18next_vs_next-intl_vs_intlayer.md +2 -2
- package/blog/de/i18n_using_next-i18next.md +1 -1
- package/blog/de/next-i18next_vs_next-intl_vs_intlayer.md +2 -2
- package/blog/en/i18n_using_next-i18next.md +1 -1
- package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +2 -2
- package/blog/en-GB/i18n_using_next-i18next.md +1 -1
- package/blog/en-GB/next-i18next_vs_next-intl_vs_intlayer.md +1 -1
- package/blog/es/i18n_using_next-i18next.md +1 -1
- package/blog/es/next-i18next_vs_next-intl_vs_intlayer.md +2 -2
- package/blog/fr/i18n_using_next-i18next.md +1 -1
- package/blog/fr/next-i18next_vs_next-intl_vs_intlayer.md +1 -1
- package/blog/hi/i18n_using_next-i18next.md +1 -1
- package/blog/id/i18n_using_next-i18next.md +1 -1
- package/blog/id/next-i18next_vs_next-intl_vs_intlayer.md +2 -2
- package/blog/it/i18n_using_next-i18next.md +1 -1
- package/blog/it/next-i18next_vs_next-intl_vs_intlayer.md +1 -1
- package/blog/ja/i18n_using_next-i18next.md +1 -1
- package/blog/ja/next-i18next_vs_next-intl_vs_intlayer.md +1 -1
- package/blog/ko/i18n_using_next-i18next.md +1 -1
- package/blog/ko/next-i18next_vs_next-intl_vs_intlayer.md +1 -1
- package/blog/pl/i18n_using_next-i18next.md +1 -1
- package/blog/pl/next-i18next_vs_next-intl_vs_intlayer.md +2 -2
- package/blog/pt/i18n_using_next-i18next.md +1 -1
- package/blog/pt/next-i18next_vs_next-intl_vs_intlayer.md +1 -1
- package/blog/ru/i18n_using_next-i18next.md +1 -1
- package/blog/ru/next-i18next_vs_next-intl_vs_intlayer.md +1 -1
- package/blog/tr/i18n_using_next-i18next.md +1 -1
- package/blog/uk/i18n_using_next-i18next.md +1 -1
- package/blog/uk/next-i18next_vs_next-intl_vs_intlayer.md +2 -2
- package/blog/vi/i18n_using_next-i18next.md +1 -1
- package/blog/vi/next-i18next_vs_next-intl_vs_intlayer.md +2 -2
- package/blog/zh/i18n_using_next-i18next.md +1 -1
- package/blog/zh/next-i18next_vs_next-intl_vs_intlayer.md +1 -1
- package/docs/ar/bundle_optimization.md +454 -0
- package/docs/ar/intlayer_with_next-i18next.md +1 -1
- package/docs/ar/intlayer_with_next-intl.md +1 -1
- package/docs/ar/intlayer_with_tanstack+solid.md +24 -5
- package/docs/ar/intlayer_with_tanstack.md +45 -68
- package/docs/bn/bundle_optimization.md +454 -0
- package/docs/cs/bundle_optimization.md +454 -0
- package/docs/de/bundle_optimization.md +454 -0
- package/docs/de/intlayer_with_next-i18next.md +1 -1
- package/docs/de/intlayer_with_next-intl.md +1 -1
- package/docs/de/intlayer_with_tanstack+solid.md +24 -5
- package/docs/de/intlayer_with_tanstack.md +45 -68
- package/docs/en/bundle_optimization.md +36 -8
- package/docs/en/intlayer_with_next-i18next.md +1 -1
- package/docs/en/intlayer_with_next-intl.md +1 -1
- package/docs/en/intlayer_with_tanstack+solid.md +24 -5
- package/docs/en/intlayer_with_tanstack.md +45 -68
- package/docs/en-GB/bundle_optimization.md +454 -0
- package/docs/en-GB/intlayer_with_next-i18next.md +1 -1
- package/docs/en-GB/intlayer_with_next-intl.md +1 -1
- package/docs/en-GB/intlayer_with_tanstack+solid.md +24 -5
- package/docs/en-GB/intlayer_with_tanstack.md +47 -70
- package/docs/es/bundle_optimization.md +454 -0
- package/docs/es/intlayer_with_next-i18next.md +1 -1
- package/docs/es/intlayer_with_next-intl.md +1 -1
- package/docs/es/intlayer_with_tanstack+solid.md +24 -5
- package/docs/es/intlayer_with_tanstack.md +45 -68
- package/docs/fr/bundle_optimization.md +454 -0
- package/docs/fr/intlayer_with_next-i18next.md +1 -1
- package/docs/fr/intlayer_with_next-intl.md +1 -1
- package/docs/fr/intlayer_with_tanstack+solid.md +24 -5
- package/docs/fr/intlayer_with_tanstack.md +45 -68
- package/docs/hi/bundle_optimization.md +454 -0
- package/docs/hi/intlayer_with_next-i18next.md +1 -1
- package/docs/hi/intlayer_with_next-intl.md +1 -1
- package/docs/hi/intlayer_with_tanstack+solid.md +24 -5
- package/docs/hi/intlayer_with_tanstack.md +45 -68
- package/docs/id/bundle_optimization.md +454 -0
- package/docs/id/intlayer_with_next-i18next.md +1 -1
- package/docs/id/intlayer_with_next-intl.md +1 -1
- package/docs/id/intlayer_with_tanstack+solid.md +24 -5
- package/docs/id/intlayer_with_tanstack.md +45 -68
- package/docs/it/bundle_optimization.md +454 -0
- package/docs/it/intlayer_with_next-i18next.md +1 -1
- package/docs/it/intlayer_with_next-intl.md +1 -1
- package/docs/it/intlayer_with_tanstack+solid.md +24 -5
- package/docs/it/intlayer_with_tanstack.md +45 -68
- package/docs/ja/bundle_optimization.md +454 -0
- package/docs/ja/intlayer_with_next-i18next.md +1 -1
- package/docs/ja/intlayer_with_next-intl.md +1 -1
- package/docs/ja/intlayer_with_tanstack+solid.md +24 -5
- package/docs/ja/intlayer_with_tanstack.md +45 -36
- package/docs/ko/bundle_optimization.md +454 -0
- package/docs/ko/intlayer_with_next-i18next.md +1 -1
- package/docs/ko/intlayer_with_next-intl.md +1 -1
- package/docs/ko/intlayer_with_tanstack+solid.md +24 -5
- package/docs/ko/intlayer_with_tanstack.md +45 -68
- package/docs/nl/bundle_optimization.md +454 -0
- package/docs/pl/bundle_optimization.md +454 -0
- package/docs/pl/intlayer_with_next-i18next.md +1 -1
- package/docs/pl/intlayer_with_next-intl.md +1 -1
- package/docs/pl/intlayer_with_tanstack+solid.md +24 -5
- package/docs/pl/intlayer_with_tanstack.md +45 -68
- package/docs/pt/bundle_optimization.md +454 -0
- package/docs/pt/intlayer_with_next-i18next.md +1 -1
- package/docs/pt/intlayer_with_next-intl.md +1 -1
- package/docs/pt/intlayer_with_tanstack+solid.md +24 -5
- package/docs/pt/intlayer_with_tanstack.md +45 -68
- package/docs/ru/bundle_optimization.md +454 -0
- package/docs/ru/intlayer_with_next-i18next.md +1 -1
- package/docs/ru/intlayer_with_next-intl.md +1 -1
- package/docs/ru/intlayer_with_tanstack+solid.md +24 -5
- package/docs/ru/intlayer_with_tanstack.md +45 -68
- package/docs/tr/bundle_optimization.md +454 -0
- package/docs/tr/intlayer_with_next-i18next.md +1 -1
- package/docs/tr/intlayer_with_next-intl.md +1 -1
- package/docs/tr/intlayer_with_tanstack+solid.md +24 -5
- package/docs/tr/intlayer_with_tanstack.md +45 -68
- package/docs/uk/bundle_optimization.md +454 -0
- package/docs/uk/intlayer_with_next-i18next.md +1 -1
- package/docs/uk/intlayer_with_next-intl.md +1 -1
- package/docs/uk/intlayer_with_tanstack+solid.md +24 -5
- package/docs/uk/intlayer_with_tanstack.md +45 -68
- package/docs/ur/bundle_optimization.md +454 -0
- package/docs/vi/bundle_optimization.md +454 -0
- package/docs/vi/intlayer_with_next-i18next.md +1 -1
- package/docs/vi/intlayer_with_next-intl.md +1 -1
- package/docs/vi/intlayer_with_tanstack+solid.md +24 -5
- package/docs/vi/intlayer_with_tanstack.md +45 -68
- package/docs/zh/bundle_optimization.md +454 -0
- package/docs/zh/intlayer_with_next-i18next.md +1 -1
- package/docs/zh/intlayer_with_next-intl.md +1 -1
- package/docs/zh/intlayer_with_tanstack+solid.md +24 -5
- package/docs/zh/intlayer_with_tanstack.md +45 -68
- package/package.json +7 -7
|
@@ -415,7 +415,7 @@ export default function LocaleLayout({
|
|
|
415
415
|
// التحقق من صحة اللغة من معلمات URL
|
|
416
416
|
// إذا تم توفير لغة غير صالحة، يتم الرجوع إلى اللغة الافتراضية
|
|
417
417
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
418
|
-
?
|
|
418
|
+
? params.locale
|
|
419
419
|
: defaultLocale;
|
|
420
420
|
|
|
421
421
|
// تحديد اتجاه النص بناءً على اللغة
|
|
@@ -547,7 +547,7 @@ export default function LocaleLayout({
|
|
|
547
547
|
params: { locale: string };
|
|
548
548
|
}) {
|
|
549
549
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
550
|
-
?
|
|
550
|
+
? params.locale
|
|
551
551
|
: defaultLocale;
|
|
552
552
|
|
|
553
553
|
const dir = isRtl(locale) ? "rtl" : "ltr";
|
|
@@ -614,7 +614,7 @@ async function loadMessages(locale: string) {
|
|
|
614
614
|
}
|
|
615
615
|
|
|
616
616
|
export default getRequestConfig(async ({ locale }) => {
|
|
617
|
-
if (!locales.includes(locale
|
|
617
|
+
if (!locales.includes(locale)) notFound();
|
|
618
618
|
|
|
619
619
|
return {
|
|
620
620
|
messages: await loadMessages(locale),
|
|
@@ -414,7 +414,7 @@ export default function LocaleLayout({
|
|
|
414
414
|
// Überprüfen Sie die Locale aus den URL-Parametern
|
|
415
415
|
// Wenn eine ungültige Locale angegeben wird, wird auf die Standard-Locale zurückgegriffen
|
|
416
416
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
417
|
-
?
|
|
417
|
+
? params.locale
|
|
418
418
|
: defaultLocale;
|
|
419
419
|
|
|
420
420
|
// Bestimmen Sie die Schreibrichtung basierend auf der Locale
|
|
@@ -557,7 +557,7 @@ export default function LocaleLayout({
|
|
|
557
557
|
params: { locale: string };
|
|
558
558
|
}) {
|
|
559
559
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
560
|
-
?
|
|
560
|
+
? params.locale
|
|
561
561
|
: defaultLocale;
|
|
562
562
|
|
|
563
563
|
const dir = isRtl(locale) ? "rtl" : "ltr";
|
|
@@ -624,7 +624,7 @@ async function loadMessages(locale: string) {
|
|
|
624
624
|
}
|
|
625
625
|
|
|
626
626
|
export default getRequestConfig(async ({ locale }) => {
|
|
627
|
-
if (!locales.includes(locale
|
|
627
|
+
if (!locales.includes(locale)) notFound();
|
|
628
628
|
|
|
629
629
|
return {
|
|
630
630
|
messages: await loadMessages(locale),
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// Validate locale from URL params
|
|
413
413
|
// If invalid locale is provided, fall back to default locale
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// Determine text direction based on locale
|
|
@@ -532,7 +532,7 @@ export default function LocaleLayout({
|
|
|
532
532
|
params: { locale: string };
|
|
533
533
|
}) {
|
|
534
534
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
535
|
-
?
|
|
535
|
+
? params.locale
|
|
536
536
|
: defaultLocale;
|
|
537
537
|
|
|
538
538
|
const dir = isRtl(locale) ? "rtl" : "ltr";
|
|
@@ -599,7 +599,7 @@ async function loadMessages(locale: string) {
|
|
|
599
599
|
}
|
|
600
600
|
|
|
601
601
|
export default getRequestConfig(async ({ locale }) => {
|
|
602
|
-
if (!locales.includes(locale
|
|
602
|
+
if (!locales.includes(locale)) notFound();
|
|
603
603
|
|
|
604
604
|
return {
|
|
605
605
|
messages: await loadMessages(locale),
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// Validate locale from URL params
|
|
413
413
|
// If an invalid locale is provided, fall back to the default locale
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// Determine text direction based on locale
|
|
@@ -501,7 +501,7 @@ const locales = ["en", "fr", "es"];
|
|
|
501
501
|
|
|
502
502
|
export default getRequestConfig(async ({ locale }) => {
|
|
503
503
|
// Validate that the incoming `locale` parameter is valid
|
|
504
|
-
if (!locales.includes(locale
|
|
504
|
+
if (!locales.includes(locale)) notFound();
|
|
505
505
|
|
|
506
506
|
return {
|
|
507
507
|
messages: (await import(`../messages/${locale}.json`)).default,
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// Validar la locale a partir de los parámetros de la URL
|
|
413
413
|
// Si se proporciona una locale inválida, usar la locale por defecto
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// Determinar la dirección del texto según la locale
|
|
@@ -547,7 +547,7 @@ export default function LocaleLayout({
|
|
|
547
547
|
params: { locale: string };
|
|
548
548
|
}) {
|
|
549
549
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
550
|
-
?
|
|
550
|
+
? params.locale
|
|
551
551
|
: defaultLocale;
|
|
552
552
|
|
|
553
553
|
const dir = isRtl(locale) ? "rtl" : "ltr";
|
|
@@ -605,7 +605,7 @@ const locales = ["en", "fr", "es"];
|
|
|
605
605
|
|
|
606
606
|
export default getRequestConfig(async ({ locale }) => {
|
|
607
607
|
// Validar que el parámetro `locale` entrante sea válido
|
|
608
|
-
if (!locales.includes(locale
|
|
608
|
+
if (!locales.includes(locale)) notFound();
|
|
609
609
|
|
|
610
610
|
return {
|
|
611
611
|
messages: (await import(`../messages/${locale}.json`)).default,
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// Valider la locale à partir des paramètres de l'URL
|
|
413
413
|
// Si une locale invalide est fournie, revenir à la locale par défaut
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// Déterminer la direction du texte en fonction de la locale
|
|
@@ -503,7 +503,7 @@ const locales = ["en", "fr", "es"];
|
|
|
503
503
|
|
|
504
504
|
export default getRequestConfig(async ({ locale }) => {
|
|
505
505
|
// Valider que le paramètre `locale` reçu est valide
|
|
506
|
-
if (!locales.includes(locale
|
|
506
|
+
if (!locales.includes(locale)) notFound();
|
|
507
507
|
|
|
508
508
|
return {
|
|
509
509
|
messages: (await import(`../messages/${locale}.json`)).default,
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
/// URL पैरामीटर से locale को मान्य करें
|
|
413
413
|
// यदि अमान्य locale प्रदान किया गया है, तो डिफ़ॉल्ट locale पर वापस जाएं
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// locale के आधार पर टेक्स्ट दिशा निर्धारित करें
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// Validasi locale dari parameter URL
|
|
413
413
|
// Jika locale yang diberikan tidak valid, gunakan locale default
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// Tentukan arah teks berdasarkan locale
|
|
@@ -534,7 +534,7 @@ export default function LocaleLayout({
|
|
|
534
534
|
params: { locale: string };
|
|
535
535
|
}) {
|
|
536
536
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
537
|
-
?
|
|
537
|
+
? params.locale
|
|
538
538
|
: defaultLocale;
|
|
539
539
|
|
|
540
540
|
const dir = isRtl(locale) ? "rtl" : "ltr";
|
|
@@ -601,7 +601,7 @@ async function loadMessages(locale: string) {
|
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
export default getRequestConfig(async ({ locale }) => {
|
|
604
|
-
if (!locales.includes(locale
|
|
604
|
+
if (!locales.includes(locale)) notFound();
|
|
605
605
|
|
|
606
606
|
return {
|
|
607
607
|
messages: await loadMessages(locale),
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// Valida la locale dai parametri URL
|
|
413
413
|
// Se viene fornita una locale non valida, si utilizza la locale predefinita
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// Determina la direzione del testo in base alla locale
|
|
@@ -507,7 +507,7 @@ const locales = ["en", "fr", "es"];
|
|
|
507
507
|
|
|
508
508
|
export default getRequestConfig(async ({ locale }) => {
|
|
509
509
|
// Verifica che il parametro `locale` in ingresso sia valido
|
|
510
|
-
if (!locales.includes(locale
|
|
510
|
+
if (!locales.includes(locale)) notFound();
|
|
511
511
|
|
|
512
512
|
return {
|
|
513
513
|
messages: (await import(`../messages/${locale}.json`)).default,
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// URLパラメータからロケールを検証
|
|
413
413
|
// 無効なロケールが提供された場合はデフォルトロケールにフォールバック
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// ロケールに基づいてテキストの方向を決定
|
|
@@ -509,7 +509,7 @@ const locales = ["en", "fr", "es"];
|
|
|
509
509
|
|
|
510
510
|
export default getRequestConfig(async ({ locale }) => {
|
|
511
511
|
// 受け取った `locale` パラメータが有効か検証します
|
|
512
|
-
if (!locales.includes(locale
|
|
512
|
+
if (!locales.includes(locale)) notFound();
|
|
513
513
|
|
|
514
514
|
return {
|
|
515
515
|
messages: (await import(`../messages/${locale}.json`)).default,
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
/// URL 매개변수에서 로케일 유효성 검사
|
|
413
413
|
/// 잘못된 로케일이 제공되면 기본 로케일로 대체
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
/// 로케일에 따라 텍스트 방향 결정
|
|
@@ -501,7 +501,7 @@ const locales = ["en", "fr", "es"];
|
|
|
501
501
|
|
|
502
502
|
export default getRequestConfig(async ({ locale }) => {
|
|
503
503
|
// 들어오는 `locale` 매개변수가 유효한지 검증합니다
|
|
504
|
-
if (!locales.includes(locale
|
|
504
|
+
if (!locales.includes(locale)) notFound();
|
|
505
505
|
|
|
506
506
|
return {
|
|
507
507
|
messages: (await import(`../messages/${locale}.json`)).default,
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// Waliduj locale z parametrów URL
|
|
413
413
|
// Jeśli podane jest nieprawidłowe locale, użyj domyślnego locale
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// Określ kierunek tekstu na podstawie locale
|
|
@@ -536,7 +536,7 @@ export default function LocaleLayout({
|
|
|
536
536
|
params: { locale: string };
|
|
537
537
|
}) {
|
|
538
538
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
539
|
-
?
|
|
539
|
+
? params.locale
|
|
540
540
|
: defaultLocale;
|
|
541
541
|
|
|
542
542
|
const dir = isRtl(locale) ? "rtl" : "ltr";
|
|
@@ -603,7 +603,7 @@ async function loadMessages(locale: string) {
|
|
|
603
603
|
}
|
|
604
604
|
|
|
605
605
|
export default getRequestConfig(async ({ locale }) => {
|
|
606
|
-
if (!locales.includes(locale
|
|
606
|
+
if (!locales.includes(locale)) notFound();
|
|
607
607
|
|
|
608
608
|
return {
|
|
609
609
|
messages: await loadMessages(locale),
|
|
@@ -413,7 +413,7 @@ export default function LocaleLayout({
|
|
|
413
413
|
/// Validar o locale a partir dos parâmetros da URL
|
|
414
414
|
/// Se um locale inválido for fornecido, usar o locale padrão
|
|
415
415
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
416
|
-
?
|
|
416
|
+
? params.locale
|
|
417
417
|
: defaultLocale;
|
|
418
418
|
|
|
419
419
|
/// Determinar a direção do texto com base no locale
|
|
@@ -503,7 +503,7 @@ const locales = ["en", "fr", "es"];
|
|
|
503
503
|
|
|
504
504
|
export default getRequestConfig(async ({ locale }) => {
|
|
505
505
|
// Valida se o parâmetro `locale` recebido é válido
|
|
506
|
-
if (!locales.includes(locale
|
|
506
|
+
if (!locales.includes(locale)) notFound();
|
|
507
507
|
|
|
508
508
|
return {
|
|
509
509
|
messages: (await import(`../messages/${locale}.json`)).default,
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// Проверка локали из параметров URL
|
|
413
413
|
// Если указана недопустимая локаль, используется локаль по умолчанию
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// Определение направления текста на основе локали
|
|
@@ -509,7 +509,7 @@ const locales = ["en", "fr", "es"];
|
|
|
509
509
|
|
|
510
510
|
export default getRequestConfig(async ({ locale }) => {
|
|
511
511
|
// Проверяем, что входящий параметр `locale` является допустимым
|
|
512
|
-
if (!locales.includes(locale
|
|
512
|
+
if (!locales.includes(locale)) notFound();
|
|
513
513
|
|
|
514
514
|
return {
|
|
515
515
|
messages: (await import(`../messages/${locale}.json`)).default,
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
/// URL parametrelerinden locale doğrulaması yapın
|
|
413
413
|
/// Geçersiz bir locale sağlanırsa, varsayılan locale geri dönülür
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
/// Locale'a göre metin yönünü belirleyin
|
|
@@ -413,7 +413,7 @@ export default function LocaleLayout({
|
|
|
413
413
|
// Перевіряємо locale з параметрів URL
|
|
414
414
|
// Якщо вказано недійсну locale, використовуємо defaultLocale
|
|
415
415
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
416
|
-
?
|
|
416
|
+
? params.locale
|
|
417
417
|
: defaultLocale;
|
|
418
418
|
|
|
419
419
|
// Визначаємо напрямок тексту залежно від locale
|
|
@@ -532,7 +532,7 @@ export default function LocaleLayout({
|
|
|
532
532
|
params: { locale: string };
|
|
533
533
|
}) {
|
|
534
534
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
535
|
-
?
|
|
535
|
+
? params.locale
|
|
536
536
|
: defaultLocale;
|
|
537
537
|
|
|
538
538
|
const dir = isRtl(locale) ? "rtl" : "ltr";
|
|
@@ -599,7 +599,7 @@ async function loadMessages(locale: string) {
|
|
|
599
599
|
}
|
|
600
600
|
|
|
601
601
|
export default getRequestConfig(async ({ locale }) => {
|
|
602
|
-
if (!locales.includes(locale
|
|
602
|
+
if (!locales.includes(locale)) notFound();
|
|
603
603
|
|
|
604
604
|
return {
|
|
605
605
|
messages: await loadMessages(locale),
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// Xác thực locale từ tham số URL
|
|
413
413
|
// Nếu locale không hợp lệ được cung cấp, sử dụng locale mặc định
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// Xác định hướng văn bản dựa trên locale
|
|
@@ -534,7 +534,7 @@ export default function LocaleLayout({
|
|
|
534
534
|
params: { locale: string };
|
|
535
535
|
}) {
|
|
536
536
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
537
|
-
?
|
|
537
|
+
? params.locale
|
|
538
538
|
: defaultLocale;
|
|
539
539
|
|
|
540
540
|
const dir = isRtl(locale) ? "rtl" : "ltr";
|
|
@@ -601,7 +601,7 @@ async function loadMessages(locale: string) {
|
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
export default getRequestConfig(async ({ locale }) => {
|
|
604
|
-
if (!locales.includes(locale
|
|
604
|
+
if (!locales.includes(locale)) notFound();
|
|
605
605
|
|
|
606
606
|
return {
|
|
607
607
|
messages: await loadMessages(locale),
|
|
@@ -412,7 +412,7 @@ export default function LocaleLayout({
|
|
|
412
412
|
// 验证来自 URL 参数的 locale
|
|
413
413
|
// 如果提供了无效的 locale,则回退到默认 locale
|
|
414
414
|
const locale: Locale = (locales as readonly string[]).includes(params.locale)
|
|
415
|
-
?
|
|
415
|
+
? params.locale
|
|
416
416
|
: defaultLocale;
|
|
417
417
|
|
|
418
418
|
// 根据 locale 确定文本方向
|
|
@@ -509,7 +509,7 @@ const locales = ["en", "fr", "es"];
|
|
|
509
509
|
|
|
510
510
|
export default getRequestConfig(async ({ locale }) => {
|
|
511
511
|
// 验证传入的 `locale` 参数是否有效
|
|
512
|
-
if (!locales.includes(locale
|
|
512
|
+
if (!locales.includes(locale)) notFound();
|
|
513
513
|
|
|
514
514
|
return {
|
|
515
515
|
messages: (await import(`../messages/${locale}.json`)).default,
|