Skip to content

Commit

Permalink
LA-1355 changed total size error message
Browse files Browse the repository at this point in the history
  • Loading branch information
KhaledNjim authored and hoangdat committed Nov 22, 2024
1 parent a2462b7 commit 04551f1
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 12 deletions.
12 changes: 9 additions & 3 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1639,11 +1639,17 @@
"placeholders_order": [],
"placeholders": {}
},
"total_file_size_error": "Total size of files must be set and smaller than 100 GB",
"total_file_size_error": "Total size of files must be set and smaller than {maxSize} {unit}",
"@total_file_size_error": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
"placeholders_order": [
"maxSize",
"unit"
],
"placeholders": {
"maxSize": {},
"unit": {}
}
},
"add": "Add",
"@add": {
Expand Down
87 changes: 84 additions & 3 deletions lib/l10n/intl_messages.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2132,11 +2132,17 @@
"placeholders_order": [],
"placeholders": {}
},
"total_file_size_error": "Total size of files must be set and smaller than 100 GB",
"total_file_size_error": "Total size of files must be set and smaller than {maxSize} {unit}",
"@total_file_size_error": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
"placeholders_order": [
"maxSize",
"unit"
],
"placeholders": {
"maxSize": {},
"unit": {}
}
},
"add": "Add",
"@add": {
Expand Down Expand Up @@ -3167,5 +3173,80 @@
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"you_cant_delete_the_last_version": "You can't delete the last version, try to delete the whole document",
"@you_cant_delete_the_last_version": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"camera": "Camera",
"@camera": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"audio_recording": "Audio recording",
"@audio_recording": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"give_access_in_settings": "To continue using all features, please allow LinShare access to the Camera, Microphone, and Phone in your device settings. Camera and Microphone access are needed to capture photos, videos, and audio, while Phone access enables LinShare to automatically pause capture if you receive a call.",
"@give_access_in_settings": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"permission_required": "Permission required",
"@permission_required": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"recording_saved": "Recording saved",
"@recording_saved": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"permission_denied": "Permission denied",
"@permission_denied": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"error_while_recording": "An error has occured while recording",
"@error_while_recording": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"you_did_not_record_anything": "You did not record anything",
"@you_did_not_record_anything": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},

"you_cant_delete_the_last_version": "You can't delete the last version, try to delete the whole document",
"@you_cant_delete_the_last_version": {
"type": "text",
"placeholders_order": [],
"placeholders": {}

},
"exit": "Exit",
"@exit": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"are_you_sure_you_want_to_discard_recording": "Are you sure you want to discard this recording",
"@are_you_sure_you_want_to_discard_recording": {
"type": "text",
"placeholders_order": [],
"placeholders": {}

}
}
7 changes: 4 additions & 3 deletions lib/presentation/localizations/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2053,10 +2053,11 @@ class AppLocalizations {
);
}

String get total_file_size_error {
String total_file_size_error(int maxSize, String unit) {
return Intl.message(
'Total size of files must be set and smaller than 100 GB',
name: 'total_file_size_error'
'Total size of files must be set and smaller than $maxSize $unit',
name: 'total_file_size_error',
args: [maxSize, unit]
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,9 @@ class EditUploadRequestViewModel extends BaseViewModel {
final totalFileSizeTypeConfig = _totalFileSizeSetting!.maxUnit.toFileSizeType();
if (totalSizeOfFilesInByte <= 0 ||
(totalSizeOfFiles >= totalFileSizeConfig && maxFileSizeTypeNotifier.value == totalFileSizeTypeConfig)) {
_appToast.showErrorToast(AppLocalizations.of(context).total_file_size_error);
_appToast.showErrorToast(AppLocalizations.of(context)
.total_file_size_error(
totalFileSizeConfig, totalFileSizeTypeConfig.text));
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,11 @@ class UploadRequestCreationViewModel extends BaseViewModel {
final totalFileSizeConfig = _totalFileSizeSetting!.maxValue;
final totalFileSizeTypeConfig = _totalFileSizeSetting!.maxUnit.toFileSizeType();
if (totalSizeOfFilesInByte <= 0 ||
(totalSizeOfFiles >= totalFileSizeConfig && maxFileSizeTypeNotifier.value == totalFileSizeTypeConfig)) {
_appToast.showErrorToast(AppLocalizations.of(context).total_file_size_error);
(totalSizeOfFiles >= totalFileSizeConfig &&
maxFileSizeTypeNotifier.value == totalFileSizeTypeConfig)) {
_appToast.showErrorToast(AppLocalizations.of(context)
.total_file_size_error(
totalFileSizeConfig, totalFileSizeTypeConfig.text));
return;
}
}
Expand Down

0 comments on commit 04551f1

Please sign in to comment.