Refactor localizations

This commit is contained in:
Christian Pauly 2020-05-06 12:21:54 +02:00
commit 453f22293d
13 changed files with 16 additions and 321 deletions

View file

@ -1,3 +1,4 @@
import 'package:famedlysdk/famedlysdk.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'messages_all.dart';
@ -21,7 +22,7 @@ class AppLocalizationsDelegate extends LocalizationsDelegate<I18n> {
}
}
class I18n {
class I18n extends MatrixLocalizations {
I18n(this.localeName);
static Future<I18n> load(Locale locale) {
@ -229,8 +230,11 @@ class I18n {
String get copy => Intl.message("Copy");
String get couldNotDecryptMessage =>
Intl.message("Could not decrypt message");
String couldNotDecryptMessage(String error) => Intl.message(
"Could not decrypt message: $error",
name: "couldNotDecryptMessage",
args: [error],
);
String get couldNotSetAvatar => Intl.message("Could not set avatar");