From 00b7677b6f6dd57635ffd588b45edf09f90966a3 Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 22 Oct 2024 15:07:04 +0200 Subject: [PATCH] Sort --- pkgs/messages/example/lib/messages.g.dart | 4 ++-- pkgs/messages_builder/lib/builder.dart | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pkgs/messages/example/lib/messages.g.dart b/pkgs/messages/example/lib/messages.g.dart index b7352bf8..bdb1d9da 100644 --- a/pkgs/messages/example/lib/messages.g.dart +++ b/pkgs/messages/example/lib/messages.g.dart @@ -36,8 +36,8 @@ class AboutPageMessages { final Map _messages = {}; static const _dataFiles = { - 'fr': ('package:example/assets/testarbctx2_fr.arb.json', '390XWry3'), - 'en': ('package:example/assets/testarbctx2.arb.json', 'QrwRSsOy') + 'en': ('package:example/assets/testarbctx2.arb.json', 'QrwRSsOy'), + 'fr': ('package:example/assets/testarbctx2_fr.arb.json', '390XWry3') }; String get currentLocale => _currentLocale; diff --git a/pkgs/messages_builder/lib/builder.dart b/pkgs/messages_builder/lib/builder.dart index 9e368914..da01f37a 100644 --- a/pkgs/messages_builder/lib/builder.dart +++ b/pkgs/messages_builder/lib/builder.dart @@ -77,20 +77,21 @@ class MessageCallingCodeGenerator { final resourcesInContext = assetList .where((resource) => resource.message.context == messageList.context); - final localeToResourceInfo = resourcesInContext.map((resource) => ( - locale: resource.message.locale ?? 'en_US', - id: 'package:${options.packageName}/${resource.path}', - hasch: resource.message.hash, - )) - ..sortedBy((entry) => entry.locale); - - printIncludeFilesNotification(messageList.context, localeToResourceInfo); + final localeToResource = resourcesInContext + .map((resource) => ( + locale: resource.message.locale ?? 'en_US', + id: 'package:${options.packageName}/${resource.path}', + hasch: resource.message.hash, + )) + .sortedBy((resource) => resource.locale); + print(localeToResource); + printIncludeFilesNotification(messageList.context, localeToResource); return LibraryGeneration( options, messageList.context, messageList.locale!, messageList.messages, - localeToResourceInfo, + localeToResource, ).generate(); }