immich icon indicating copy to clipboard operation
immich copied to clipboard

fix(mobile): add translate extension

Open dvbthien opened this issue 6 months ago • 4 comments

Description

  • Translation Extensions:

    • Added extensions for BuildContext to simplify fetching localized strings using a concise 'hello'.t(context: context) method, thereby streamlining our code.
  • 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

dvbthien avatar Jun 05 '25 09:06 dvbthien

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

dvbthien avatar Jun 05 '25 15:06 dvbthien

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

dvbthien avatar Jun 06 '25 04:06 dvbthien

Hi @shenlong-tanwen, Everything has been resolved, you can review it again. Thanks

dvbthien avatar Jun 07 '25 18:06 dvbthien

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

shenlong-tanwen avatar Jun 09 '25 03:06 shenlong-tanwen

Hi @alextran1502, Could you please review this again and merge the pull request? Thanks

dvbthien avatar Jun 16 '25 12:06 dvbthien