Closed neokree closed 3 years ago
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. The problem is that a section for a client must be called "A", while the other one wants to call it "B".
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. However, these solutions increase the number of translations in the localization file, which can become a problem for medium/large apps, and also needs to use additional code in the usage part (the if/else checks for each type of build config).
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 calledapp_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?