Skip to content

Commit 4ccd41c

Browse files
committed
i18n: Use translation for "(unknown users)"
1 parent c02d947 commit 4ccd41c

File tree

5 files changed

+549
-536
lines changed

5 files changed

+549
-536
lines changed

lib/widgets/emoji_reaction.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter_gen/gen_l10n/zulip_localizations.dart';
23

34
import '../api/exception.dart';
45
import '../api/model/model.dart';
@@ -149,6 +150,7 @@ class ReactionChip extends StatelessWidget {
149150
@override
150151
Widget build(BuildContext context) {
151152
final store = PerAccountStoreWidget.of(context);
153+
final zulipLocalizations = ZulipLocalizations.of(context);
152154

153155
final reactionType = reactionWithVotes.reactionType;
154156
final emojiCode = reactionWithVotes.emojiCode;
@@ -163,7 +165,7 @@ class ReactionChip extends StatelessWidget {
163165
? userIds.map((id) {
164166
return id == store.selfUserId
165167
? 'You'
166-
: store.users[id]?.fullName ?? '(unknown user)'; // TODO(i18n)
168+
: store.users[id]?.fullName ?? zulipLocalizations.unknownUserName;
167169
}).join(', ')
168170
: userIds.length.toString();
169171

lib/widgets/inbox.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter_gen/gen_l10n/zulip_localizations.dart';
23

34
import '../api/model/model.dart';
45
import '../model/narrow.dart';
@@ -360,18 +361,21 @@ class _DmItem extends StatelessWidget {
360361
@override
361362
Widget build(BuildContext context) {
362363
final store = PerAccountStoreWidget.of(context);
364+
final zulipLocalizations = ZulipLocalizations.of(context);
363365
final selfUser = store.users[store.selfUserId]!;
364366

365367
final designVariables = DesignVariables.of(context);
366368

367369
final title = switch (narrow.otherRecipientIds) { // TODO dedupe with [RecentDmConversationsItem]
368370
[] => selfUser.fullName,
369-
[var otherUserId] => store.users[otherUserId]?.fullName ?? '(unknown user)',
371+
[var otherUserId] => store.users[otherUserId]?.fullName ?? zulipLocalizations.unknownUserName,
370372

371373
// TODO(i18n): List formatting, like you can do in JavaScript:
372374
// new Intl.ListFormat('ja').format(['Chris', 'Greg', 'Alya', 'Shu'])
373375
// // 'Chris、Greg、Alya、Shu'
374-
_ => narrow.otherRecipientIds.map((id) => store.users[id]?.fullName ?? '(unknown user)').join(', '),
376+
_ => narrow.otherRecipientIds.map((id) =>
377+
store.users[id]?.fullName ?? zulipLocalizations.unknownUserName
378+
).join(', '),
375379
};
376380

377381
return Material(

0 commit comments

Comments
 (0)