|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
| 17 | +/** Category keys for translation sets (e.g., "errors", "messages", "labels", "prompts"). */ |
17 | 18 | export type TranslationCategory = keyof Required<Translations>; |
| 19 | + |
| 20 | +/** Generic type for translation keys within a specific category. */ |
18 | 21 | export type TranslationKey<T extends TranslationCategory> = keyof Required<Translations>[T]; |
| 22 | + |
| 23 | +/** Record type representing a complete set of translations for a specific category. */ |
19 | 24 | export type TranslationSet<T extends TranslationCategory> = Record<TranslationKey<T>, string>; |
| 25 | + |
| 26 | +/** Keys for error translation messages. */ |
20 | 27 | export type ErrorKey = keyof Required<Translations>["errors"]; |
| 28 | + |
| 29 | +/** Keys for informational message translations. */ |
21 | 30 | export type MessageKey = keyof Required<Translations>["messages"]; |
| 31 | + |
| 32 | +/** Keys for UI label translations. */ |
22 | 33 | export type LabelKey = keyof Required<Translations>["labels"]; |
| 34 | + |
| 35 | +/** Keys for prompt/instruction translations. */ |
23 | 36 | export type PromptKey = keyof Required<Translations>["prompts"]; |
| 37 | + |
| 38 | +/** Configuration type for translations, mapping locale identifiers to partial translation objects. */ |
24 | 39 | export type TranslationsConfig = Partial<Record<string, Partial<Translations>>>; |
25 | 40 |
|
| 41 | +/** Complete translations interface containing all translation categories and their keys. */ |
26 | 42 | export type Translations = { |
| 43 | + /** Error message translations. */ |
27 | 44 | errors?: { |
| 45 | + /** Translation for when a user is not found. */ |
28 | 46 | userNotFound?: string; |
| 47 | + /** Translation for incorrect password. */ |
29 | 48 | wrongPassword?: string; |
| 49 | + /** Translation for invalid email address. */ |
30 | 50 | invalidEmail?: string; |
| 51 | + /** Translation for disabled user account. */ |
31 | 52 | userDisabled?: string; |
| 53 | + /** Translation for unverified email address. */ |
32 | 54 | unverifiedEmail?: string; |
| 55 | + /** Translation for network request failure. */ |
33 | 56 | networkRequestFailed?: string; |
| 57 | + /** Translation for too many requests. */ |
34 | 58 | tooManyRequests?: string; |
| 59 | + /** Translation for email already in use. */ |
35 | 60 | emailAlreadyInUse?: string; |
| 61 | + /** Translation for missing verification code. */ |
36 | 62 | missingVerificationCode?: string; |
| 63 | + /** Translation for invalid credentials. */ |
37 | 64 | invalidCredential?: string; |
| 65 | + /** Translation for weak password. */ |
38 | 66 | weakPassword?: string; |
| 67 | + /** Translation for operation not allowed. */ |
39 | 68 | operationNotAllowed?: string; |
| 69 | + /** Translation for invalid phone number. */ |
40 | 70 | invalidPhoneNumber?: string; |
| 71 | + /** Translation for missing phone number. */ |
41 | 72 | missingPhoneNumber?: string; |
| 73 | + /** Translation for SMS quota exceeded. */ |
42 | 74 | quotaExceeded?: string; |
| 75 | + /** Translation for expired verification code. */ |
43 | 76 | codeExpired?: string; |
| 77 | + /** Translation for reCAPTCHA check failure. */ |
44 | 78 | captchaCheckFailed?: string; |
| 79 | + /** Translation for missing verification ID. */ |
45 | 80 | missingVerificationId?: string; |
| 81 | + /** Translation for missing email address. */ |
46 | 82 | missingEmail?: string; |
| 83 | + /** Translation for required display name. */ |
47 | 84 | displayNameRequired?: string; |
| 85 | + /** Translation for invalid action code. */ |
48 | 86 | invalidActionCode?: string; |
| 87 | + /** Translation for credential already in use. */ |
49 | 88 | credentialAlreadyInUse?: string; |
| 89 | + /** Translation for operation requiring recent login. */ |
50 | 90 | requiresRecentLogin?: string; |
| 91 | + /** Translation for provider already linked. */ |
51 | 92 | providerAlreadyLinked?: string; |
| 93 | + /** Translation for invalid verification code. */ |
52 | 94 | invalidVerificationCode?: string; |
| 95 | + /** Translation for unknown error. */ |
53 | 96 | unknownError?: string; |
| 97 | + /** Translation for popup closed by user. */ |
54 | 98 | popupClosed?: string; |
| 99 | + /** Translation for account existing with different credential. */ |
55 | 100 | accountExistsWithDifferentCredential?: string; |
| 101 | + /** Translation for second factor already in use. */ |
56 | 102 | secondFactorAlreadyInUse?: string; |
57 | 103 | }; |
| 104 | + /** Informational message translations. */ |
58 | 105 | messages?: { |
| 106 | + /** Translation for password reset email sent confirmation. */ |
59 | 107 | passwordResetEmailSent?: string; |
| 108 | + /** Translation for sign-in link sent confirmation. */ |
60 | 109 | signInLinkSent?: string; |
| 110 | + /** Translation for verification code required first. */ |
61 | 111 | verificationCodeFirst?: string; |
| 112 | + /** Translation for checking email for reset instructions. */ |
62 | 113 | checkEmailForReset?: string; |
| 114 | + /** Translation for "or" divider text. */ |
63 | 115 | dividerOr?: string; |
| 116 | + /** Translation for terms and privacy policy notice. */ |
64 | 117 | termsAndPrivacy?: string; |
| 118 | + /** Translation for MFA SMS assertion prompt message. */ |
65 | 119 | mfaSmsAssertionPrompt?: string; |
66 | 120 | }; |
| 121 | + /** UI label translations. */ |
67 | 122 | labels?: { |
| 123 | + /** Translation for email address label. */ |
68 | 124 | emailAddress?: string; |
| 125 | + /** Translation for password label. */ |
69 | 126 | password?: string; |
| 127 | + /** Translation for display name label. */ |
70 | 128 | displayName?: string; |
| 129 | + /** Translation for forgot password link. */ |
71 | 130 | forgotPassword?: string; |
| 131 | + /** Translation for sign up button/link. */ |
72 | 132 | signUp?: string; |
| 133 | + /** Translation for sign in button/link. */ |
73 | 134 | signIn?: string; |
| 135 | + /** Translation for reset password button. */ |
74 | 136 | resetPassword?: string; |
| 137 | + /** Translation for create account button. */ |
75 | 138 | createAccount?: string; |
| 139 | + /** Translation for back to sign in link. */ |
76 | 140 | backToSignIn?: string; |
| 141 | + /** Translation for sign in with phone button. */ |
77 | 142 | signInWithPhone?: string; |
| 143 | + /** Translation for phone number label. */ |
78 | 144 | phoneNumber?: string; |
| 145 | + /** Translation for verification code label. */ |
79 | 146 | verificationCode?: string; |
| 147 | + /** Translation for send code button. */ |
80 | 148 | sendCode?: string; |
| 149 | + /** Translation for verify code button. */ |
81 | 150 | verifyCode?: string; |
| 151 | + /** Translation for sign in with Google button. */ |
82 | 152 | signInWithGoogle?: string; |
| 153 | + /** Translation for sign in with Facebook button. */ |
83 | 154 | signInWithFacebook?: string; |
| 155 | + /** Translation for sign in with Apple button. */ |
84 | 156 | signInWithApple?: string; |
| 157 | + /** Translation for sign in with Twitter/X button. */ |
85 | 158 | signInWithTwitter?: string; |
| 159 | + /** Translation for sign in with Microsoft button. */ |
86 | 160 | signInWithMicrosoft?: string; |
| 161 | + /** Translation for sign in with GitHub button. */ |
87 | 162 | signInWithGitHub?: string; |
| 163 | + /** Translation for sign in with email link button. */ |
88 | 164 | signInWithEmailLink?: string; |
| 165 | + /** Translation for send sign-in link button. */ |
89 | 166 | sendSignInLink?: string; |
| 167 | + /** Translation for terms of service link. */ |
90 | 168 | termsOfService?: string; |
| 169 | + /** Translation for privacy policy link. */ |
91 | 170 | privacyPolicy?: string; |
| 171 | + /** Translation for resend code button. */ |
92 | 172 | resendCode?: string; |
| 173 | + /** Translation for sending state text. */ |
93 | 174 | sending?: string; |
| 175 | + /** Translation for multi-factor enrollment label. */ |
94 | 176 | multiFactorEnrollment?: string; |
| 177 | + /** Translation for multi-factor assertion label. */ |
95 | 178 | multiFactorAssertion?: string; |
| 179 | + /** Translation for TOTP verification label. */ |
96 | 180 | mfaTotpVerification?: string; |
| 181 | + /** Translation for SMS verification label. */ |
97 | 182 | mfaSmsVerification?: string; |
| 183 | + /** Translation for generate QR code button. */ |
98 | 184 | generateQrCode?: string; |
99 | 185 | }; |
| 186 | + /** Prompt and instruction translations. */ |
100 | 187 | prompts?: { |
| 188 | + /** Translation for "don't have an account" prompt. */ |
101 | 189 | noAccount?: string; |
| 190 | + /** Translation for "already have an account" prompt. */ |
102 | 191 | haveAccount?: string; |
| 192 | + /** Translation for enter email to reset password prompt. */ |
103 | 193 | enterEmailToReset?: string; |
| 194 | + /** Translation for sign in to account prompt. */ |
104 | 195 | signInToAccount?: string; |
| 196 | + /** Translation for enter details to create account prompt. */ |
105 | 197 | enterDetailsToCreate?: string; |
| 198 | + /** Translation for SMS verification code prompt. */ |
106 | 199 | smsVerificationPrompt?: string; |
| 200 | + /** Translation for enter phone number prompt. */ |
107 | 201 | enterPhoneNumber?: string; |
| 202 | + /** Translation for enter verification code prompt. */ |
108 | 203 | enterVerificationCode?: string; |
| 204 | + /** Translation for enter email for link prompt. */ |
109 | 205 | enterEmailForLink?: string; |
| 206 | + /** Translation for MFA enrollment prompt. */ |
110 | 207 | mfaEnrollmentPrompt?: string; |
| 208 | + /** Translation for MFA assertion prompt. */ |
111 | 209 | mfaAssertionPrompt?: string; |
| 210 | + /** Translation for MFA assertion factor selection prompt. */ |
112 | 211 | mfaAssertionFactorPrompt?: string; |
| 212 | + /** Translation for TOTP QR code prompt. */ |
113 | 213 | mfaTotpQrCodePrompt?: string; |
| 214 | + /** Translation for TOTP enrollment verification prompt. */ |
114 | 215 | mfaTotpEnrollmentVerificationPrompt?: string; |
115 | 216 | }; |
116 | 217 | }; |
0 commit comments