Skip to content

Commit 1d6275a

Browse files
committed
content: Translate a unimplemented node placeholder string
Fixes: #277 Signed-off-by: Zixuan James Li <[email protected]>
1 parent 8a20844 commit 1d6275a

10 files changed

+50
-1
lines changed

assets/l10n/app_en.arb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,5 +792,12 @@
792792
"scrollToBottomTooltip": "Scroll to bottom",
793793
"@scrollToBottomTooltip": {
794794
"description": "Tooltip for button to scroll to bottom."
795+
},
796+
"errorUnimplementedPlaceholder": "(unimplemented: DOM node type {htmlNodeType})",
797+
"@errorUnimplementedPlaceholder": {
798+
"description": "Placeholder in message content showing content that cannot be rendered",
799+
"placeholders": {
800+
"htmlNodeType": {"type": "int", "example": "2"}
801+
}
795802
}
796803
}

lib/generated/l10n/zulip_localizations.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,12 @@ abstract class ZulipLocalizations {
11661166
/// In en, this message translates to:
11671167
/// **'Scroll to bottom'**
11681168
String get scrollToBottomTooltip;
1169+
1170+
/// Placeholder in message content showing content that cannot be rendered
1171+
///
1172+
/// In en, this message translates to:
1173+
/// **'(unimplemented: DOM node type {htmlNodeType})'**
1174+
String errorUnimplementedPlaceholder(int htmlNodeType);
11691175
}
11701176

11711177
class _ZulipLocalizationsDelegate extends LocalizationsDelegate<ZulipLocalizations> {

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,4 +620,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
620620

621621
@override
622622
String get scrollToBottomTooltip => 'Scroll to bottom';
623+
624+
@override
625+
String errorUnimplementedPlaceholder(int htmlNodeType) {
626+
return '(unimplemented: DOM node type $htmlNodeType)';
627+
}
623628
}

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,4 +620,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
620620

621621
@override
622622
String get scrollToBottomTooltip => 'Scroll to bottom';
623+
624+
@override
625+
String errorUnimplementedPlaceholder(int htmlNodeType) {
626+
return '(unimplemented: DOM node type $htmlNodeType)';
627+
}
623628
}

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,4 +620,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
620620

621621
@override
622622
String get scrollToBottomTooltip => 'Scroll to bottom';
623+
624+
@override
625+
String errorUnimplementedPlaceholder(int htmlNodeType) {
626+
return '(unimplemented: DOM node type $htmlNodeType)';
627+
}
623628
}

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,4 +620,9 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
620620

621621
@override
622622
String get scrollToBottomTooltip => 'Scroll to bottom';
623+
624+
@override
625+
String errorUnimplementedPlaceholder(int htmlNodeType) {
626+
return '(unimplemented: DOM node type $htmlNodeType)';
627+
}
623628
}

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,4 +620,9 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
620620

621621
@override
622622
String get scrollToBottomTooltip => 'Scroll to bottom';
623+
624+
@override
625+
String errorUnimplementedPlaceholder(int htmlNodeType) {
626+
return '(unimplemented: DOM node type $htmlNodeType)';
627+
}
623628
}

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,4 +620,9 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
620620

621621
@override
622622
String get scrollToBottomTooltip => 'Scroll to bottom';
623+
624+
@override
625+
String errorUnimplementedPlaceholder(int htmlNodeType) {
626+
return '(unimplemented: DOM node type $htmlNodeType)';
627+
}
623628
}

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,4 +620,9 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
620620

621621
@override
622622
String get scrollToBottomTooltip => 'Scroll to bottom';
623+
624+
@override
625+
String errorUnimplementedPlaceholder(int htmlNodeType) {
626+
return '(unimplemented: DOM node type $htmlNodeType)';
627+
}
623628
}

lib/widgets/content.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,8 +1586,9 @@ InlineSpan _errorUnimplemented(UnimplementedNode node, {required BuildContext co
15861586
TextSpan(text: "»)", style: errorStyle),
15871587
]);
15881588
} else {
1589+
final zulipLocalizations = ZulipLocalizations.of(context);
15891590
return TextSpan(
1590-
text: "(unimplemented: DOM node type ${htmlNode.nodeType})",
1591+
text: zulipLocalizations.errorUnimplementedPlaceholder(htmlNode.nodeType),
15911592
style: errorStyle);
15921593
}
15931594
}

0 commit comments

Comments
 (0)