Closed talamaska closed 6 months ago
Hey @talamaska, I understand this proposal your current take on it is about right with the exception of parsing build-extensions
as builder options as this is not feasible.
I'll create a update in a couple of hours to address this and will instead prefer .mapper.dart
extension as l10n
gives a vague impression of intension.
Will indicate when this has been resolved.
@kwado-tech I don't have preferences about the suffix. It's just something that came out quickly. Thanks man.
Hey @talamaska, this has been resolved in l10n_mapper_generator: ^2.1.0
. Please verify if this resolves it for you and indicate here.
Also give a thumbs-up to the package on pub.dev.
I'm one of the 2 likes ;) I have some other ideas. I already tested them. For example. I don't need all the translations to be dynamically accessed from the map. Just the form fields validations. So I created a filter and an ability to pass a list of strings with build.yaml. thanks for your work
Great. I'll think about exposing mapper-exceptions to external arguments as this already exists and implicitly defined and consumed.
You can contribute to this as well following the already laid out structure @talamaska
just to be clear, my idea is the inverse of "exception", maybe a whitelist/blacklist pair is better formulation.
This is not necessarily a bug. More like a request for a way to run this build in a separate build task or be able to set different extension via build.yaml. Like drift was doing.
With drift and mobx I could do something like this , where first drift is run alone, then mobx is run alone
Now I have played a bit with the source code, I'm super noob so I couldn't do much So I first changed
build_extensions: { ".dart": [".l10n.dart"] }
without success From my brief research, it looks like that the LibraryBuilder is not accounting for build_extensions It looks like for you to access the build_extensions data you need access to BuildStep, which is accessible if you write your own builder. It feels as asking for too much from an OS.And then I changed this config
generatedExtension: '.l10n.dart'
of the LibraryBuilder, which is used, and and everything is good now. I get the app_localizations.l10n.dart correctly generated. Also it looks like that json file for the mapper is not used anymore. So I configured the build via the build.yamlSince build_extensions is not in use anywhere I would pass the extension in the options and expect the the generated file to with it. So I made this change locally
and added
extension: '.g.dart'
in the library build.yaml