-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for flavour override #50
Comments
Hi @neokree, can you give me an example on why you would use different localized strings for the same language? |
Sure. My current use case is a "whitelabel" app, that must be compiled for different clients. This is a very specific case, but I can also see other use cases for this feature:
Obviously in all these situation you can handle it in code using if/else and adding all versions of the same translation in the same file, using either a prefix/suffix or an object group. |
Thanks for the example and explanation. It seems this feature might be helpful in some very specific cases. I will not be implementing it at the moment though, but feel free to submit a pull request if you wish. |
Hi,
In Android, when a project have multiple flavours, the system will bundle toghether all strings, based on the current build.
So with this configuration:
If I compile the
dev
flavour, the strings usable are the ones frommain
+dev
.If there is a string called
app_name
inmain
, and it is also present indev
, then thedev
one overrides themain
one.I would like to have a similar feature for
flutter_translate
. Even if there is not the concept of flavours for dart code, the same thing can be recreated using environment variables or something similar.I think that something like:
delegate.loadFlavour('dev')
could do the trick.maybe with something like this in the asset folder:
What do you think?
The text was updated successfully, but these errors were encountered: