Skip to content
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

feat: add i18n (translation/localization) #15678

Open
wants to merge 9 commits into
base: 0.16
Choose a base branch
from

Conversation

ZhaiSoul
Copy link

@ZhaiSoul ZhaiSoul commented Dec 25, 2024

Proposed change

This PR add web i18n system.
Support for language files in JSON format.
I can provide support for Chinese translation. Maybe we should be use Weblate?

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code
  • Documentation Update

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • The code has been formatted using Ruff (ruff format frigate)

Copy link

netlify bot commented Dec 25, 2024

Deploy Preview for frigate-docs canceled.

Name Link
🔨 Latest commit eaf27ec
🔍 Latest deploy log https://app.netlify.com/sites/frigate-docs/deploys/676e27879606b500085056cd

@ZhaiSoul ZhaiSoul changed the title feat: add i18n feat: add i18n (translation/localization) Dec 25, 2024
@NickM-27 NickM-27 changed the base branch from dev to 0.16 December 26, 2024 14:22
@NickM-27
Copy link
Collaborator

I'd suggest making sure that all of these objects have translations set

export function getIconForLabel(label: string, className?: string) {

Also, you'll want to rebase your commits on 0.16 branch as this will need to go into that version

@ZhaiSoul
Copy link
Author

ZhaiSoul commented Dec 26, 2024

I'd suggest making sure that all of these objects have translations set

Of course, I’ll pull the new code right away.

@NickM-27 NickM-27 linked an issue Dec 26, 2024 that may be closed by this pull request
@ZhaiSoul
Copy link
Author

ZhaiSoul commented Dec 26, 2024 via email

@NickM-27
Copy link
Collaborator

Sorry, can you rebase on 0.16 (as opposed to merging in), the commits changed when resyncing with dev.

Let me know if you would like some specific steps on how to do that

@ZhaiSoul
Copy link
Author

Sorry, can you rebase on 0.16 (as opposed to merging in), the commits changed when resyncing with dev.

Let me know if you would like some specific steps on how to do that

Should I first pull the 0.16 branch, and then use git rebase dev on that branch?

@NickM-27
Copy link
Collaborator

Yeah you can do that

@ZhaiSoul
Copy link
Author

Yeah you can do that

Like this? Sorry. It's my frist open source PR. :(

@NickM-27
Copy link
Collaborator

Yep looks good

@NickM-27
Copy link
Collaborator

Looks like the lint and build is failing

@ZhaiSoul
Copy link
Author

Looks like the lint and build is failing

I fix that. And lint passes

@NickM-27
Copy link
Collaborator

Looks like there are still some issues

@ZhaiSoul
Copy link
Author

Looks like there are still some issues

Fixed!

web/public/locales/en/translation.json Outdated Show resolved Hide resolved
web/public/locales/en/translation.json Outdated Show resolved Hide resolved
web/src/views/settings/CameraSettingsView.tsx Outdated Show resolved Hide resolved
web/src/components/settings/MotionMaskEditPane.tsx Outdated Show resolved Hide resolved
ZhaiSoul and others added 3 commits December 27, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Translation / Localization
3 participants