featL add localization for various UI strings and error messages
This commit is contained in:
@@ -16,7 +16,7 @@ struct LoginView: View {
|
||||
.foregroundStyle(.red)
|
||||
Text("Mayday")
|
||||
.font(.largeTitle.bold())
|
||||
Text("Мониторинг и уведомления")
|
||||
Text("login_subtitle")
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
@@ -29,7 +29,7 @@ struct LoginView: View {
|
||||
.autocorrectionDisabled()
|
||||
.textInputAutocapitalization(.never)
|
||||
|
||||
SecureField("Пароль", text: $password)
|
||||
SecureField("password", text: $password)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.textContentType(.password)
|
||||
}
|
||||
@@ -48,14 +48,14 @@ struct LoginView: View {
|
||||
ProgressView()
|
||||
.frame(maxWidth: .infinity)
|
||||
} else {
|
||||
Text("Войти")
|
||||
Text("login_button")
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.disabled(email.isEmpty || password.isEmpty || authViewModel.isLoading)
|
||||
|
||||
Button("Нет аккаунта? Зарегистрироваться") {
|
||||
Button("login_no_account") {
|
||||
showRegister = true
|
||||
}
|
||||
.font(.footnote)
|
||||
@@ -64,7 +64,7 @@ struct LoginView: View {
|
||||
Button {
|
||||
Task { await authViewModel.enterPreviewMode() }
|
||||
} label: {
|
||||
Label("Демо-режим", systemImage: "play.circle.fill")
|
||||
Label("demo_mode", systemImage: "play.circle.fill")
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ struct RegisterView: View {
|
||||
VStack(spacing: 24) {
|
||||
Spacer()
|
||||
|
||||
Text("Регистрация")
|
||||
Text("register_title")
|
||||
.font(.largeTitle.bold())
|
||||
|
||||
VStack(spacing: 16) {
|
||||
@@ -25,23 +25,23 @@ struct RegisterView: View {
|
||||
.autocorrectionDisabled()
|
||||
.textInputAutocapitalization(.never)
|
||||
|
||||
SecureField("Пароль", text: $password)
|
||||
SecureField("password", text: $password)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.textContentType(.newPassword)
|
||||
|
||||
SecureField("Подтвердите пароль", text: $confirmPassword)
|
||||
SecureField("confirm_password", text: $confirmPassword)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.textContentType(.newPassword)
|
||||
}
|
||||
|
||||
if password.count > 0 && password.count < 8 {
|
||||
Text("Пароль должен содержать не менее 8 символов")
|
||||
Text("password_min_length")
|
||||
.foregroundStyle(.red)
|
||||
.font(.footnote)
|
||||
}
|
||||
|
||||
if confirmPassword.count > 0 && password != confirmPassword {
|
||||
Text("Пароли не совпадают")
|
||||
Text("passwords_mismatch")
|
||||
.foregroundStyle(.red)
|
||||
.font(.footnote)
|
||||
}
|
||||
@@ -65,13 +65,13 @@ struct RegisterView: View {
|
||||
if authViewModel.isLoading {
|
||||
ProgressView().frame(maxWidth: .infinity)
|
||||
} else {
|
||||
Text("Создать аккаунт").frame(maxWidth: .infinity)
|
||||
Text("register_button").frame(maxWidth: .infinity)
|
||||
}
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.disabled(!isFormValid || authViewModel.isLoading)
|
||||
|
||||
Button("Уже есть аккаунт?") { dismiss() }
|
||||
Button("register_has_account") { dismiss() }
|
||||
.font(.footnote)
|
||||
|
||||
Spacer()
|
||||
@@ -80,7 +80,7 @@ struct RegisterView: View {
|
||||
.navigationDestination(isPresented: $showVerify) {
|
||||
VerifyEmailView(email: registeredEmail)
|
||||
}
|
||||
.navigationTitle("Регистрация")
|
||||
.navigationTitle("register_title")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ struct VerifyEmailView: View {
|
||||
Spacer()
|
||||
|
||||
VStack(spacing: 8) {
|
||||
Text("Подтвердите email")
|
||||
Text("verify_email_title")
|
||||
.font(.largeTitle.bold())
|
||||
Text("Код отправлен на")
|
||||
Text("verify_code_sent_to")
|
||||
.foregroundStyle(.secondary)
|
||||
Text(email)
|
||||
.fontWeight(.semibold)
|
||||
@@ -51,9 +51,9 @@ struct VerifyEmailView: View {
|
||||
Task { await resendCode() }
|
||||
} label: {
|
||||
if resendCooldown > 0 {
|
||||
Text("Отправить повторно (\(resendCooldown) сек)")
|
||||
Text("verify_resend_cooldown \(resendCooldown)")
|
||||
} else {
|
||||
Text("Отправить повторно")
|
||||
Text("verify_resend")
|
||||
}
|
||||
}
|
||||
.disabled(resendCooldown > 0)
|
||||
@@ -61,7 +61,7 @@ struct VerifyEmailView: View {
|
||||
Spacer()
|
||||
}
|
||||
.padding()
|
||||
.navigationTitle("Подтверждение")
|
||||
.navigationTitle("verify_nav_title")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.onAppear { focusedIndex = 0 }
|
||||
.onDisappear { cooldownTask?.cancel() }
|
||||
|
||||
Reference in New Issue
Block a user