From dfd5296140597040b5a75a66627a57945e08314b Mon Sep 17 00:00:00 2001 From: Iankk Date: Fri, 2 Jul 2021 18:36:12 +0200 Subject: [PATCH] AN-48 : add more i18n --- .../association_action_card.dart | 2 +- .../create_action_dialog.dart | 29 ++++++---- .../edit_action_dialog.dart | 31 ++++++----- .../association_informations_dialog.dart | 5 +- .../dialog/delete_confirmation_dialog.dart | 6 ++- lib/components/edit_asso_dialog.dart | 16 +++--- .../messaging/send_message_form.dart | 5 +- lib/components/news_feed_like_component.dart | 5 +- lib/components/posts/create_post_dialog.dart | 8 +-- lib/components/posts/edit_post_dialog.dart | 15 +++--- lib/l10n/app_en.arb | 50 ++++++++++++----- lib/l10n/app_fr.arb | 54 +++++++++++++------ lib/pages/association/action_management.dart | 5 +- lib/pages/association/association_page.dart | 6 ++- lib/pages/detail/association_apply_form.dart | 34 ++++++------ lib/pages/detail/association_details.dart | 5 +- lib/pages/detail/location.dart | 34 ------------ lib/pages/detail/signin_form.dart | 2 +- lib/pages/detail/user_conversation_page.dart | 46 ---------------- lib/pages/user/calendar_page.dart | 2 +- lib/pages/user/news_feed_page.dart | 4 +- 21 files changed, 185 insertions(+), 179 deletions(-) diff --git a/lib/components/associations_actions/association_action_card.dart b/lib/components/associations_actions/association_action_card.dart index 9765894..08132de 100644 --- a/lib/components/associations_actions/association_action_card.dart +++ b/lib/components/associations_actions/association_action_card.dart @@ -69,7 +69,7 @@ class _AsociationActionCardState extends State { onPressed: () => showModalBottomSheet( context: context, builder: (context) => DeleteObjectConfirmationDialog( - "Are you sure to delete this action ?", + AppLocalizations.of(context)!.delete_alert_action, null, this.widget._action), ), diff --git a/lib/components/associations_actions/create_action_dialog.dart b/lib/components/associations_actions/create_action_dialog.dart index 6bc61bf..4cb686d 100644 --- a/lib/components/associations_actions/create_action_dialog.dart +++ b/lib/components/associations_actions/create_action_dialog.dart @@ -2,6 +2,7 @@ import 'package:assosnation_app/components/posts/post_main_subtitle.dart'; import 'package:assosnation_app/components/posts/post_main_title.dart'; import 'package:assosnation_app/services/firebase/firestore/association_actions_service.dart'; import 'package:assosnation_app/services/models/association_action.dart'; +import 'package:assosnation_app/utils/imports/commons.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:date_time_picker/date_time_picker.dart'; import 'package:flutter/cupertino.dart'; @@ -46,7 +47,10 @@ class _CreateActionDialogState extends State { AssociationActionsService() .createAssociationActionForAssociation(action); Navigator.pop(context); - _displaySnackBarWithMessage("Your post has been created", Colors.green); + _displaySnackBarWithMessage( + //TODO change that + AppLocalizations.of(context)!.post_created, + Colors.green); } } } @@ -74,11 +78,12 @@ class _CreateActionDialogState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - PostMainTitle("Editing post"), + PostMainTitle(AppLocalizations.of(context)!.editing_post), Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - PostMainSubtitle("Title : "), + PostMainSubtitle( + AppLocalizations.of(context)!.title_label), Expanded( child: TextFormField( maxLength: 30, @@ -100,7 +105,7 @@ class _CreateActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("city : "), + PostMainSubtitle(AppLocalizations.of(context)!.city), Expanded( child: TextFormField( maxLength: 30, @@ -123,7 +128,8 @@ class _CreateActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("Postal code : "), + PostMainSubtitle( + AppLocalizations.of(context)!.postalcode), Expanded( child: TextFormField( maxLength: 5, @@ -146,7 +152,7 @@ class _CreateActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("Address : "), + PostMainSubtitle(AppLocalizations.of(context)!.address), Expanded( child: TextFormField( maxLength: 50, @@ -169,7 +175,8 @@ class _CreateActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("Description : "), + PostMainSubtitle( + AppLocalizations.of(context)!.description), //TODO int Expanded( child: TextFormField( maxLength: 150, @@ -219,7 +226,8 @@ class _CreateActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("Start date : "), + PostMainSubtitle( + AppLocalizations.of(context)!.start_date), Expanded( child: DateTimePicker( type: DateTimePickerType.dateTime, @@ -241,7 +249,7 @@ class _CreateActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("End date : "), + PostMainSubtitle(AppLocalizations.of(context)!.end_date), Expanded( child: DateTimePicker( type: DateTimePickerType.dateTime, @@ -265,7 +273,8 @@ class _CreateActionDialogState extends State { children: [ OutlinedButton( onPressed: () => Navigator.pop(context), - child: Text("Cancel", + child: Text( + AppLocalizations.of(context)!.cancel_button_label, style: TextStyle(color: Colors.red))), OutlinedButton( onPressed: _verifyAndValidateForm, diff --git a/lib/components/associations_actions/edit_action_dialog.dart b/lib/components/associations_actions/edit_action_dialog.dart index 02e2700..6fec320 100644 --- a/lib/components/associations_actions/edit_action_dialog.dart +++ b/lib/components/associations_actions/edit_action_dialog.dart @@ -2,6 +2,7 @@ import 'package:assosnation_app/components/posts/post_main_subtitle.dart'; import 'package:assosnation_app/components/posts/post_main_title.dart'; import 'package:assosnation_app/services/firebase/firestore/association_actions_service.dart'; import 'package:assosnation_app/services/models/association_action.dart'; +import 'package:assosnation_app/utils/imports/commons.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:date_time_picker/date_time_picker.dart'; import 'package:flutter/cupertino.dart'; @@ -47,7 +48,8 @@ class _EditActionDialogState extends State { AssociationActionsService() .updateAssociationAction(widget._action, newAction); Navigator.pop(context); - _displaySnackBarWithMessage("Your post has been updated", Colors.green); + _displaySnackBarWithMessage( + AppLocalizations.of(context)!.post_updated, Colors.green); } } } @@ -75,11 +77,12 @@ class _EditActionDialogState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - PostMainTitle("Editing post"), + PostMainTitle(AppLocalizations.of(context)!.editing_post), Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - PostMainSubtitle("Title : "), + PostMainSubtitle( + AppLocalizations.of(context)!.title_label), Expanded( child: TextFormField( maxLength: 30, @@ -101,7 +104,7 @@ class _EditActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("city : "), + PostMainSubtitle(AppLocalizations.of(context)!.city), Expanded( child: TextFormField( maxLength: 30, @@ -124,7 +127,8 @@ class _EditActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("Postal code : "), + PostMainSubtitle( + AppLocalizations.of(context)!.postalcode), Expanded( child: TextFormField( maxLength: 5, @@ -147,7 +151,7 @@ class _EditActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("Address : "), + PostMainSubtitle(AppLocalizations.of(context)!.address), Expanded( child: TextFormField( maxLength: 50, @@ -170,7 +174,8 @@ class _EditActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("Description : "), + PostMainSubtitle( + AppLocalizations.of(context)!.description), Expanded( child: TextFormField( maxLength: 150, @@ -193,7 +198,7 @@ class _EditActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - PostMainSubtitle("Type : "), + PostMainSubtitle(AppLocalizations.of(context)!.type), Expanded( child: DropdownButton( value: _type, @@ -220,7 +225,8 @@ class _EditActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("Start date : "), + PostMainSubtitle( + AppLocalizations.of(context)!.start_date), Expanded( child: DateTimePicker( type: DateTimePickerType.dateTime, @@ -242,7 +248,7 @@ class _EditActionDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("End date : "), + PostMainSubtitle(AppLocalizations.of(context)!.end_date), Expanded( child: DateTimePicker( type: DateTimePickerType.dateTime, @@ -266,12 +272,13 @@ class _EditActionDialogState extends State { children: [ OutlinedButton( onPressed: () => Navigator.pop(context), - child: Text("Cancel", + child: Text( + AppLocalizations.of(context)!.cancel_button_label, style: TextStyle(color: Colors.red))), OutlinedButton( onPressed: _verifyAndValidateForm, child: Text( - "Confirm", + AppLocalizations.of(context)!.confirm_button_label, style: TextStyle(color: Colors.teal), )), ], diff --git a/lib/components/dialog/association_informations_dialog.dart b/lib/components/dialog/association_informations_dialog.dart index bc6f92a..d4139c3 100644 --- a/lib/components/dialog/association_informations_dialog.dart +++ b/lib/components/dialog/association_informations_dialog.dart @@ -1,5 +1,6 @@ import 'package:assosnation_app/components/posts/post_main_title.dart'; import 'package:assosnation_app/services/models/association.dart'; +import 'package:assosnation_app/utils/imports/commons.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,7 +17,7 @@ class AssociationInformationsDialog extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - PostMainTitle("Informations"), + PostMainTitle(AppLocalizations.of(context)!.global_infos_label), Row( children: [ Icon( @@ -67,7 +68,7 @@ class AssociationInformationsDialog extends StatelessWidget { children: [ OutlinedButton.icon( icon: Icon(CupertinoIcons.clear), - label: Text("Close"), + label: Text(AppLocalizations.of(context)!.close_label), onPressed: () => Navigator.pop(context), ), ], diff --git a/lib/components/dialog/delete_confirmation_dialog.dart b/lib/components/dialog/delete_confirmation_dialog.dart index 98c12ed..9642a56 100644 --- a/lib/components/dialog/delete_confirmation_dialog.dart +++ b/lib/components/dialog/delete_confirmation_dialog.dart @@ -1,6 +1,7 @@ import 'package:assosnation_app/services/firebase/firestore/association_actions_service.dart'; import 'package:assosnation_app/services/firebase/firestore/posts_service.dart'; import 'package:assosnation_app/services/models/association_action.dart'; +import 'package:assosnation_app/utils/imports/commons.dart'; import 'package:flutter/material.dart'; class DeleteObjectConfirmationDialog extends StatelessWidget { @@ -36,7 +37,7 @@ class DeleteObjectConfirmationDialog extends StatelessWidget { OutlinedButton( onPressed: () => Navigator.pop(context), child: Text( - "Cancel", + AppLocalizations.of(context)!.cancel_button_label, style: TextStyle(color: Colors.teal), )), OutlinedButton( @@ -49,7 +50,8 @@ class DeleteObjectConfirmationDialog extends StatelessWidget { } Navigator.pop(context); }, - child: Text("Delete", style: TextStyle(color: Colors.red))), + child: Text(AppLocalizations.of(context)!.delete_button, + style: TextStyle(color: Colors.red))), ], ) ], diff --git a/lib/components/edit_asso_dialog.dart b/lib/components/edit_asso_dialog.dart index bfe3543..d044fc3 100644 --- a/lib/components/edit_asso_dialog.dart +++ b/lib/components/edit_asso_dialog.dart @@ -1,6 +1,7 @@ import 'package:assosnation_app/components/posts/post_main_subtitle.dart'; import 'package:assosnation_app/services/firebase/firestore/association_service.dart'; import 'package:assosnation_app/services/models/association.dart'; +import 'package:assosnation_app/utils/imports/commons.dart'; import 'package:assosnation_app/utils/utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -42,12 +43,12 @@ class _EditAssoDetailsState extends State { } if (res == true) { Navigator.pop(context); - Utils.displaySnackBarWithMessage( - context, "Infos has been updated ! ", Colors.green); + Utils.displaySnackBarWithMessage(context, + AppLocalizations.of(context)!.infos_updated, Colors.green); } else { Navigator.pop(context); Utils.displaySnackBarWithMessage(context, - "Something wrong happened, please try again", Colors.red); + AppLocalizations.of(context)!.error_no_infos, Colors.red); } } } @@ -101,7 +102,7 @@ class _EditAssoDetailsState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("Content : "), + PostMainSubtitle(AppLocalizations.of(context)!.content_label), Expanded( child: TextFormField( maxLength: _selectMaxCharacters(), @@ -126,12 +127,13 @@ class _EditAssoDetailsState extends State { children: [ OutlinedButton( onPressed: () => Navigator.pop(context), - child: - Text("Cancel", style: TextStyle(color: Colors.red))), + child: Text( + AppLocalizations.of(context)!.cancel_button_label, + style: TextStyle(color: Colors.red))), OutlinedButton( onPressed: _verifyAndValidateForm, child: Text( - "Confirm", + AppLocalizations.of(context)!.confirm_button_label, style: TextStyle(color: Colors.teal), )), ], diff --git a/lib/components/messaging/send_message_form.dart b/lib/components/messaging/send_message_form.dart index 76b604a..253f282 100644 --- a/lib/components/messaging/send_message_form.dart +++ b/lib/components/messaging/send_message_form.dart @@ -1,4 +1,5 @@ import 'package:assosnation_app/services/firebase/firestore/messaging_service.dart'; +import 'package:assosnation_app/utils/imports/commons.dart'; import 'package:assosnation_app/utils/utils.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/cupertino.dart'; @@ -25,7 +26,9 @@ class _SendMessageFormState extends State { widget.convId, widget.sender, _msgToSend); if (!res) Utils.displaySnackBarWithMessage( - context, "Couldn't send your message", Colors.deepOrange); + context, + AppLocalizations.of(context)!.error_sending_message, + Colors.deepOrange); } } } diff --git a/lib/components/news_feed_like_component.dart b/lib/components/news_feed_like_component.dart index 3dd625e..75038f2 100644 --- a/lib/components/news_feed_like_component.dart +++ b/lib/components/news_feed_like_component.dart @@ -1,5 +1,6 @@ import 'package:assosnation_app/services/firebase/firestore/firestore_service.dart'; import 'package:assosnation_app/services/models/user.dart'; +import 'package:assosnation_app/utils/imports/commons.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -59,7 +60,9 @@ class _NewsFeedLikeComponentState extends State { icon: Icon(this.widget._userLiked ? Icons.thumb_up_alt_rounded : Icons.thumb_up_alt_outlined), - label: Text(this.widget._userLiked ? "Liked !" : "Like")), + label: Text(this.widget._userLiked + ? AppLocalizations.of(context)!.post_liked + : AppLocalizations.of(context)!.like_post)), ], ); } diff --git a/lib/components/posts/create_post_dialog.dart b/lib/components/posts/create_post_dialog.dart index e0bad00..2225fe6 100644 --- a/lib/components/posts/create_post_dialog.dart +++ b/lib/components/posts/create_post_dialog.dart @@ -30,13 +30,13 @@ class _CreatePostDialogState extends State { setState(() { _title = ""; _content = ""; - Utils.displaySnackBarWithMessage( - context, "Your post has been updated", Colors.green); + Utils.displaySnackBarWithMessage(context, + AppLocalizations.of(context)!.post_updated, Colors.green); }); } else { Navigator.pop(context); Utils.displaySnackBarWithMessage(context, - "Something wrong happened, please try again", Colors.red); + AppLocalizations.of(context)!.error_no_infos, Colors.red); } } } @@ -55,7 +55,7 @@ class _CreatePostDialogState extends State { padding: const EdgeInsets.all(8.0), child: Column( children: [ - FormMainTitle("Creating a post"), + FormMainTitle(AppLocalizations.of(context)!.post_creating), Row( children: [ FormSubTitle( diff --git a/lib/components/posts/edit_post_dialog.dart b/lib/components/posts/edit_post_dialog.dart index b57019c..9742ad7 100644 --- a/lib/components/posts/edit_post_dialog.dart +++ b/lib/components/posts/edit_post_dialog.dart @@ -2,6 +2,7 @@ import 'package:assosnation_app/components/posts/post_main_subtitle.dart'; import 'package:assosnation_app/components/posts/post_main_title.dart'; import 'package:assosnation_app/services/firebase/firestore/posts_service.dart'; import 'package:assosnation_app/services/models/post.dart'; +import 'package:assosnation_app/utils/imports/commons.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -28,11 +29,11 @@ class _EditPostDialogState extends State { if (res == true) { Navigator.pop(context); _displaySnackBarWithMessage( - "Your post has been updated", Colors.green); + AppLocalizations.of(context)!.post_updated, Colors.green); } else { Navigator.pop(context); _displaySnackBarWithMessage( - "Something wrong happened, please try again", Colors.red); + AppLocalizations.of(context)!.error_no_infos, Colors.red); } } } @@ -59,11 +60,11 @@ class _EditPostDialogState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - PostMainTitle("Editing post"), + PostMainTitle(AppLocalizations.of(context)!.editing_post), Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - PostMainSubtitle("Title : "), + PostMainSubtitle(AppLocalizations.of(context)!.title_label), Expanded( child: TextFormField( maxLength: 30, @@ -85,7 +86,8 @@ class _EditPostDialogState extends State { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PostMainSubtitle("Content : "), + PostMainSubtitle( + AppLocalizations.of(context)!.content_label), Expanded( child: TextFormField( maxLength: 150, @@ -110,7 +112,8 @@ class _EditPostDialogState extends State { children: [ OutlinedButton( onPressed: () => Navigator.pop(context), - child: Text("Cancel", + child: Text( + AppLocalizations.of(context)!.cancel_button_label, style: TextStyle(color: Colors.red))), OutlinedButton( onPressed: _verifyAndValidateForm, diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index ddcaa23..6842e15 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -36,18 +36,19 @@ }, "location_service_off": "Please activate the location service on your device", "my_association_infos": "My association's informations", - "address": "address", - "phone": "phone number", - "mail": "email", - "password": "password", - "firstname": "firstname", - "lastname": "lastname", - "president": "president", - "city": "city", - "postalcode": "postal code", - "start_date": "start date", - "end_date": "end date", - "search_placeholder": "search for an association", + "address": "Address", + "phone": "Phone number", + "mail": "Email", + "password": "Password", + "firstname": "Firstname", + "lastname": "Lastname", + "president": "President", + "city": "City", + "postalcode": "Postal code", + "description": "Description", + "start_date": "Start date", + "end_date": "End date", + "search_placeholder": "Search for an association", "error_no_infos": "Something wrong happened..", "no_messages_yet": "There are no messages yet", "email_input_placeholder": "Enter your email address", @@ -72,5 +73,28 @@ "no_events_yet": "There are no events created yet", "registered_to_events_label": "Registered !", "title_my_profile": "My profile", - "choose_option_photo": "Choose an option" + "choose_option_photo": "Choose an option", + "delete_alert_action": "Are you sure you want to delete this action ?", + "post_created" : "Your post has been created ! ", + "editing_post" : "Editing a post", + "post_updated" : "Your post has been updated !", + "type" : "Type", + "close_label" : "Close", + "error_sending_message" : "Your message could not be sent..", + "post_creating": "Creating a post", + "infos_updated": "Info has been updated ! ", + "post_liked": "Liked !", + "like_post": "Like", + "no_actions_available": "You haven't created any actions yet", + "infos_contact_support": "If you want to change this information, please contact the support.", + "application_sended": "Your application has been sent ! You will be contacted by our team soon.", + "enter_association_name": "Enter the association's Name", + "enter_president_name": "Enter the president's Name", + "enter_description": "Enter a description of your association", + "enter_asso_address": "Enter the association's address", + "enter_asso_phone": "Enter the assocation's phone", + "enter_asso_city": "Enter the assocation's city", + "enter_asso_postal_code": "Enter the assocation's postal code", + "enter_asso_email": "Enter the assocation's email address", + "my_assos_actions": "My association's actions" } \ No newline at end of file diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index c5df65d..3adb754 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -10,7 +10,7 @@ "user_tab_messaging": "Messagerie", "user_tab_discover": "Découvrir", "user_tab_profile": "Profil", - "user_tab_events": "Events", + "user_tab_events": "Evènements", "association_tab_posts": "Posts", "association_tab_events": "Evènement", "association_tab_messaging": "Messaging", @@ -36,18 +36,19 @@ }, "location_service_off": "Veuillez activer le service de localisation sur votre appareil", "my_association_infos": "Informations de mon association", - "address": "adresse", - "phone": "n° de téléphone", - "mail": "e-mail", - "password": "mot-de-passe", - "firstname": "prénom", - "lastname": "nom de famille", - "president": "président", - "city": "ville", - "postalcode": "code postale", - "start_date": "date du début", - "end_date": "date de fin", - "search_placeholder": "recherchez une association", + "address": "Adresse", + "phone": "N° de téléphone", + "mail": "E-mail", + "password": "Mot-de-passe", + "firstname": "Prénom", + "lastname": "Nom de famille", + "president": "Président", + "city": "Ville", + "postalcode": "Code postal", + "description": "Description", + "start_date": "Date du début", + "end_date": "Date de fin", + "search_placeholder": "Recherchez une association", "error_no_infos": "Une erreur est survenue...", "no_messages_yet": "Aucun messages", "email_input_placeholder": "Inserez votre adresse mail", @@ -64,7 +65,7 @@ "cancel_button_label": "Annuler", "confirm_button_label": "Confirmer", "delete_alert_msg": "Etes vous sur de vouloir supprimer ce post ?", - "connect_button": "Connexion", + "connect_button": "Se connecter", "failed_to_connect_snackbar": "La connexion a échouée, réessayez", "succeed_to_connect_snackbar": "Connexion réussie ! Bienvenue !", "send_application": "Envoyer votre candidature", @@ -72,5 +73,28 @@ "no_events_yet": "Aucun événement disponible pour cette association", "registered_to_events_label": "Inscrit !", "title_my_profile": "Mon profil", - "choose_option_photo": "Choisissez une option" + "choose_option_photo": "Choisissez une option", + "delete_alert_action": "Etes vous sur de vouloir supprimer cette action ?", + "post_created" : "Votre post a été créé ! ", + "editing_post" : "Editer mon post", + "post_updated" : "Votre post a été mis à jour !", + "type" : "Type", + "close_label" : "Fermer", + "error_sending_message" : "Votre message n'a pas pu être envoyé..", + "post_creating": "Créer un post", + "infos_updated": "Les informations ont bien été mises à jour ! ", + "post_liked": "J'aime !", + "like_post": "Aimer", + "no_actions_available": "Vous n'avez pas encore créé d'actions.", + "infos_contact_support": "Si vous souhaitez modifier cette information, veuillez contacter le support.", + "application_sended": "Votre demande a bien été envoyée ! Nous vous contacterons bientôt.", + "enter_association_name": "Entrez le nom de l'association", + "enter_president_name": "Entrez le nom du président", + "enter_description": "Entrez une description de votre association", + "enter_asso_address": "Entrez l'adresse de votre association", + "enter_asso_phone": "Entrez le numéro de téléphone de votre association", + "enter_asso_city": "Entrez la ville de votre association", + "enter_asso_postal_code": "Entrez le code postal de votre association", + "enter_asso_email": "Entrez l'adresse mail de votre association", + "my_assos_actions": "Actions de mes asso" } \ No newline at end of file diff --git a/lib/pages/association/action_management.dart b/lib/pages/association/action_management.dart index e76f485..fe8dfe9 100644 --- a/lib/pages/association/action_management.dart +++ b/lib/pages/association/action_management.dart @@ -5,6 +5,7 @@ import 'package:assosnation_app/services/firebase/firestore/association_service. import 'package:assosnation_app/services/models/association.dart'; import 'package:assosnation_app/services/models/association_action.dart'; import 'package:assosnation_app/utils/converters.dart'; +import 'package:assosnation_app/utils/imports/commons.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -46,8 +47,8 @@ class ActionManagement extends StatelessWidget { if (action != null) { return AssociationActionCard(action); } else { - return Text( - "Vous n'avez pas encore créé d'actions"); + return Text(AppLocalizations.of(context)! + .no_actions_available); } })), ]), diff --git a/lib/pages/association/association_page.dart b/lib/pages/association/association_page.dart index 2c1f69c..11e45fa 100644 --- a/lib/pages/association/association_page.dart +++ b/lib/pages/association/association_page.dart @@ -155,7 +155,8 @@ class AssociationPage extends StatelessWidget { size: 55, ), content: Text( - "If you want to change this information, please contact the support."), + AppLocalizations.of(context)! + .infos_contact_support), actions: [ CupertinoButton( child: Text("Ok"), @@ -191,7 +192,8 @@ class AssociationPage extends StatelessWidget { size: 55, ), content: Text( - "If you want to change this information, please contact the support."), + AppLocalizations.of(context)! + .infos_contact_support), actions: [ CupertinoButton( child: Text("Ok"), diff --git a/lib/pages/detail/association_apply_form.dart b/lib/pages/detail/association_apply_form.dart index 178e458..040f364 100644 --- a/lib/pages/detail/association_apply_form.dart +++ b/lib/pages/detail/association_apply_form.dart @@ -32,10 +32,10 @@ class _AssociationApplyFormState extends State { _phone, _address, _postalCode, _city, _president, _pwd); if (res == null) { _displaySnackBarWithMessage( - "Something wrong happened, please try again"); + AppLocalizations.of(context)!.error_no_infos); } else { _displaySnackBarWithMessage( - "Your application has been sent ! You will be contacted by our team soon"); + AppLocalizations.of(context)!.application_sended); } } } @@ -81,7 +81,8 @@ class _AssociationApplyFormState extends State { AppLocalizations.of(context)!.global_infos_label), TextFormField( decoration: InputDecoration( - labelText: "Enter the association's Name"), + labelText: AppLocalizations.of(context)! + .enter_association_name), keyboardType: TextInputType.name, autovalidateMode: AutovalidateMode.onUserInteraction, @@ -95,7 +96,8 @@ class _AssociationApplyFormState extends State { ), TextFormField( decoration: InputDecoration( - labelText: "Enter the president's name"), + labelText: AppLocalizations.of(context)! + .enter_president_name), keyboardType: TextInputType.name, autovalidateMode: AutovalidateMode.onUserInteraction, @@ -109,8 +111,8 @@ class _AssociationApplyFormState extends State { ), TextFormField( decoration: InputDecoration( - labelText: - "Enter the association's description"), + labelText: AppLocalizations.of(context)! + .enter_description), keyboardType: TextInputType.multiline, autovalidateMode: AutovalidateMode.onUserInteraction, @@ -133,8 +135,8 @@ class _AssociationApplyFormState extends State { .connection_infos_label), TextFormField( decoration: InputDecoration( - labelText: - "Enter the association email address"), + labelText: AppLocalizations.of(context)! + .enter_asso_email), keyboardType: TextInputType.emailAddress, autovalidateMode: AutovalidateMode.onUserInteraction, @@ -149,8 +151,8 @@ class _AssociationApplyFormState extends State { }), TextFormField( decoration: InputDecoration( - labelText: - "Enter the association phone number"), + labelText: AppLocalizations.of(context)! + .enter_asso_phone), keyboardType: TextInputType.phone, autovalidateMode: AutovalidateMode.onUserInteraction, @@ -172,7 +174,8 @@ class _AssociationApplyFormState extends State { AppLocalizations.of(context)!.postal_infos_label), TextFormField( decoration: InputDecoration( - labelText: "Enter the association's address"), + labelText: AppLocalizations.of(context)! + .enter_asso_address), keyboardType: TextInputType.streetAddress, autovalidateMode: AutovalidateMode.onUserInteraction, @@ -185,8 +188,9 @@ class _AssociationApplyFormState extends State { }, ), TextFormField( - decoration: - InputDecoration(labelText: "Enter the city"), + decoration: InputDecoration( + labelText: AppLocalizations.of(context)! + .enter_asso_city), keyboardType: TextInputType.name, autovalidateMode: AutovalidateMode.onUserInteraction, @@ -200,8 +204,8 @@ class _AssociationApplyFormState extends State { ), TextFormField( decoration: InputDecoration( - labelText: - "Enter the association's postal code"), + labelText: AppLocalizations.of(context)! + .enter_asso_postal_code), keyboardType: TextInputType.number, autovalidateMode: AutovalidateMode.onUserInteraction, diff --git a/lib/pages/detail/association_details.dart b/lib/pages/detail/association_details.dart index d644941..6074f58 100644 --- a/lib/pages/detail/association_details.dart +++ b/lib/pages/detail/association_details.dart @@ -190,9 +190,8 @@ class AssociationDetails extends StatelessWidget { } if (snapshot.hasError) { return Container( - child: Text("Something wrong happened"), - - /// TODO I18N + child: Text( + AppLocalizations.of(context)!.error_no_infos), ); } return Container(); diff --git a/lib/pages/detail/location.dart b/lib/pages/detail/location.dart index e6fe2e6..7e6b568 100644 --- a/lib/pages/detail/location.dart +++ b/lib/pages/detail/location.dart @@ -27,13 +27,6 @@ class _LocationState extends State { super.initState(); } - final Set markers2 = { - Marker( - markerId: MarkerId("toto"), - position: LatLng(48.811269, 2.350707), - infoWindow: InfoWindow(title: "Passerelle")), - }; - @override Widget build(BuildContext context) { return FutureBuilder( @@ -75,30 +68,3 @@ class _LocationState extends State { }); } } - -/* -FutureBuilder( - future: LocationService().generateMarkersList(widget.assosList), - builder: (context, AsyncSnapshot> snapshot2) { - if (snapshot.hasData && snapshot2.hasData) { - if (snapshot2.connectionState == ConnectionState.done) { - GoogleMap( - initialCameraPosition: LocationService().defaultPos, - markers: snapshot2.data!, - myLocationEnabled: true, - myLocationButtonEnabled: true, - compassEnabled: true, - onMapCreated: (controller) async { - _controller.complete(controller); - controller.animateCamera( - CameraUpdate.newCameraPosition(snapshot.data)); - }, - buildingsEnabled: false, - ); - } else - return CircularProgressIndicator(); - } - return Container(); - }, - ) - */ diff --git a/lib/pages/detail/signin_form.dart b/lib/pages/detail/signin_form.dart index e1bf003..ee2fa20 100644 --- a/lib/pages/detail/signin_form.dart +++ b/lib/pages/detail/signin_form.dart @@ -54,7 +54,7 @@ class _SignInFormState extends State { height: 120, ), ), - FormMainTitle("Login"), + FormMainTitle(AppLocalizations.of(context)!.signin_label), Padding( padding: const EdgeInsets.fromLTRB(5, 30, 10, 0), child: Column( diff --git a/lib/pages/detail/user_conversation_page.dart b/lib/pages/detail/user_conversation_page.dart index e10f6c2..f59ed92 100644 --- a/lib/pages/detail/user_conversation_page.dart +++ b/lib/pages/detail/user_conversation_page.dart @@ -86,49 +86,3 @@ class UserConvPage extends StatelessWidget { ); } } - -/* -FutureBuilder( - future: MessagingService() - .getAllMessagesByConversation(conversation.uid), - builder: (BuildContext build, AsyncSnapshot snapshots) { - if (snapshots.hasData) { - switch (snapshots.connectionState) { - case ConnectionState.waiting: - return CircularProgressIndicator(); - case ConnectionState.done: - return ListView.builder( - itemCount: snapshots.data!.length, - itemBuilder: (context, index) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: snapshots.data![index].sender.id == - _user.uid - ? MessageCard( - "${_user.firstName} ${_user.lastName}", - snapshots.data![index].content, - snapshots.data![index].timestamp, - true) - : MessageCard( - conversation.names.firstWhere((name) => - name != - "${_user.firstName} ${_user.lastName}"), - snapshots.data![index].content, - snapshots.data![index].timestamp, - false), - ), - ); - }, - ); - case ConnectionState.none: - return Container(); - case ConnectionState.active: - return CircularProgressIndicator(); - } - } - if (snapshots.hasError) return Container(); - return Container(); - }, - ) - */ diff --git a/lib/pages/user/calendar_page.dart b/lib/pages/user/calendar_page.dart index 7b42e6e..b4c679a 100644 --- a/lib/pages/user/calendar_page.dart +++ b/lib/pages/user/calendar_page.dart @@ -28,7 +28,7 @@ class _CalendarState extends State { children: [ ElevatedButton( onPressed: () => setState(() => _isFirstPart = true), - child: Text("Actions de mes assos")), + child: Text(AppLocalizations.of(context)!.my_assos_actions)), ElevatedButton( onPressed: () => setState(() => _isFirstPart = false), child: Text(AppLocalizations.of(context)!.all_events_label)), diff --git a/lib/pages/user/news_feed_page.dart b/lib/pages/user/news_feed_page.dart index 594091a..074fa63 100644 --- a/lib/pages/user/news_feed_page.dart +++ b/lib/pages/user/news_feed_page.dart @@ -1,6 +1,7 @@ import 'package:assosnation_app/components/news_feed_card.dart'; import 'package:assosnation_app/services/firebase/firestore/firestore_service.dart'; import 'package:assosnation_app/services/models/user.dart'; +import 'package:assosnation_app/utils/imports/commons.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -43,7 +44,8 @@ class NewsFeed extends StatelessWidget { if (snapshot.hasError) { print(snapshot.error); return Container( - child: Text("Something wrong happened"), + child: + Text(AppLocalizations.of(context)!.error_no_infos), ); } return Container();