refactor: Use non nullable localizations builder and lazy load on web

This commit is contained in:
krille-chan 2024-10-06 08:35:37 +02:00
commit 0d4b7d67cc
No known key found for this signature in database
111 changed files with 879 additions and 883 deletions

View file

@ -43,7 +43,7 @@ Future<DatabaseApi> flutterMatrixSdkDatabaseBuilder(Client client) async {
try {
// Send error notification:
final l10n = lookupL10n(PlatformDispatcher.instance.locale);
final l10n = await lookupL10n(PlatformDispatcher.instance.locale);
ClientManager.sendInitNotification(
l10n.initAppError,
l10n.databaseBuildErrorBody(

View file

@ -57,7 +57,7 @@ void _sendNoEncryptionWarning(Object exception) async {
if (isStored == true) return;
final l10n = lookupL10n(PlatformDispatcher.instance.locale);
final l10n = await lookupL10n(PlatformDispatcher.instance.locale);
ClientManager.sendInitNotification(
l10n.noDatabaseEncryption,
exception.toString(),

View file

@ -20,7 +20,7 @@ extension MatrixFileExtension on MatrixFile {
}
final downloadPath = await FilePicker.platform.saveFile(
dialogTitle: L10n.of(context)!.saveFile,
dialogTitle: L10n.of(context).saveFile,
fileName: name,
type: filePickerFileType,
bytes: bytes,
@ -38,7 +38,7 @@ extension MatrixFileExtension on MatrixFile {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
L10n.of(context)!.fileHasBeenSavedAt(downloadPath),
L10n.of(context).fileHasBeenSavedAt(downloadPath),
),
),
);