-
Notifications
You must be signed in to change notification settings - Fork 1
Localization support #4
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
LittleSheep2Code
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to follow the standard of Solsynth's products. We prefer to use easy_localization and json to load the content. Use contextless tr method and avoid using flutter native arb since it's lack of supports by other editors and platforms, the hot-restart supports was limited as well.
Besides, the localization files should be present in the assets folder instead of the lib folder, the lib folder is only for the code related to flutter / dart vm side.
lib/providers/locale_provider.dart
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is the separate file? It should be in the settings provider, isn't it? And the easy_localization also include built-in locale persistence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I should merge the files into the settings provider and use the built-in locale persistence in Easy_localization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the easy_localization provided the persistence, why you need another riverpod for that? For further details, you can check the Solsynth/Solian's implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't I told you to use contextless translation method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other files as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other files as well
I have changed the settings screen and the player screen. Are there any other changes needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You wrote the code, how could you don't know which places use context.tr() method?
And you can use Search across files to do so. Why ask me?
For real, people should pay before asking project maintainer to review their PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You wrote the code, how could you don't know which places use
context.tr()method? And you can use Search across files to do so. Why ask me?For real, people should pay before asking project maintainer to review their PR.
Do you mean using .tr(args: ['dynamic content']) instead of .replaceAll for translation? If you think this question is silly, you can just reply y/n.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait what, you're been using replace to fill the template? Please, read the docs.
Added localization support to the software. Currently supports Chinese and English.