Skip to content

Commit

Permalink
fix: prefer native chrome.i18n when available
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmaddock committed Dec 15, 2024
1 parent aef2717 commit 007410b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/electron-chrome-extensions/src/renderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,16 @@ export const injectExtensionAPIs = () => {
},

i18n: {
shouldInject: () => manifest.manifest_version === 3,
factory: (base) => {
// Electron configuration prevented this API from being available.
// https://github.com/electron/electron/pull/45031
if (base.getMessage) {
return base
}

return {
...base,
// TODO(mv3): implement
getUILanguage: () => 'en-US',
getAcceptLanguages: (callback: any) => {
const results = ['en-US']
Expand Down

0 comments on commit 007410b

Please sign in to comment.