feat: error messages in fields

This commit is contained in:
Stein Milder 2022-09-27 11:09:33 +02:00
parent 48f652e6ea
commit ebe6d8a9e9
3 changed files with 7 additions and 94 deletions

View file

@ -6,10 +6,7 @@ Map<String, Map<String, String>> defaultTranslation = {
'Gebruikersnaam of wachtwoord is niet bekend', 'Gebruikersnaam of wachtwoord is niet bekend',
'login.error.connection_required': 'login.error.connection_required':
'Een verbinding met het internet is benodigd om in te loggen', 'Een verbinding met het internet is benodigd om in te loggen',
'login.error.email_unknown.registrationActive': 'login.error.email_unknown': 'E-mailadres is niet bekend',
'E-mailadres is niet bekend, check uw e-mailadres of maak een account aan',
'login.error.email_unknown.registrationNotActive':
'E-mailadres is niet bekend, check uw e-mailadres',
'login.error.password_invalid': 'Wachtwoord is onjuist', 'login.error.password_invalid': 'Wachtwoord is onjuist',
'login.error.invalid_email': 'E-mailadres is onjuist geformatteerd', 'login.error.invalid_email': 'E-mailadres is onjuist geformatteerd',
'login.error.too_many_attempts': 'U heeft te vaak proberen in te loggen', 'login.error.too_many_attempts': 'U heeft te vaak proberen in te loggen',
@ -23,92 +20,9 @@ Map<String, Map<String, String>> defaultTranslation = {
'signout.dialog.text.title': 'Uitloggen', 'signout.dialog.text.title': 'Uitloggen',
'signout.dialog.text.body': 'Weet je zeker dat je wilt uitloggen?', 'signout.dialog.text.body': 'Weet je zeker dat je wilt uitloggen?',
// widgets/change_password_screen.dart
'change_password.text.title': 'Wachtwoord wijzigen',
'change_password.input.current_password.label': 'Huidig wachtwoord',
'change_password.input.current_password.error': 'Onjuist wachtwoord',
'change_password.input.new_password.label': 'Nieuw wachtwoord',
'change_password.input.new_password.error':
'Wachtwoord moet minstens 8 tekens lang zijn',
'change_password.input.repeat_new_password.label':
'Herhaal nieuw wachtwoord',
'change_password.input.repeat_new_password.error':
'Wachtwoorden komen niet overeen',
'change_password.input.current_password.error.dialog.title':
'Het wachtwoord is onjuist',
'change_password.input.current_password.error.dialog.description':
'Probeer het opnieuw om je huidige wachtwoord in te vullen',
'change_password.input.current_password.error.dialog.button': 'Opnieuw',
'change_password.button.submit': 'Wijzigen',
'change_password.dialog.text.title': 'Wachtwoord aangepast',
'change_password.dialog.text.body':
'Je wachtwoord is aangepast, vanaf nu kan je inloggen met je nieuwe wachtwoord!',
'change_password.dialog.button.close': 'Sluiten',
// plugins/settings/input_field_generator.dart // plugins/settings/input_field_generator.dart
'settings.control.textfield.error.not_empty': 'Dit veld is verplicht!', 'settings.control.textfield.error.not_empty': 'Dit veld is verplicht!',
// plugins/registration/registration.dart
'registration.text.title': 'Registreren',
'registration.text.subtitle': 'Voer een e-mailadres\nen wachtwoord in',
'registration.text.subtitle_terms': 'Algemene Voorwaarden',
'registration.input.email.label': 'E-mailadres',
'registration.input.email.error.invalid_email':
'E-mailadres is onjuist geformatteerd',
'registration.input.password.label': 'Wachtwoord',
'registration.input.confirmation.label': 'Herhaal Wachtwoord',
'registration.input.password.error.password_length':
'Wachtwoord moet minstens 8 tekens lang zijn',
'registration.input.confirmation.error.confirmation_mismatch':
'Herhaling komt niet overeen met wachtwoord',
'registration.input.accept_terms.label':
'Ik accepteer de algemene voorwaarden',
'registration.input.accept_terms.error':
'U moet de voorwaarden accepteren om verder te gaan',
'registration.button.submit': 'Registreren',
'registration.error.email_in_use.title': 'Email adres in gebruik',
'registration.error.email_in_use.body':
'Dit email adres wordt al gebruikt voor\neen andere inlog methode',
'registration.error.email_in_use.button': 'Terug naar inlogscherm',
'registration.error_dialog.text.title': 'Fout tijdens het registreren',
'registration.error_dialog.text.body':
'Als u deze fout vaker ziet neem dan contact op de ontwikkelaar',
'registration.error_dialog.button.label': 'Ok',
// plugins/registration/registration_custom_pages.dart
'registration_custom_page.text.title': 'Registreren',
'registration_custom_page.error.required':
'Vul alle verplichte velden in (*)',
'registration_custom_page.button.next': 'Volgende',
// plugins/registration/email_know_dialog
'registration_email_known.dialog.text.title': 'Goed nieuws!',
'registration_email_known.dialog.text.body':
'Je e-mailadres heeft al een account.\nJe kan direct inloggen!',
'registration_email_known.dialog.button.login': 'Inloggen',
// plugins/registration/registration_wizard.dart
'registration_wizard.text.title': 'Nog geen account?',
'registration_wizard.text.subtitle': 'Maak een nieuw account aan!',
'registration_wizard.text.divider': 'Of',
'registration_wizard.button.register_with_email': 'Registreer met email',
'registration_wizard.button.register_with_phone_number':
'Registreer met telefoonnummer',
'registration_wizard.button.login': 'Inloggen',
'registration_wizard.button.back': 'Terug',
// plugins/registration/confirmation.dart
'registration_confirmation.dialog.text.title':
'Je bent succesvol geregistreerd',
'registration_confirmation.dialog.text.subtitle_1':
'Een account is aangemaakt.\n Probeer opnieuw te registreren.',
'registration_confirmation.dialog.text.subtitle_2_part_1':
'U heeft een account aangemaakt voor het e-mailadres: ',
'registration_confirmation.dialog.text.subtitle_2_part_2':
'\n Is dit e-mailadres niet correct? Registreer dan opnieuw',
'registration_confirmation.dialog.button.register': 'Registreer opnieuw',
'registration_confirmation.dialog.button.login': 'Inloggen',
// plugins/login/resend.dart // plugins/login/resend.dart
'login_resend_email.dialog.text.title': 'Opnieuw verstuurd!', 'login_resend_email.dialog.text.title': 'Opnieuw verstuurd!',
'login_resend_email.dialog.text.body': 'login_resend_email.dialog.text.body':
@ -130,6 +44,8 @@ Map<String, Map<String, String>> defaultTranslation = {
'login.button.login_email_only': 'Log in met link', 'login.button.login_email_only': 'Log in met link',
'login.button.login': 'Log in', 'login.button.login': 'Log in',
'login.button.forgot_password': 'Wachtwoord vergeten?', 'login.button.forgot_password': 'Wachtwoord vergeten?',
'login.text.enter_email': 'Geef uw e-mailadres op',
'login.text.enter_password': 'Geef uw wachtwoord op',
// plugins/login/login_await_email.dart // plugins/login/login_await_email.dart
'login_await_email.text.title': 'Email verstuurd', 'login_await_email.text.title': 'Email verstuurd',
@ -161,7 +77,7 @@ Map<String, Map<String, String>> defaultTranslation = {
'forgot_password.input.email': 'E-mailadres', 'forgot_password.input.email': 'E-mailadres',
'forgot_password.error.invalid_email': 'Ongeldig e-mailadres', 'forgot_password.error.invalid_email': 'Ongeldig e-mailadres',
'forgot_password.error.email_does_not_exist': 'forgot_password.error.email_does_not_exist':
'Geen account gevonden met het opgegeven e-mailadres.', 'Geen account gevonden met het e-mailadres.',
'forgot_password.button.submit': 'Verstuur', 'forgot_password.button.submit': 'Verstuur',
'forgot_password.dialog.text.title': 'Nieuw wachtwoord', 'forgot_password.dialog.text.title': 'Nieuw wachtwoord',
'forgot_password.dialog.text.body': r'Er is een link naar %1$ verstuurd.', 'forgot_password.dialog.text.body': r'Er is een link naar %1$ verstuurd.',

View file

@ -7,7 +7,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'backend/login_repository.dart'; import 'backend/login_repository.dart';
import 'default_theme.dart'; import 'default_theme.dart';
import 'extensions/widget.dart';
import 'flutter_login_view.dart'; import 'flutter_login_view.dart';
enum RegistrationMode { enum RegistrationMode {
@ -295,10 +294,8 @@ class RegistrationOptions {
class ConnectionOptions { class ConnectionOptions {
const ConnectionOptions({ const ConnectionOptions({
this.connectionSettings, this.connectionSettings,
this.cloudFunctionsUrl,
}); });
final Map? connectionSettings; final Map? connectionSettings;
final String? cloudFunctionsUrl;
} }
class LoginConfig extends StatefulWidget { class LoginConfig extends StatefulWidget {

View file

@ -134,7 +134,6 @@ class EmailLoginState extends LoginState<EmailPasswordLogin> {
var loginError = loginRepository.getLoginError(); var loginError = loginRepository.getLoginError();
setState(() { setState(() {
print(loginError);
switch (loginError) { switch (loginError) {
case 'login.error.invalid_email': case 'login.error.invalid_email':
_emailErrorMessage = loginError; _emailErrorMessage = loginError;
@ -215,7 +214,7 @@ class EmailLoginState extends LoginState<EmailPasswordLogin> {
return context.translate(_emailErrorMessage); return context.translate(_emailErrorMessage);
} }
if (value == null || value.isEmpty) { if (value == null || value.isEmpty) {
return 'Please enter an email address'; return context.translate('login.text.enter_email');
} }
return null; return null;
}, },
@ -238,7 +237,8 @@ class EmailLoginState extends LoginState<EmailPasswordLogin> {
return context.translate(_passwordErrorMessage); return context.translate(_passwordErrorMessage);
} }
if (value == null || value.isEmpty) { if (value == null || value.isEmpty) {
return 'Please enter a password'; return context
.translate('login.text.enter_password');
} }
return null; return null;
}, },