Skip to content

Commit

Permalink
fix: add the lang attribute to controls and entries
Browse files Browse the repository at this point in the history
fix #337
  • Loading branch information
iorate committed Apr 2, 2023
1 parent 2aa903e commit 0b15ea7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/scripts/content-script.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useLayoutEffect, useMemo } from 'react';
import ReactDOM from 'react-dom';
import { BlockDialog } from './block-dialog';
import { browser } from './browser';
import { InteractiveRuleset } from './interactive-ruleset';
import { loadFromLocalStorage, saveToLocalStorage } from './local-storage';
import { translate } from './locales';
Expand Down Expand Up @@ -282,6 +283,7 @@ class ContentScript {
'ub-hidden',
this.options?.hideControls || !scopeState.blockedEntryCount,
);
control.root.lang = browser.i18n.getUILanguage();
ReactDOM.render(
<Control
blockedEntryCount={scopeState.blockedEntryCount}
Expand Down Expand Up @@ -312,6 +314,7 @@ class ContentScript {
entry.root.dataset.ubHighlight = String(entry.state - 1);
}
entry.actionRoot.classList.toggle('ub-hidden', this.options?.hideActions ?? false);
entry.actionRoot.lang = browser.i18n.getUILanguage();
ReactDOM.render(
<Action
blocked={entry.state === 0}
Expand Down

0 comments on commit 0b15ea7

Please sign in to comment.