@nimee/translations 1.0.64 → 1.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/translations.d.ts +149 -0
- package/dist/translations.js +201 -32
- package/dist/translations.js.map +1 -1
- package/package.json +2 -2
- package/src/translations.ts +334 -31
- package/test/translations.test.ts +56 -1
- package/.claude/settings.local.json +0 -8
package/src/translations.ts
CHANGED
|
@@ -596,6 +596,108 @@ interface ITranslationKeys {
|
|
|
596
596
|
ko: string;
|
|
597
597
|
zh: string;
|
|
598
598
|
};
|
|
599
|
+
dashboardButtonText: {
|
|
600
|
+
en: string;
|
|
601
|
+
he: string;
|
|
602
|
+
ar: string;
|
|
603
|
+
ru: string;
|
|
604
|
+
es: string;
|
|
605
|
+
fr: string;
|
|
606
|
+
de: string;
|
|
607
|
+
it: string;
|
|
608
|
+
pt: string;
|
|
609
|
+
nl: string;
|
|
610
|
+
pl: string;
|
|
611
|
+
tr: string;
|
|
612
|
+
ja: string;
|
|
613
|
+
ko: string;
|
|
614
|
+
zh: string;
|
|
615
|
+
};
|
|
616
|
+
viewSellersButtonText: {
|
|
617
|
+
en: string;
|
|
618
|
+
he: string;
|
|
619
|
+
ar: string;
|
|
620
|
+
ru: string;
|
|
621
|
+
es: string;
|
|
622
|
+
fr: string;
|
|
623
|
+
de: string;
|
|
624
|
+
it: string;
|
|
625
|
+
pt: string;
|
|
626
|
+
nl: string;
|
|
627
|
+
pl: string;
|
|
628
|
+
tr: string;
|
|
629
|
+
ja: string;
|
|
630
|
+
ko: string;
|
|
631
|
+
zh: string;
|
|
632
|
+
};
|
|
633
|
+
newAccountCreatedSubject: {
|
|
634
|
+
en: string;
|
|
635
|
+
he: string;
|
|
636
|
+
ar: string;
|
|
637
|
+
ru: string;
|
|
638
|
+
es: string;
|
|
639
|
+
fr: string;
|
|
640
|
+
de: string;
|
|
641
|
+
it: string;
|
|
642
|
+
pt: string;
|
|
643
|
+
nl: string;
|
|
644
|
+
pl: string;
|
|
645
|
+
tr: string;
|
|
646
|
+
ja: string;
|
|
647
|
+
ko: string;
|
|
648
|
+
zh: string;
|
|
649
|
+
};
|
|
650
|
+
emailVerificationLinkInvalid: {
|
|
651
|
+
en: string;
|
|
652
|
+
he: string;
|
|
653
|
+
ar: string;
|
|
654
|
+
ru: string;
|
|
655
|
+
es: string;
|
|
656
|
+
fr: string;
|
|
657
|
+
de: string;
|
|
658
|
+
it: string;
|
|
659
|
+
pt: string;
|
|
660
|
+
nl: string;
|
|
661
|
+
pl: string;
|
|
662
|
+
tr: string;
|
|
663
|
+
ja: string;
|
|
664
|
+
ko: string;
|
|
665
|
+
zh: string;
|
|
666
|
+
};
|
|
667
|
+
verificationEmailResendTooSoon: {
|
|
668
|
+
en: string;
|
|
669
|
+
he: string;
|
|
670
|
+
ar: string;
|
|
671
|
+
ru: string;
|
|
672
|
+
es: string;
|
|
673
|
+
fr: string;
|
|
674
|
+
de: string;
|
|
675
|
+
it: string;
|
|
676
|
+
pt: string;
|
|
677
|
+
nl: string;
|
|
678
|
+
pl: string;
|
|
679
|
+
tr: string;
|
|
680
|
+
ja: string;
|
|
681
|
+
ko: string;
|
|
682
|
+
zh: string;
|
|
683
|
+
};
|
|
684
|
+
emailAlreadyVerified: {
|
|
685
|
+
en: string;
|
|
686
|
+
he: string;
|
|
687
|
+
ar: string;
|
|
688
|
+
ru: string;
|
|
689
|
+
es: string;
|
|
690
|
+
fr: string;
|
|
691
|
+
de: string;
|
|
692
|
+
it: string;
|
|
693
|
+
pt: string;
|
|
694
|
+
nl: string;
|
|
695
|
+
pl: string;
|
|
696
|
+
tr: string;
|
|
697
|
+
ja: string;
|
|
698
|
+
ko: string;
|
|
699
|
+
zh: string;
|
|
700
|
+
};
|
|
599
701
|
orderWaitingForApprovalSubject: {
|
|
600
702
|
en: string;
|
|
601
703
|
he: string;
|
|
@@ -2449,6 +2551,40 @@ interface ITranslationKeys {
|
|
|
2449
2551
|
ko: string;
|
|
2450
2552
|
zh: string;
|
|
2451
2553
|
};
|
|
2554
|
+
sessionCheckInEventNotInStation: {
|
|
2555
|
+
en: string;
|
|
2556
|
+
he: string;
|
|
2557
|
+
ar: string;
|
|
2558
|
+
ru: string;
|
|
2559
|
+
es: string;
|
|
2560
|
+
fr: string;
|
|
2561
|
+
de: string;
|
|
2562
|
+
it: string;
|
|
2563
|
+
pt: string;
|
|
2564
|
+
nl: string;
|
|
2565
|
+
pl: string;
|
|
2566
|
+
tr: string;
|
|
2567
|
+
ja: string;
|
|
2568
|
+
ko: string;
|
|
2569
|
+
zh: string;
|
|
2570
|
+
};
|
|
2571
|
+
sessionCheckInStationAccountMismatch: {
|
|
2572
|
+
en: string;
|
|
2573
|
+
he: string;
|
|
2574
|
+
ar: string;
|
|
2575
|
+
ru: string;
|
|
2576
|
+
es: string;
|
|
2577
|
+
fr: string;
|
|
2578
|
+
de: string;
|
|
2579
|
+
it: string;
|
|
2580
|
+
pt: string;
|
|
2581
|
+
nl: string;
|
|
2582
|
+
pl: string;
|
|
2583
|
+
tr: string;
|
|
2584
|
+
ja: string;
|
|
2585
|
+
ko: string;
|
|
2586
|
+
zh: string;
|
|
2587
|
+
};
|
|
2452
2588
|
basketCheckInTicketNotFoundInOrder: {
|
|
2453
2589
|
en: string;
|
|
2454
2590
|
he: string;
|
|
@@ -3634,21 +3770,123 @@ export const translations: Record<keyof ITranslationKeys, Record<ILanguageEnum,
|
|
|
3634
3770
|
zh: "欢迎来到平台",
|
|
3635
3771
|
},
|
|
3636
3772
|
newSellerRegisteredSubject: {
|
|
3637
|
-
en: "New
|
|
3638
|
-
he: "
|
|
3639
|
-
ar: "
|
|
3640
|
-
ru: "
|
|
3641
|
-
es: "
|
|
3642
|
-
fr: "
|
|
3643
|
-
de: "
|
|
3644
|
-
it: "
|
|
3645
|
-
pt: "
|
|
3646
|
-
nl: "Nieuwe verkoper
|
|
3647
|
-
pl: "
|
|
3648
|
-
tr: "
|
|
3649
|
-
ja: "
|
|
3650
|
-
ko: "
|
|
3651
|
-
zh: "
|
|
3773
|
+
en: "New seller registered on {marketplaceName}",
|
|
3774
|
+
he: "מוכר חדש נרשם ב-{marketplaceName}",
|
|
3775
|
+
ar: "بائع جديد مسجّل في {marketplaceName}",
|
|
3776
|
+
ru: "Новый продавец на {marketplaceName}",
|
|
3777
|
+
es: "Nuevo vendedor registrado en {marketplaceName}",
|
|
3778
|
+
fr: "Nouveau vendeur inscrit sur {marketplaceName}",
|
|
3779
|
+
de: "Neuer Verkäufer auf {marketplaceName} registriert",
|
|
3780
|
+
it: "Nuovo venditore registrato su {marketplaceName}",
|
|
3781
|
+
pt: "Novo vendedor registrado em {marketplaceName}",
|
|
3782
|
+
nl: "Nieuwe verkoper geregistreerd op {marketplaceName}",
|
|
3783
|
+
pl: "Nowy sprzedawca zarejestrowany na {marketplaceName}",
|
|
3784
|
+
tr: "{marketplaceName} üzerinde yeni satıcı kaydı",
|
|
3785
|
+
ja: "{marketplaceName}に新しい販売者が登録しました",
|
|
3786
|
+
ko: "{marketplaceName}에 새 판매자 등록",
|
|
3787
|
+
zh: "{marketplaceName}有新卖家注册",
|
|
3788
|
+
},
|
|
3789
|
+
dashboardButtonText: {
|
|
3790
|
+
en: "Go to my dashboard",
|
|
3791
|
+
he: "כניסה ללוח הבקרה",
|
|
3792
|
+
ar: "الانتقال إلى لوحة التحكم",
|
|
3793
|
+
ru: "Перейти в панель управления",
|
|
3794
|
+
es: "Ir a mi panel",
|
|
3795
|
+
fr: "Accéder à mon tableau de bord",
|
|
3796
|
+
de: "Zu meinem Dashboard",
|
|
3797
|
+
it: "Vai alla mia dashboard",
|
|
3798
|
+
pt: "Ir para o meu painel",
|
|
3799
|
+
nl: "Naar mijn dashboard",
|
|
3800
|
+
pl: "Przejdź do panelu",
|
|
3801
|
+
tr: "Panelime git",
|
|
3802
|
+
ja: "ダッシュボードへ移動",
|
|
3803
|
+
ko: "내 대시보드로 이동",
|
|
3804
|
+
zh: "前往我的控制台",
|
|
3805
|
+
},
|
|
3806
|
+
viewSellersButtonText: {
|
|
3807
|
+
en: "View my sellers",
|
|
3808
|
+
he: "צפייה במוכרים שלי",
|
|
3809
|
+
ar: "عرض البائعين",
|
|
3810
|
+
ru: "Мои продавцы",
|
|
3811
|
+
es: "Ver mis vendedores",
|
|
3812
|
+
fr: "Voir mes vendeurs",
|
|
3813
|
+
de: "Meine Verkäufer anzeigen",
|
|
3814
|
+
it: "Visualizza i miei venditori",
|
|
3815
|
+
pt: "Ver meus vendedores",
|
|
3816
|
+
nl: "Mijn verkopers bekijken",
|
|
3817
|
+
pl: "Zobacz moich sprzedawców",
|
|
3818
|
+
tr: "Satıcılarımı görüntüle",
|
|
3819
|
+
ja: "販売者一覧を見る",
|
|
3820
|
+
ko: "내 판매자 보기",
|
|
3821
|
+
zh: "查看我的卖家",
|
|
3822
|
+
},
|
|
3823
|
+
newAccountCreatedSubject: {
|
|
3824
|
+
en: "Welcome to {marketplaceName}",
|
|
3825
|
+
he: "ברוכים הבאים ל-{marketplaceName}",
|
|
3826
|
+
ar: "مرحبًا بك في {marketplaceName}",
|
|
3827
|
+
ru: "Добро пожаловать в {marketplaceName}",
|
|
3828
|
+
es: "Bienvenido a {marketplaceName}",
|
|
3829
|
+
fr: "Bienvenue sur {marketplaceName}",
|
|
3830
|
+
de: "Willkommen bei {marketplaceName}",
|
|
3831
|
+
it: "Benvenuto su {marketplaceName}",
|
|
3832
|
+
pt: "Bem-vindo ao {marketplaceName}",
|
|
3833
|
+
nl: "Welkom bij {marketplaceName}",
|
|
3834
|
+
pl: "Witamy w {marketplaceName}",
|
|
3835
|
+
tr: "{marketplaceName}'e hoş geldiniz",
|
|
3836
|
+
ja: "{marketplaceName}へようこそ",
|
|
3837
|
+
ko: "{marketplaceName}에 오신 것을 환영합니다",
|
|
3838
|
+
zh: "欢迎来到{marketplaceName}",
|
|
3839
|
+
},
|
|
3840
|
+
emailVerificationLinkInvalid: {
|
|
3841
|
+
en: "This verification link is invalid, has expired or was already used. Sign in to request a new one.",
|
|
3842
|
+
he: "קישור האימות אינו תקין, פג תוקפו או שכבר נעשה בו שימוש. יש להתחבר כדי לבקש קישור חדש.",
|
|
3843
|
+
ar: "رابط التحقق هذا غير صالح أو منتهي الصلاحية أو تم استخدامه بالفعل. سجّل الدخول لطلب رابط جديد.",
|
|
3844
|
+
ru: "Ссылка для подтверждения недействительна, устарела или уже использована. Войдите, чтобы запросить новую.",
|
|
3845
|
+
es: "Este enlace de verificación no es válido, ha caducado o ya se utilizó. Inicia sesión para solicitar uno nuevo.",
|
|
3846
|
+
fr: "Ce lien de vérification est invalide, a expiré ou a déjà été utilisé. Connectez-vous pour en demander un nouveau.",
|
|
3847
|
+
de: "Dieser Bestätigungslink ist ungültig, abgelaufen oder wurde bereits verwendet. Melden Sie sich an, um einen neuen anzufordern.",
|
|
3848
|
+
it: "Questo link di verifica non è valido, è scaduto o è già stato usato. Accedi per richiederne uno nuovo.",
|
|
3849
|
+
pt: "Este link de verificação é inválido, expirou ou já foi usado. Entre para solicitar um novo.",
|
|
3850
|
+
nl: "Deze verificatielink is ongeldig, verlopen of al gebruikt. Log in om een nieuwe aan te vragen.",
|
|
3851
|
+
pl: "Ten link weryfikacyjny jest nieprawidłowy, wygasł lub został już użyty. Zaloguj się, aby poprosić o nowy.",
|
|
3852
|
+
tr: "Bu doğrulama bağlantısı geçersiz, süresi dolmuş veya zaten kullanılmış. Yeni bir bağlantı istemek için giriş yapın.",
|
|
3853
|
+
ja: "この確認リンクは無効、期限切れ、または使用済みです。ログインして新しいリンクをリクエストしてください。",
|
|
3854
|
+
ko: "이 인증 링크는 유효하지 않거나 만료되었거나 이미 사용되었습니다. 로그인하여 새 링크를 요청하세요.",
|
|
3855
|
+
zh: "此验证链接无效、已过期或已被使用。请登录以申请新的链接。",
|
|
3856
|
+
},
|
|
3857
|
+
verificationEmailResendTooSoon: {
|
|
3858
|
+
en: "We just sent you a verification email. Please wait a minute before requesting another one.",
|
|
3859
|
+
he: "שלחנו לך מייל אימות ממש עכשיו. יש להמתין דקה לפני שמבקשים מייל נוסף.",
|
|
3860
|
+
ar: "لقد أرسلنا لك للتو رسالة تحقق. يرجى الانتظار دقيقة قبل طلب رسالة أخرى.",
|
|
3861
|
+
ru: "Мы только что отправили вам письмо для подтверждения. Подождите минуту, прежде чем запрашивать новое.",
|
|
3862
|
+
es: "Acabamos de enviarte un correo de verificación. Espera un minuto antes de solicitar otro.",
|
|
3863
|
+
fr: "Nous venons de vous envoyer un e-mail de vérification. Veuillez patienter une minute avant d'en demander un autre.",
|
|
3864
|
+
de: "Wir haben Ihnen gerade eine Bestätigungs-E-Mail gesendet. Bitte warten Sie eine Minute, bevor Sie eine weitere anfordern.",
|
|
3865
|
+
it: "Ti abbiamo appena inviato un'email di verifica. Attendi un minuto prima di richiederne un'altra.",
|
|
3866
|
+
pt: "Acabamos de enviar um e-mail de verificação. Aguarde um minuto antes de solicitar outro.",
|
|
3867
|
+
nl: "We hebben je net een verificatie-e-mail gestuurd. Wacht een minuut voordat je een nieuwe aanvraagt.",
|
|
3868
|
+
pl: "Właśnie wysłaliśmy Ci e-mail weryfikacyjny. Odczekaj minutę, zanim poprosisz o kolejny.",
|
|
3869
|
+
tr: "Size az önce bir doğrulama e-postası gönderdik. Yenisini istemeden önce lütfen bir dakika bekleyin.",
|
|
3870
|
+
ja: "確認メールを送信したばかりです。再送信をリクエストする前に1分お待ちください。",
|
|
3871
|
+
ko: "방금 인증 이메일을 보냈습니다. 다시 요청하기 전에 1분만 기다려 주세요.",
|
|
3872
|
+
zh: "我们刚刚向您发送了验证邮件。请等待一分钟后再申请新的邮件。",
|
|
3873
|
+
},
|
|
3874
|
+
emailAlreadyVerified: {
|
|
3875
|
+
en: "Your email address is already verified.",
|
|
3876
|
+
he: "כתובת המייל שלך כבר מאומתת.",
|
|
3877
|
+
ar: "تم التحقق من بريدك الإلكتروني بالفعل.",
|
|
3878
|
+
ru: "Ваш адрес электронной почты уже подтверждён.",
|
|
3879
|
+
es: "Tu correo electrónico ya está verificado.",
|
|
3880
|
+
fr: "Votre adresse e-mail est déjà vérifiée.",
|
|
3881
|
+
de: "Ihre E-Mail-Adresse ist bereits bestätigt.",
|
|
3882
|
+
it: "Il tuo indirizzo email è già verificato.",
|
|
3883
|
+
pt: "Seu e-mail já está verificado.",
|
|
3884
|
+
nl: "Je e-mailadres is al geverifieerd.",
|
|
3885
|
+
pl: "Twój adres e-mail jest już zweryfikowany.",
|
|
3886
|
+
tr: "E-posta adresiniz zaten doğrulandı.",
|
|
3887
|
+
ja: "メールアドレスはすでに確認済みです。",
|
|
3888
|
+
ko: "이메일 주소가 이미 인증되었습니다.",
|
|
3889
|
+
zh: "您的邮箱地址已验证。",
|
|
3652
3890
|
},
|
|
3653
3891
|
orderWaitingForApprovalSubject: {
|
|
3654
3892
|
en: "Your order is pending approval",
|
|
@@ -3872,21 +4110,21 @@ export const translations: Record<keyof ITranslationKeys, Record<ILanguageEnum,
|
|
|
3872
4110
|
pl: "Twoje konto {accountName} zostało utworzone na {marketplaceName}.",
|
|
3873
4111
|
},
|
|
3874
4112
|
descriptionTopSellerRegistered: {
|
|
3875
|
-
en: "A new seller has registered on {marketplaceName}
|
|
3876
|
-
he: "מוכר
|
|
3877
|
-
ar: "
|
|
3878
|
-
ru: "
|
|
3879
|
-
es: "Un nuevo vendedor
|
|
3880
|
-
fr: "Un nouveau vendeur s'
|
|
3881
|
-
de: "Ein neuer Verkäufer hat sich auf {marketplaceName} registriert
|
|
3882
|
-
it: "Un nuovo venditore si è registrato su {marketplaceName}
|
|
3883
|
-
pt: "Um novo vendedor
|
|
3884
|
-
nl: "Een nieuwe verkoper heeft zich geregistreerd op {marketplaceName}
|
|
3885
|
-
pl: "Nowy sprzedawca zarejestrował się na {marketplaceName}
|
|
3886
|
-
tr: "
|
|
3887
|
-
ja: "{
|
|
3888
|
-
ko: "
|
|
3889
|
-
zh: "
|
|
4113
|
+
en: "A new seller, {accountName}, has just registered on {marketplaceName}.",
|
|
4114
|
+
he: "מוכר חדש, {accountName}, נרשם הרגע באתר {marketplaceName}.",
|
|
4115
|
+
ar: "سجّل بائع جديد، {accountName}، للتو في {marketplaceName}.",
|
|
4116
|
+
ru: "Новый продавец {accountName} только что зарегистрировался на {marketplaceName}.",
|
|
4117
|
+
es: "Un nuevo vendedor, {accountName}, acaba de registrarse en {marketplaceName}.",
|
|
4118
|
+
fr: "Un nouveau vendeur, {accountName}, vient de s'inscrire sur {marketplaceName}.",
|
|
4119
|
+
de: "Ein neuer Verkäufer, {accountName}, hat sich gerade auf {marketplaceName} registriert.",
|
|
4120
|
+
it: "Un nuovo venditore, {accountName}, si è appena registrato su {marketplaceName}.",
|
|
4121
|
+
pt: "Um novo vendedor, {accountName}, acabou de se registrar em {marketplaceName}.",
|
|
4122
|
+
nl: "Een nieuwe verkoper, {accountName}, heeft zich zojuist geregistreerd op {marketplaceName}.",
|
|
4123
|
+
pl: "Nowy sprzedawca, {accountName}, właśnie zarejestrował się na {marketplaceName}.",
|
|
4124
|
+
tr: "Yeni bir satıcı, {accountName}, az önce {marketplaceName} üzerinde kayıt oldu.",
|
|
4125
|
+
ja: "新しい販売者「{accountName}」が{marketplaceName}に登録しました。",
|
|
4126
|
+
ko: "새로운 판매자 {accountName}님이 {marketplaceName}에 방금 등록했습니다.",
|
|
4127
|
+
zh: "新卖家 {accountName} 刚刚在{marketplaceName}注册。",
|
|
3890
4128
|
},
|
|
3891
4129
|
descriptionTopForgetPassword: {
|
|
3892
4130
|
en: "Click on the link below to reset your password, the link is available for 15 minutes only",
|
|
@@ -5471,6 +5709,45 @@ export const translations: Record<keyof ITranslationKeys, Record<ILanguageEnum,
|
|
|
5471
5709
|
ko: "지원팀에 문의",
|
|
5472
5710
|
zh: "联系支持",
|
|
5473
5711
|
},
|
|
5712
|
+
// #1305 — a gate scanner may only admit the events its own scanner session covers. The refusal is
|
|
5713
|
+
// returned as the same resolved envelope as the other refusals on that route, which carries the
|
|
5714
|
+
// real 403 plus a machine-readable error name, so the frontend can tell "wrong gate, offer a
|
|
5715
|
+
// deliberate override" from an ordinary failure — and the copy the officer reads is translated.
|
|
5716
|
+
// {stationName} and {eventName} are substituted by getTranslation.
|
|
5717
|
+
sessionCheckInEventNotInStation: {
|
|
5718
|
+
en: "This gate ({stationName}) is not set up for {eventName}",
|
|
5719
|
+
he: "העמדה הזו ({stationName}) אינה מוגדרת עבור {eventName}",
|
|
5720
|
+
ar: "هذا المدخل ({stationName}) غير معدّ لـ{eventName}",
|
|
5721
|
+
ru: "Этот пункт входа ({stationName}) не настроен для {eventName}",
|
|
5722
|
+
es: "Esta entrada ({stationName}) no está configurada para {eventName}",
|
|
5723
|
+
fr: "Cette entrée ({stationName}) n'est pas configurée pour {eventName}",
|
|
5724
|
+
de: "Dieser Eingang ({stationName}) ist nicht für {eventName} eingerichtet",
|
|
5725
|
+
it: "Questo ingresso ({stationName}) non è configurato per {eventName}",
|
|
5726
|
+
pt: "Esta entrada ({stationName}) não está configurada para {eventName}",
|
|
5727
|
+
nl: "Deze ingang ({stationName}) is niet ingesteld voor {eventName}",
|
|
5728
|
+
pl: "To wejście ({stationName}) nie jest skonfigurowane dla {eventName}",
|
|
5729
|
+
tr: "Bu giriş ({stationName}) {eventName} için ayarlanmamış",
|
|
5730
|
+
ja: "このゲート({stationName})は{eventName}用に設定されていません",
|
|
5731
|
+
ko: "이 게이트({stationName})는 {eventName}에 대해 설정되지 않았습니다",
|
|
5732
|
+
zh: "此入口({stationName})未为{eventName}配置",
|
|
5733
|
+
},
|
|
5734
|
+
sessionCheckInStationAccountMismatch: {
|
|
5735
|
+
en: "This gate belongs to a different account",
|
|
5736
|
+
he: "העמדה הזו שייכת לחשבון אחר",
|
|
5737
|
+
ar: "هذا المدخل ينتمي إلى حساب آخر",
|
|
5738
|
+
ru: "Этот пункт входа принадлежит другой учётной записи",
|
|
5739
|
+
es: "Esta entrada pertenece a otra cuenta",
|
|
5740
|
+
fr: "Cette entrée appartient à un autre compte",
|
|
5741
|
+
de: "Dieser Eingang gehört zu einem anderen Konto",
|
|
5742
|
+
it: "Questo ingresso appartiene a un altro account",
|
|
5743
|
+
pt: "Esta entrada pertence a outra conta",
|
|
5744
|
+
nl: "Deze ingang hoort bij een ander account",
|
|
5745
|
+
pl: "To wejście należy do innego konta",
|
|
5746
|
+
tr: "Bu giriş başka bir hesaba ait",
|
|
5747
|
+
ja: "このゲートは別のアカウントのものです",
|
|
5748
|
+
ko: "이 게이트는 다른 계정에 속해 있습니다",
|
|
5749
|
+
zh: "此入口属于其他账户",
|
|
5750
|
+
},
|
|
5474
5751
|
basketCheckInTicketNotFoundInOrder: {
|
|
5475
5752
|
en: "Ticket not found in this order",
|
|
5476
5753
|
he: "כרטיס לא נמצא בהזמנה זו",
|
|
@@ -6854,8 +7131,34 @@ export const translations: Record<keyof ITranslationKeys, Record<ILanguageEnum,
|
|
|
6854
7131
|
},
|
|
6855
7132
|
};
|
|
6856
7133
|
|
|
7134
|
+
/**
|
|
7135
|
+
* #1305 — normalise a caller-supplied language before it is used to pick copy.
|
|
7136
|
+
*
|
|
7137
|
+
* Every service reads the viewer's language straight off the `X-User-Language` header with a bare
|
|
7138
|
+
* cast (`req.headers["x-user-language"] as ILanguageEnum`), sometimes with `|| ILanguageEnum.en`.
|
|
7139
|
+
* That cast is a lie about caller-supplied data: a proxy can duplicate the header into an array,
|
|
7140
|
+
* and a browser can send a regional tag such as "he-IL". Neither is a member of the enum, and
|
|
7141
|
+
* `|| ILanguageEnum.en` does not catch "he-IL" because a non-empty string is truthy -- so the value
|
|
7142
|
+
* reached a lookup that returned undefined.
|
|
7143
|
+
*
|
|
7144
|
+
* Returns undefined for anything unsupported, so a caller's own default applies.
|
|
7145
|
+
*/
|
|
7146
|
+
export const resolveLanguage = (value: string | string[] | undefined): ILanguageEnum | undefined => {
|
|
7147
|
+
const raw = Array.isArray(value) ? value[0] : value;
|
|
7148
|
+
const candidate = raw?.trim().toLowerCase().split(/[-_]/)[0];
|
|
7149
|
+
return (Object.values(ILanguageEnum) as string[]).includes(candidate as string)
|
|
7150
|
+
? (candidate as ILanguageEnum)
|
|
7151
|
+
: undefined;
|
|
7152
|
+
};
|
|
7153
|
+
|
|
6857
7154
|
export const getTranslation = (key: keyof ITranslationKeys, language: ILanguageEnum, params: Record<string, string>): string => {
|
|
6858
|
-
|
|
7155
|
+
// #1305 — `language` arrives from caller-supplied input across several services: a query string,
|
|
7156
|
+
// and the X-User-Language header, which a proxy can duplicate into an array and a browser can set
|
|
7157
|
+
// to a regional tag like "he-IL". Indexing with any of those yields undefined and the substitution
|
|
7158
|
+
// below then threw a TypeError, surfacing as a 500 — on the basket check-in route that is the
|
|
7159
|
+
// SUCCESS path, so a malformed header failed a legitimate scan at a turnstile. A translation
|
|
7160
|
+
// lookup degrades to English rather than throwing; callers normalise with resolveLanguage above.
|
|
7161
|
+
let translation = translations[key][language] ?? translations[key][ILanguageEnum.en];
|
|
6859
7162
|
|
|
6860
7163
|
// Replace all parameters in the translation. Function replacer: a plain string replacement would
|
|
6861
7164
|
// interpret "$&", "$'", "$`" and "$$" inside user-entered values (group names, notes).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getTranslation } from "@nimee/translations";
|
|
1
|
+
import { getTranslation, resolveLanguage } from "@nimee/translations";
|
|
2
2
|
import { ILanguageEnum } from "@nimee/shared-types";
|
|
3
3
|
|
|
4
4
|
describe("Translations", () => {
|
|
@@ -242,4 +242,59 @@ describe("Translations", () => {
|
|
|
242
242
|
);
|
|
243
243
|
});
|
|
244
244
|
});
|
|
245
|
+
describe("an unsupported language does not throw (#1305)", () => {
|
|
246
|
+
/**
|
|
247
|
+
* `language` reaches this function from caller-supplied input across several services -- a query
|
|
248
|
+
* string, and (since #1305) the X-User-Language header, which a proxy can duplicate into an
|
|
249
|
+
* array and a browser can set to a regional tag like "he-IL". Indexing the key with any of those
|
|
250
|
+
* returns undefined, and the parameter substitution below then threw a TypeError, surfacing as a
|
|
251
|
+
* 500. On the basket check-in route that sits on the SUCCESS path, so a malformed header would
|
|
252
|
+
* have failed a legitimate scan at a turnstile. A translation lookup must degrade, never throw.
|
|
253
|
+
*/
|
|
254
|
+
it("falls back to English for a regional tag", () => {
|
|
255
|
+
const translation = getTranslation("sessionCheckInEventNotInStation", "he-IL" as any, {
|
|
256
|
+
stationName: "Gate",
|
|
257
|
+
eventName: "Aquarium",
|
|
258
|
+
});
|
|
259
|
+
expect(translation).toBe("This gate (Gate) is not set up for Aquarium");
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it("falls back to English for a duplicated header arriving as an array", () => {
|
|
263
|
+
const translation = getTranslation("sessionCheckInEventNotInStation", ["he", "en"] as any, {
|
|
264
|
+
stationName: "Gate",
|
|
265
|
+
eventName: "Aquarium",
|
|
266
|
+
});
|
|
267
|
+
expect(translation).toBe("This gate (Gate) is not set up for Aquarium");
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it("still substitutes params when falling back", () => {
|
|
271
|
+
const translation = getTranslation("sessionCheckInStationAccountMismatch", "klingon" as any, {});
|
|
272
|
+
expect(translation).toBe("This gate belongs to a different account");
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
describe("resolveLanguage (#1305)", () => {
|
|
276
|
+
it("accepts a supported language", () => {
|
|
277
|
+
expect(resolveLanguage("he")).toBe(ILanguageEnum.he);
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it("narrows a regional tag to its base language, so a browser's he-IL still gets Hebrew", () => {
|
|
281
|
+
expect(resolveLanguage("he-IL")).toBe(ILanguageEnum.he);
|
|
282
|
+
expect(resolveLanguage("pt_BR")).toBe(ILanguageEnum.pt);
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
it("takes the first value when a proxy duplicates the header into an array", () => {
|
|
286
|
+
expect(resolveLanguage(["he", "en"])).toBe(ILanguageEnum.he);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it("is case and whitespace insensitive", () => {
|
|
290
|
+
expect(resolveLanguage(" EN ")).toBe(ILanguageEnum.en);
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it("returns undefined for anything unsupported, leaving the caller's default in charge", () => {
|
|
294
|
+
expect(resolveLanguage("klingon")).toBeUndefined();
|
|
295
|
+
expect(resolveLanguage("")).toBeUndefined();
|
|
296
|
+
expect(resolveLanguage(undefined)).toBeUndefined();
|
|
297
|
+
expect(resolveLanguage([])).toBeUndefined();
|
|
298
|
+
});
|
|
299
|
+
});
|
|
245
300
|
});
|