immich
immich copied to clipboard
fix(mobile): add translate extension
Description
-
Translation Extensions:
- Added extensions for
BuildContextto simplify fetching localized strings using a concise'hello'.t(context: context)method, thereby streamlining our code.
- Added extensions for
-
Remove remove translations file under utils :
-
Replace the usage of this function to use the extension.
-
UI Updates:
- Updated the language settings page by using the new translation extensions as an example.
Merge #18998 first to this pull request work perfectly
How Has This Been Tested?
Change the language and see the language settings page update to the new locale.
Checklist:
- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation if applicable
- [x] I have no unrelated changes in the PR.
- [x] I have confirmed that any new dependencies are strictly necessary.
- [ ] I have written tests for new code (if applicable)
- [x] I have followed naming conventions/patterns in the surrounding code
Hi @shenlong-tanwen,
Please review it again when you have free time.
If everything is okay, in my next pull request I will update the entire project to use context.t() in conjunction with your PR #18946.
Thanks
Hi @shenlong-tanwen,
Please review it again when you have free time. I have updated the code; now you can use places.t(context: context) and Text('places').t(context: context). I'm not sure if these adjustments match what you suggested above.
Thanks
Hi @shenlong-tanwen, Everything has been resolved, you can review it again. Thanks
Ignore the failing check. It is because of new keys added in other PRs before #18946. Regenerated it on #19031. Newer PRs that add keys should not suffer from this issue if the file is properly generated
Hi @alextran1502, Could you please review this again and merge the pull request? Thanks