Skip to content

feat(i18n): add core i18n setup and refactor UI texts to use translation keys#609

Closed
cuonglmptit wants to merge 6 commits into
ayangweb:masterfrom
cuonglmptit:feature/i18n
Closed

feat(i18n): add core i18n setup and refactor UI texts to use translation keys#609
cuonglmptit wants to merge 6 commits into
ayangweb:masterfrom
cuonglmptit:feature/i18n

Conversation

@cuonglmptit

@cuonglmptit cuonglmptit commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

Summary

  • Add vue-i18n core setup (index.ts, App.vue initialization)
  • Add default language files (zh-CN.json and related structure)
  • Refactor UI texts in 13 .vue UI files and tray/menu modules to use translation keys instead of hardcoded strings

Details

  • Created useLocale composable and updated general store to support locale state
  • Updated useTray.ts and useSharedMenu.ts to use t() from vue-i18n
  • Added default language index page and initialized i18n in App.vue
  • Replaced all hardcoded texts in 13 Vue components with translation keys
image image image image image

Why

  • Prepare full i18n support for BongoCat
  • Make it easier to add new languages and maintain translations

Testing Steps

  1. Run pnpm tauri dev
  2. Switch between supported locales in Languages section in General (zh-CN, en-US, vi-VN)
  3. Verify that all UI texts (including tray and menu items) update correctly
  4. Build and run pnpm tauri build --debug to ensure packaging works
  5. Run the built executable (located in src-tauri/target/debug/ or target/debug/)
    • Ensure the UI works as expected
    • Verify that all i18n translation files and tray/menu texts are loaded correctly

Related #479

- Add useLocale composable for handling dynamic locales
- Add i18n/index.ts for vue-i18n configuration
- Update general store to include locale state
- Update Tauri config for resource paths
- Add default zh-CN.json language file for build
- Add i18n core setup in i18n/index.ts using vue-i18n
- Update App.vue to initialize and provide dynamic locale on startup
- Update useSharedMenu.ts to use translation keys for menu items
- Update useTray.ts to react to locale changes and use translated tray menu labels
…all Vue components

- Updated 13 Vue files to use vue-i18n `t()` function
- Removed all hardcoded Chinese texts in templates and scripts
- Ensured consistent usage of translation keys
…8n settings

- Add separate SVG icons for light and dark themes in the language selection section
- Auto-switch the icon based on current theme
- Fix taskbar icon menu text not updating on locale change
- Add button to open locales folder for easier customization
@Michaelwucoc

Copy link
Copy Markdown
Contributor

Checking up....

@ayangweb

Copy link
Copy Markdown
Owner

Thank you for submitting the PR. I’ll review it as soon as possible. Since multi-language support may cause subtle UI changes, I might modify your code or create a new PR myself. I also look forward to your contributions to the language files. Thank you for your understanding!

@cuonglmptit

cuonglmptit commented Aug 18, 2025

Copy link
Copy Markdown
Contributor Author

Thank you for submitting the PR. I’ll review it as soon as possible. Since multi-language support may cause subtle UI changes, I might modify your code or create a new PR myself. I also look forward to your contributions to the language files. Thank you for your understanding!

Thanks for the update! I just wanted to contribute, so feel free to review or adjust the PR as needed.
I think the new conflict came from the latest commit that corrected the typo (也可已 → 也可以). My PR’s zh-CN.json already had the correct spelling, so I only made a tiny adjustment when resolving it.
I’d be happy to help with the language files in the future.

@Michaelwucoc

Copy link
Copy Markdown
Contributor

Hey @cuonglmptit , could u please send me your build (i18n) to vteamer@milkawa.xyz? Appriciated!

@cuonglmptit

Copy link
Copy Markdown
Contributor Author

Hey @cuonglmptit , could u please send me your build (i18n) to vteamer@milkawa.xyz? Appriciated!

Hi, I’ve already published the i18n build on my fork’s release page.
You can download it directly here: https://github.com/cuonglmptit/bongocat-i18n/releases
Please let me know if you’d still prefer me to send it by email.

@Michaelwucoc

Michaelwucoc commented Sep 10, 2025 via email

Copy link
Copy Markdown
Contributor

@cuonglmptit

Copy link
Copy Markdown
Contributor Author

Cause it only have windows edition. I may need a MacOS version! Thanks!

------ Original Message ------ From "CuongLM" @.> To "ayangweb/BongoCat" @.> Cc "Michaelwucoc" @.>; "Comment" @.> Date 9/10/2025 下午4:46:00 Subject Re: [ayangweb/BongoCat] feat(i18n): add core i18n setup and refactor UI texts to use translation keys (PR #609)
cuonglmptit left a comment (ayangweb/BongoCat#609) <#609 (comment)> >Hey @cuonglmptit https://github.com/cuonglmptit , could u please >send me your build (i18n) to @.? Appriciated! > Hi, I’ve already published the i18n build on my fork’s release page. You can download it directly here: https://github.com/cuonglmptit/bongocat-i18n/releases Please let me know if you’d still prefer me to send it by email. — Reply to this email directly, view it on GitHub <#609 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2NA4GXXL5LCWP4MP7LRPYL3R7QMRAVCNFSM6AAAAACDA4RDF6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTENZTHE2TEMZZGI. You are receiving this because you commented.Message ID: @.>

Hi @Michaelwucoc,

Ah ok. I only released the Windows version at first because, well… I’m too poor to have a Mac 😅
But I’ve now run the workflow to build and release all platforms, including macOS.
You can check the updated releases here: https://github.com/cuonglmptit/bongocat-i18n/releases

Thanks!

@ayangweb

Copy link
Copy Markdown
Owner

Hey👋, I’ve submitted a new PR #645. You’re welcome to submit JSON files for other languages, and also feel free to submit the Tauri configuration changes as a separate PR. Thank you! I will close this PR after hearing back from you.

@cuonglmptit

Copy link
Copy Markdown
Contributor Author

@ayangweb Got it, please go ahead and close this PR.
I’ll prepare a new PR for the Tauri config changes, and also contribute additional language JSON files soon.

@ayangweb ayangweb closed this Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants