Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/lib/core/widgets/media_settings_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class _MediaSettingsWidgetState extends State<MediaSettingsWidget> {
isLoading = false;
});
},
hint: const Text('Select video input'),
hint: Text(context.l10n.selectVideoInput),
),
const SizedBox(height: 24),
Row(
Expand Down
3 changes: 2 additions & 1 deletion client/lib/features/admin/presentation/views/events_tab.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:client/core/localization/localization_helper.dart';
import 'package:client/core/utils/error_utils.dart';
import 'package:client/styles/styles.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -142,7 +143,7 @@ class _EventsTabState extends State<EventsTab> {
html.Url.revokeObjectUrl(blobUrl);
},
),
text: 'Download',
text: context.l10n.download,
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions client/lib/features/admin/presentation/views/members_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class _MembersTabState extends State<MembersTab> {
Widget _buildSearchBarField(List<Membership> memberships) {
return TextField(
decoration: InputDecoration(
hintText: 'Search',
hintText: context.l10n.search,
border: InputBorder.none,
),
onChanged: (value) {
Expand Down Expand Up @@ -516,7 +516,7 @@ class _MembersTabState extends State<MembersTab> {
),
SizedBox(width: 8),
Tooltip(
message: 'Download members data',
message: context.l10n.downloadMembersData,
child: ActionButton(
type: ActionButtonType.outline,
height: 40,
Expand Down Expand Up @@ -556,7 +556,7 @@ class _MembersTabState extends State<MembersTab> {
!isNullOrEmpty(_currentSearch)) {
return Padding(
padding: const EdgeInsets.all(8),
child: Text('No matching members found.'),
child: Text(context.l10n.noMatchingMembersFound),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ class _ChatWidgetState extends State<_ChatWidget> {
Widget _buildDefaultMessage() => Center(
child: EmptyPageContent(
type: EmptyPageType.chats,
titleText: 'Welcome!',
subtitleText: 'Please introduce yourself to help break the ice.',
titleText: context.l10n.chatWelcome,
subtitleText: context.l10n.chatIntroduceYourself,
showContainer: false,
isBackgroundDark: Theme.of(context).isDark,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class _CreateCommunityDialogState extends State<_CreateCommunityDialog> {
!isEmailValid(contactEmail)) {
showRegularToast(
context,
'Please enter a valid email',
context.l10n.pleaseEnterValidEmail,
toastType: ToastType.failed,
);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class _CreateCommunityTextFieldsState extends State<CreateCommunityTextFields> {
Column(
children: [
_buildCreateCommunityTextField(
hint: 'Ex: Protecting the earth from all invaders',
label: 'Tagline',
hint: context.l10n.taglineHint,
label: context.l10n.tagline,
initialValue: widget.community.tagLine,
onChanged: widget.onTaglineChanged,
maxLength: taglineMaxCharactersLength,
Expand All @@ -130,8 +130,8 @@ class _CreateCommunityTextFieldsState extends State<CreateCommunityTextFields> {
height: widget.compact ? 0 : 10,
),
_buildCreateCommunityTextField(
label: 'About',
hint: 'Add more detail as to the goals of this community',
label: context.l10n.about,
hint: context.l10n.aboutHint,
initialValue: widget.community.description,
onChanged: widget.onAboutChanged,
focus: widget.aboutFocus,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:client/core/localization/localization_helper.dart';
import 'package:client/styles/styles.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
Expand Down Expand Up @@ -183,9 +184,9 @@ class _DonateWidgetState extends State<DonateWidget> {
controller: _otherAmountController,
style: style,
decoration: InputDecoration(
labelText: 'Enter Amount',
labelText: context.l10n.enterAmount,
prefixText: '\$',
errorText: hasError ? 'Please enter a valid amount' : null,
errorText: hasError ? context.l10n.pleaseEnterValidAmount : null,
hintStyle: style,
helperStyle: style,
labelStyle: style,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:client/core/utils/toast_utils.dart';
import 'package:client/features/discussion_threads/data/models/discussion_thread_comment_ui.dart';
import 'package:client/services.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:client/features/community/data/providers/community_provider.dart';
Expand Down Expand Up @@ -165,7 +166,7 @@ class DiscussionThreadPresenter {
communityId: _communityProvider.communityId,
discussionThreadId: _model.discussionThreadId,
);
_view.showMessage('Post was deleted', toastType: ToastType.success);
_view.showMessage(appLocalizationService.getLocalization().postWasDeleted, toastType: ToastType.success);
}

String? getUserId() {
Expand Down Expand Up @@ -234,7 +235,7 @@ class DiscussionThreadPresenter {
discussionThreadComment: discussionThreadComment,
);

_view.showMessage('Comment was deleted', toastType: ToastType.success);
_view.showMessage(appLocalizationService.getLocalization().commentWasDeleted, toastType: ToastType.success);
}

int getCommentCount(List<DiscussionThreadComment> discussionThreadComments) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:client/core/utils/toast_utils.dart';
import 'package:client/services.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:client/features/discussion_threads/data/services/discussion_threads_helper.dart';
Expand Down Expand Up @@ -53,10 +54,11 @@ class ManipulateDiscussionThreadPresenter {
}

String getPositiveButtonText() {
final l10n = appLocalizationService.getLocalization();
if (_model.existingDiscussionThread != null) {
return 'Update';
return l10n.updateAction;
} else {
return 'Post';
return l10n.postAction;
}
}

Expand All @@ -83,7 +85,7 @@ class ManipulateDiscussionThreadPresenter {
discussionThread,
);

_view.showMessage('Post has been created', toastType: ToastType.success);
_view.showMessage(appLocalizationService.getLocalization().postHasBeenCreated, toastType: ToastType.success);
return true;
}

Expand All @@ -108,7 +110,7 @@ class ManipulateDiscussionThreadPresenter {
communityId,
discussionThread,
);
_view.showMessage('Post has been updated', toastType: ToastType.success);
_view.showMessage(appLocalizationService.getLocalization().postHasBeenUpdated, toastType: ToastType.success);

return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:client/core/localization/localization_helper.dart';
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
import 'package:flutter/material.dart';
import 'package:client/features/events/features/create_event/data/providers/create_event_dialog_model.dart';
Expand All @@ -20,7 +21,7 @@ class SelectDatePage extends StatelessWidget {
children: [
Center(
child: HeightConstrainedText(
'Select a day',
context.l10n.selectADay,
style: AppTextStyle.headline1,
),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:client/core/localization/localization_helper.dart';
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
import 'package:flutter/material.dart';
import 'package:client/features/events/features/create_event/data/providers/create_event_dialog_model.dart';
Expand Down Expand Up @@ -30,7 +31,7 @@ class _SelectTimePageState extends State<SelectTimePage> {
children: [
Center(
child: HeightConstrainedText(
'Select a time',
context.l10n.selectATime,
style: AppTextStyle.headline1,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ class EventSettingsPresenter {
}

String getTitle() {
final l10n = appLocalizationService.getLocalization();
switch (_model.eventSettingsDrawerType) {
case EventSettingsDrawerType.template:
return 'Template Settings';
return l10n.templateSettings;
case EventSettingsDrawerType.event:
return 'Event Settings';
return l10n.eventSettings;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ class PrePostCardWidgetPresenter {

String? validateHeadline(String? text) {
if (text == null || text.trim().isEmpty) {
return 'Headline cannot be empty';
return appLocalizationService.getLocalization().headlineCannotBeEmpty;
} else {
return null;
}
}

String? validateMessage(String? text) {
if (text == null || text.trim().isEmpty) {
return 'Message cannot be empty';
return appLocalizationService.getLocalization().messageCannotBeEmpty;
} else {
return null;
}
Expand Down Expand Up @@ -102,13 +102,13 @@ class PrePostCardWidgetPresenter {
// Only do validation for the URL if button text exists
if (prePostUrls[urlIndex].buttonText != null) {
if (text == null || text.trim().isEmpty) {
return 'URL is not valid';
return appLocalizationService.getLocalization().urlIsNotValid;
}

final isUrlValid = Uri.tryParse(text) != null;

if (!isUrlValid) {
return 'URL is not valid';
return appLocalizationService.getLocalization().urlIsNotValid;
} else {
return null;
}
Expand Down Expand Up @@ -408,11 +408,12 @@ class PrePostCardWidgetPresenter {
}

String getTitle() {
final l10n = appLocalizationService.getLocalization();
switch (_model.prePostCardType) {
case PrePostCardType.preEvent:
return 'Pre-event';
return l10n.preEvent;
case PrePostCardType.postEvent:
return 'Post-event';
return l10n.postEvent;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class AgendaItemPresenter {
debugPrint(e.toString());
rethrow;
}
_view.showMessage('Agenda item was saved', toastType: ToastType.success);
_view.showMessage(appLocalizationService.getLocalization().agendaItemWasSaved, toastType: ToastType.success);
}

_model.isEditMode = false;
Expand Down Expand Up @@ -271,7 +271,7 @@ class AgendaItemPresenter {

Future<void> deleteAgendaItem() async {
await _agendaProvider.deleteAgendaItem(_model.agendaItem.id);
_view.showMessage('Agenda item was deleted', toastType: ToastType.success);
_view.showMessage(appLocalizationService.getLocalization().agendaItemWasDeleted, toastType: ToastType.success);
}

bool canExpand(bool inLiveMeeting, bool isCompleted, bool isCardActive) {
Expand Down Expand Up @@ -455,52 +455,54 @@ class AgendaItemHelper {
String? areRequiredFieldsInput(AgendaItemModel model) {
final agendaItemType = model.agendaItem.type;

final l10n = appLocalizationService.getLocalization();

switch (agendaItemType) {
case AgendaItemType.text:
if (model.agendaItemTextData.title.trim().isEmpty) {
return 'Title is required';
return l10n.titleIsRequired;
}

if (model.agendaItemTextData.content.trim().isEmpty) {
return 'Message is required';
return l10n.messageIsRequired;
}
break;
case AgendaItemType.video:
if (model.agendaItemVideoData.title.trim().isEmpty) {
return 'Title is required';
return l10n.titleIsRequired;
}

if (model.agendaItemVideoData.url.trim().isEmpty) {
return 'Video URL is required';
return l10n.videoUrlIsRequired;
}
break;
case AgendaItemType.image:
if (model.agendaItemImageData.title.trim().isEmpty) {
return 'Title is required';
return l10n.titleIsRequired;
}

if (model.agendaItemImageData.url.trim().isEmpty) {
return 'Image URL is required';
return l10n.imageUrlIsRequired;
}
break;
case AgendaItemType.poll:
if (model.agendaItemPollData.question.trim().isEmpty) {
return 'Question is required';
return l10n.questionIsRequired;
}

if (model.agendaItemPollData.answers.isEmpty) {
return 'Please add some answers';
return l10n.pleaseAddSomeAnswers;
}

break;
case AgendaItemType.wordCloud:
if (model.agendaItemWordCloudData.prompt.trim().isEmpty) {
return 'Word Cloud prompt is required';
return l10n.wordCloudPromptRequired;
}
break;
case AgendaItemType.userSuggestions:
if (model.agendaItemUserSuggestionsData.headline.trim().isEmpty) {
return 'Headline is required';
return l10n.headlineIsRequired;
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ class _LayoutOptionButtons extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Tooltip(
message: 'Gallery View',
message: context.l10n.galleryView,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
Expand All @@ -650,7 +650,7 @@ class _LayoutOptionButtons extends StatelessWidget {
),
),
Tooltip(
message: 'Stage View',
message: context.l10n.stageView,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:client/core/localization/localization_helper.dart';
import 'package:client/core/utils/navigation_utils.dart';
import 'package:client/core/widgets/custom_loading_indicator.dart';
import 'package:data_models/analytics/analytics_entities.dart';
Expand Down Expand Up @@ -179,7 +180,7 @@ class _MeetingRatingState extends State<MeetingRating> {
Container(
color: Colors.transparent,
child: HeightConstrainedText(
'How was the event?',
context.l10n.howWasTheEvent,
maxLines: 4,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
Expand Down
Loading
Loading