Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/src/intl_suggestors/intl_message_syntax.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ class MessageSyntax {

String nameForNode(StringLiteral body,
{String? initialName, bool startAtZero = false}) {
var messageText = body.toSource();
// If the body is an interpolation, make sure we generate it the same way we will see it in
// the final file, otherwise comparisons may fail. Notably, be sure we always use ${} form.
var messageText = body is StringInterpolation
? intlParameterizedMessage(body)
: body.toSource();
var functionName = toVariableName(messageText);
functionName = owner.nameForString(initialName ?? functionName, messageText,
startAtZero: startAtZero);
Expand Down