feat!: Use new localisation setup from flutter 1.22
BREAKING CHANGE: This introduces that it might require up to 2 compiles for locals to work. Also only arb files shall be checked into git. Took 19 minutes
This commit is contained in:
parent
f6a4d2e5b5
commit
62cbc864f1
88 changed files with 489 additions and 12311 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:famedlysdk/matrix_api.dart';
|
||||
import 'package:fluffychat/components/adaptive_page_layout.dart';
|
||||
|
|
@ -5,17 +6,18 @@ import 'package:fluffychat/components/chat_settings_popup_menu.dart';
|
|||
import 'package:fluffychat/components/content_banner.dart';
|
||||
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
|
||||
import 'package:fluffychat/components/list_items/participant_list_item.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/utils/app_route.dart';
|
||||
import 'package:fluffychat/utils/matrix_locals.dart';
|
||||
import 'package:fluffychat/views/chat_list.dart';
|
||||
import 'package:fluffychat/views/invitation_selection.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:matrix_link_text/link_text.dart';
|
||||
import 'package:memoryfilepicker/memoryfilepicker.dart';
|
||||
|
||||
import './settings_emotes.dart';
|
||||
import '../utils/url_launcher.dart';
|
||||
|
||||
|
|
@ -34,7 +36,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
var enterText = SimpleDialogs(context).enterText(
|
||||
titleText: L10n.of(context).changeTheNameOfTheGroup,
|
||||
labelText: L10n.of(context).changeTheNameOfTheGroup,
|
||||
hintText: widget.room.getLocalizedDisplayname(L10n.of(context)),
|
||||
hintText:
|
||||
widget.room.getLocalizedDisplayname(MatrixLocals(L10n.of(context))),
|
||||
);
|
||||
final displayname = await enterText;
|
||||
if (displayname == null) return;
|
||||
|
|
@ -173,7 +176,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
ChatSettingsPopupMenu(widget.room, false)
|
||||
],
|
||||
title: Text(
|
||||
widget.room.getLocalizedDisplayname(L10n.of(context)),
|
||||
widget.room.getLocalizedDisplayname(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.appBarTheme
|
||||
|
|
@ -251,7 +255,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
title: Text(
|
||||
L10n.of(context).changeTheNameOfTheGroup),
|
||||
subtitle: Text(widget.room
|
||||
.getLocalizedDisplayname(L10n.of(context))),
|
||||
.getLocalizedDisplayname(
|
||||
MatrixLocals(L10n.of(context)))),
|
||||
onTap: () => setDisplaynameAction(context),
|
||||
),
|
||||
if (widget.room
|
||||
|
|
@ -298,8 +303,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
title: Text(L10n.of(context)
|
||||
.whoIsAllowedToJoinThisGroup),
|
||||
subtitle: Text(
|
||||
widget.room.joinRules
|
||||
.getLocalizedString(L10n.of(context)),
|
||||
widget.room.joinRules.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
onSelected: (JoinRules joinRule) =>
|
||||
|
|
@ -313,13 +318,15 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
PopupMenuItem<JoinRules>(
|
||||
value: JoinRules.public,
|
||||
child: Text(JoinRules.public
|
||||
.getLocalizedString(L10n.of(context))),
|
||||
.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context)))),
|
||||
),
|
||||
if (widget.room.canChangeJoinRules)
|
||||
PopupMenuItem<JoinRules>(
|
||||
value: JoinRules.invite,
|
||||
child: Text(JoinRules.invite
|
||||
.getLocalizedString(L10n.of(context))),
|
||||
.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context)))),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -335,7 +342,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
.visibilityOfTheChatHistory),
|
||||
subtitle: Text(
|
||||
widget.room.historyVisibility
|
||||
.getLocalizedString(L10n.of(context)),
|
||||
.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
onSelected:
|
||||
|
|
@ -351,25 +359,29 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
PopupMenuItem<HistoryVisibility>(
|
||||
value: HistoryVisibility.invited,
|
||||
child: Text(HistoryVisibility.invited
|
||||
.getLocalizedString(L10n.of(context))),
|
||||
.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context)))),
|
||||
),
|
||||
if (widget.room.canChangeHistoryVisibility)
|
||||
PopupMenuItem<HistoryVisibility>(
|
||||
value: HistoryVisibility.joined,
|
||||
child: Text(HistoryVisibility.joined
|
||||
.getLocalizedString(L10n.of(context))),
|
||||
.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context)))),
|
||||
),
|
||||
if (widget.room.canChangeHistoryVisibility)
|
||||
PopupMenuItem<HistoryVisibility>(
|
||||
value: HistoryVisibility.shared,
|
||||
child: Text(HistoryVisibility.shared
|
||||
.getLocalizedString(L10n.of(context))),
|
||||
.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context)))),
|
||||
),
|
||||
if (widget.room.canChangeHistoryVisibility)
|
||||
PopupMenuItem<HistoryVisibility>(
|
||||
value: HistoryVisibility.world_readable,
|
||||
child: Text(HistoryVisibility.world_readable
|
||||
.getLocalizedString(L10n.of(context))),
|
||||
.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context)))),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -385,8 +397,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
title: Text(
|
||||
L10n.of(context).areGuestsAllowedToJoin),
|
||||
subtitle: Text(
|
||||
widget.room.guestAccess
|
||||
.getLocalizedString(L10n.of(context)),
|
||||
widget.room.guestAccess.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
onSelected: (GuestAccess guestAccess) =>
|
||||
|
|
@ -401,7 +413,7 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
value: GuestAccess.can_join,
|
||||
child: Text(
|
||||
GuestAccess.can_join.getLocalizedString(
|
||||
L10n.of(context)),
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
if (widget.room.canChangeGuestAccess)
|
||||
|
|
@ -410,7 +422,7 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
child: Text(
|
||||
GuestAccess.forbidden
|
||||
.getLocalizedString(
|
||||
L10n.of(context)),
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue