-
Notifications
You must be signed in to change notification settings - Fork 88
Fix language overrides #87
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
base: master
Are you sure you want to change the base?
Conversation
This PR now provides much more additional fixes than before. If you want to use this PR in your own apps, use the following command in order to install it:
Please keep in mind that the Flutter Intl plugin for Android Studio does not work with my custom version as it will overwrite my version with the official one. You need to uninstall the plugin (or modify the class files inside it) and generate the language files yourself after installing my version. For that, use the following command:
|
Thanks for this PR, I also want #91 to be fixed asap. Maybe separate PRs could make this faster instead of providing 1 PR for 3 issues. Thanks! |
@fix92 I also thought that would be the case. However, it seems like PRs are being ignored here lately. Development has also slowed down as it seems. That's why I wanted to fix as many issues as possible to get this package where it is supposed to be :) |
Hi @ThexXTURBOXx, First of all, thanks for the PR! I've extracted a fix for outdated dependencies from this PR (released in Regarding the other two fixes, I'll need to check them in more detail. |
@lzoran Thank you for responding! I don't mind at all :) |
I have rebased against |
I have once again rebased against the |
Some conclusions after a closer look. Checked proposed fix for the #90. Test exampleReproduction steps taken from the similar issue. The
Also, this issue should be fixed now with the Checked proposed fix for the #19. |
@lzoran Thanks for your answer, however, there are a few things I do not understand entirely: This PR now does not fix anything related to #90 anymore since it was handled separately as you said. About the fix for #19: Setting |
I think it is best to postpone this change until we find a good enough solution that solves the mentioned problem and the migration of existing users. |
I hope you can think out the "best" solution before flutter/Google died. Just cannot believe such a BUG exists for 2 YEARS without any progress nor positive feedback. The community members have given several solutions that don't breaking anything but no one of your team accept nor commit your ideas. The only thing is we need better solution, we need more thinking... If you have any question or worry, let's SHARE it, DISCUSS, and SOLVE it. Don't just say NO and keep the issue/pr open for 2 or 10 years. I believe the community members are willing to make the repo the package better. Sorry for the rude remarks, but that's what I think truly. |
@narumi147 I have also been thinking about this issue for a while now and I truly believe now that it will most likely never be fixed, because my mentioned problems with the current approach won't ever be avoidable when using the (in my opinion) very bad design choice of exposing a This is why I have migrated fully to my fork of |
@ThexXTURBOXx Actually, I have no aversion to the static field In most cases, intl messages are used as app UI language, which should be consistent in almost all contexts. So in my folk, I add an optional param As for |
@ThexXTURBOXx "Overall, it would be best to get rid of the current entirely or at least deprecate it to indicate that it should not be used anymore because of such problems." Definitely, emphatically and very strongly: don't you dare to touch There are numerous cases where it's needed, and any solution that removes it makes Flutter Intl completely unusable for many of us. I could probably come up with much more use cases but here are two from my own apps: the first is the very obvious case of background processes without any access to a Actually, I switched to Flutter Intl from the previously recommended solution mostly because of |
@deakjahn While your use case seems valid as an argument, I strongly have to argue that this ties back to not adhering to established software development patterns. Also, looking around established and well-written Flutter apps, I was not able to find a single one that uses that static field exactly because of adhering to software design patterns and (especially!) because of the problems mentioned above which can easily lead to non-determinism. |
I have added back the instance, together with a warning that it can lead to non-determinism. |
Well, how to put it mildly, without offending anyone. :-)) During decades of development experience, I saw many buzzwords come an go, usually good riddance in the end. So, I couldn't care less about so-called "patterns" and "anti-patterns". :-) You use them as the need comes and you see fit but they're not something you need to use as an argument to base broad decisions on. Please, don't try to impose your views on other developers just because you failed to consider their needs and requirements. "I would have to think very hard of a single use case where one actually needs to translate strings inside the backend logic where no workaround is possible such as using enums or even strings/other objects as keys and only translating them when wanting to display them in the frontend." OK, you would have to think very hard. I don't. In the app* I have opened in my IDE right now, I have an Android background service running that needs localized texts and no, it doesn't have any connection to any frontend and UI. Still, it needs them because it has to generate files that contain localized texts. Never shown to the user in a Flutter UI and yet, it exists. * And, actually, it was halted right now because Flutter Intl doesn't play nice with the brand new SDK, and while coming up with a workaround, I stumbled upon the same problem you mentioned, the AS plugin activating without actually checking whether it's already there, meaning that we can't override it even temporarily... |
It is not about buzzwords, it is about things that any developer has at least heard about and any student has learned and used intensively (at least in Germany). Also, I don't think that software design patterns have "gone away". Some of them have been overhauled, but overall they do still exist and are used extensively.
As already said, it is not only about "patterns" and "anti-patterns". There are plenty of use cases for singletons, even though they are considered "anti-patterns". Most popular, Minecraft itself is a huge singleton instance.
You fail to see why encouraging using something that could lead to non-determinism is a bad thing. I would argue, it is the worst thing any software could suffer from. But I do not want to argue about as trivial as this, so I just added it back with a disclaimer that one should re-think his approach when using that instance. Finally, as said before, I do not see why removing this Now, let's get this merged and everyone can profit! |
I agree with @deakjahn as I argued before, a static access without And second problem, will your solution solve language override via As in my solution, But anyway, the owner team didn't fix it for 3 years, even dart 3/flutter 3.10 landed recent days, they are still insusceptible. |
@narumi147 Anyway, SDK 3 is such a breaking change that either they fix it (my PR is certainly not enough, the plugin has to be modified, too), or there will be enough of us to fork and recreate the IDE plugin. But I don't think that will be necessary, I hope @lzoran will accept the challenge. :-) I'm in Android Studio with Flutter but mainly because I set it up nicely and I was unwilling to move. I do most of my other stuff in VS Code and have experience with writing plugins there. But let's hope it doesn't come to this. |
Continuation of #18 for newer versions of
intl_utils
.Most users would benefit from this change since this is a huge bottleneck in using this plugin
Now, this PR also fixes an issue with black frames on rebuild (thanks to @orestesgaolin for providing a fix in his issue already!).
Also,
analyzer
andlints
have been updated to their latest versions, respectively.Fixes #19
Fixes #90
Fixes #91
Sadly, this PR will probably never get merged. See the discussion below for more details.
If you need or want this fix in your own apps, use the following command in order to install it:
Please keep in mind that the Flutter Intl plugin for Android Studio does not work with my custom version as it will overwrite my version with the official one. You need to uninstall the plugin (or modify the class files inside it) and generate the language files yourself after installing my version. For that, use the following command: