MetaMask / MetaMask/metamask-extension
[Typescript Conversion: Level 18]: Convert ui/hooks/useI18nContext.js to typescript
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
## **Description**
Convert `ui/hooks/useI18nContext.js` from JavaScript to TypeScript as part of the TS migration initiative.
## **Scenario (for user stories only)**
_(Not applicable)_
## **Design (for user stories only)**
_(Not applicable)_
## **Technical Details (for technical tasks only)**
- Convert this file to TypeScript.
- Migration Level: **18**
- Dependencies:
- ui/contexts/i18n.js
- Dependents:
- ui/components/app/alerts/invalid-custom-network-alert/invalid-custom-network-alert.js
- ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.js
- ui/components/app/cancel-button/cancel-button.js
- ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js
- ui/components/app/connected-accounts-list/connected-accounts-list-options/connected-accounts-list-options.component.js
- ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js
- ui/components/app/create-new-vault/create-new-vault.js
- ui/components/app/detected-token/detected-token-address/detected-token-address.js
- ui/components/app/detected-token/detected-token-aggregators/detected-token-aggregators.js
- ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js
- ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js
- ui/components/app/metamask-translation/metamask-translation.js
- ui/components/app/modals/convert-token-to-nft-modal/convert-token-to-nft-modal.js
- ui/components/app/modals/customize-nonce/customize-nonce.component.js
- ui/components/app/modals/qr-scanner/qr-scanner.component.js
- ui/components/app/permissions-connect-permission-list/permissions-connect-permission-list.js
- ui/components/app/qr-hardware-popover/base-reader.js
- ui/components/app/qr-hardware-popover/qr-hardware-popover.js
- ui/components/app/qr-hardware-popover/qr-hardware-sign-request/player.js
- ui/components/app/qr-hardware-popover/qr-hardware-sign-request/reader.js
- ui/components/app/qr-hardware-popover/qr-hardware-wallet-importer/qr-hardware-wallet-importer.component.js
- ui/components/app/recovery-phrase-reminder/recovery-phrase-reminder.js
- ui/components/app/srp-input/srp-input.js
- ui/components/app/step-progress-bar/step-progress-bar.js
- ui/components/app/transaction-list-item/transaction-list-item.component.js
- ui/components/app/transaction-list/transaction-list.component.js
- ui/components/app/transaction-status-label/transaction-status-label.js
- ui/components/ui/account-list/account-list.js
- ui/components/ui/account-mismatch-warning/account-mismatch-warning.component.js
- ui/components/ui/confusable/confusable.component.js
- ui/components/ui/export-text-container/export-text-container.component.js
- ui/components/ui/popover/popover.component.js
- ui/components/ui/sender-to-recipient/sender-to-recipient.component.js
- ui/components/ui/truncated-definition-list/truncated-definition-list.js
- ui/hooks/useTransactionDisplayData.js
- ui/hooks/useTransactionDisplayData.test.js
- ui/pages/connected-accounts/connected-accounts.component.js
- ui/pages/home/beta/beta-home-footer.component.js
- ui/pages/home/flask/flask-home-footer.component.js
- ui/pages/keychains/reveal-seed.js
- ui/pages/notifications/notifications.tsx
- ui/pages/onboarding-flow/create-password/create-password.js
- ui/pages/onboarding-flow/creation-successful/creation-successful.js
- ui/pages/onboarding-flow/import-srp/import-srp.js
- ui/pages/onboarding-flow/metametrics/metametrics.js
- ui/pages/onboarding-flow/onboarding-flow.js
- ui/pages/onboarding-flow/pin-extension/pin-billboard.js
- ui/pages/onboarding-flow/pin-extension/pin-extension.js
- ui/pages/onboarding-flow/privacy-settings/privacy-settings.js
- ui/pages/onboarding-flow/privacy-settings/setting.js
- ui/pages/onboarding-flow/recovery-phrase/confirm-recovery-phrase.js
- ui/pages/onboarding-flow/recovery-phrase/recovery-phrase-chips.js
- ui/pages/onboarding-flow/recovery-phrase/review-recovery-phrase.js
- ui/pages/onboarding-flow/secure-your-wallet/secure-your-wallet.js
- ui/pages/onboarding-flow/secure-your-wallet/skip-srp-backup-popover.js
- ui/pages/onboarding-flow/welcome/welcome.js
- ui/pages/permissions-connect/choose-account/choose-account.js
- ui/pages/settings/contact-list-tab/view-contact/view-contact.component.js
- ui/pages/settings/networks-tab/networks-form/networks-form.tsx
## **[Threat Modeling Framework](https://github.com/adamshostack/4QuestionFrame) (for technical tasks only)**
- What are we working on? Convert file to TypeScript.
- What can go wrong? Type errors, integration mismatches, missing types.
- What are we going to do about it? Write types carefully and test thoroughly.
- Did we do a good job? _(To be evaluated)_
## **Acceptance Criteria**
- File is fully converted to TypeScript.
- Tests pass.
- File adheres to linting rules.
- Functionality remains unchanged.
## **Stakeholder Review (for MetaMask employees only)**
- [X] Engineering
- [ ] Design
- [ ] Product
- [ ] QA
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management
- [ ] Other
## **References**
- Parent issue: #31460
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ui/hooks/useI18nContext.js and inspect its dependency ui/contexts/i18n.js, then review the listed dependents for the hook's expected types and usage. Convert the hook while preserving behavior, update its extension and types, and run the relevant test and lint commands to confirm that dependents compile and functionality remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 64/100