Closed vorlovsky closed 8 months ago
Hi @vorlovsky I have been terribly busy and unavailable for some time but will take a look at your code within the week to understand the issues and resolve the resulting bug in the package
Hey @vorlovsky finally found sometime to look into this and noticed the issues you indicated.
The issue with annotation was rightly pointed out and removing the line break worked as expected. However the generator failed because your project was setup to generate synthetic
localization package in .dart_tool
and changing this worked as expected as l10n-mapper does not support synthetic localization package.
Made a few changes to your setup
lib/l10n
to lib/translations
which makes more sense in the given contextgenerate: true
PS. Will publish fixes in a couple of hours and for ease of use, I'll suggest you utilize a script i.e example/scripts/generate_code
After several attempts I'm still unable to make app-localizations.g.dart to be generated. I've provided a clear test project with only _flutterlocalization, intl, _l10n_mapperannotation and _l10n_mappergenerator added (basic
AppLocalization
class is generated, linked and works fine there): test_drive.zipNotes: I've followed all the steps from your README, Mapper section.
All the _l10nmapper scripts run without any issues - and also without any result besides creation of app-localizations.dart.bak.
I was able to fix _scripts/annotatelocalization.dart by setting up a correct search string for annotations (line 39):
String searchParameter = 'abstract class AppLocalizations {\n';
replaced withString searchParameter = 'abstract class AppLocalizations {';
This one enabled annotations to be actually applied upondart pub run l10n_mapper_generator --gen-mapper
.Unfortunately, I'm not that experienced to figure out what's wrong with
L10nMapperGenerator.generateForAnnotatedElement
being called uponflutter pub run build_runner build
. This command's output shows no errors, but app-localizations.g.dart does not appear.Can you, please, check it and fix, or at least advice me how could I debug calls to
L10nMapperGenerator.generateForAnnotatedElement
during build? Do you need any more information from my side for it?