this.setSearchEngine(value)}>
+
+ this.setSearchEngine(value)}>
{searchEngines.map((engine) => (
))}
-
+
-
-
+
+
>
);
}
diff --git a/src/components/modals/main/settings/sections/Stats.jsx b/src/components/modals/main/settings/sections/Stats.jsx
index 1e078a47..7edf8358 100644
--- a/src/components/modals/main/settings/sections/Stats.jsx
+++ b/src/components/modals/main/settings/sections/Stats.jsx
@@ -32,30 +32,29 @@ export default class Stats extends PureComponent {
}
render() {
- const getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
- const languagecode = variables.languagecode;
+ const getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
if (localStorage.getItem('stats') === 'false') {
return (
<>
- {getMessage(languagecode, 'modals.main.settings.reminder.title')}
- {getMessage(languagecode, 'modals.main.settings.sections.stats.warning')}
-
+ {getMessage('modals.main.settings.reminder.title')}
+ {getMessage('modals.main.settings.sections.stats.warning')}
+
>
);
}
return (
<>
- {getMessage(languagecode, 'modals.main.settings.sections.stats.title')}
- {getMessage(languagecode, 'modals.main.settings.sections.stats.sections.tabs_opened')}: {this.state.stats['tabs-opened'] || 0}
- {getMessage(languagecode, 'modals.main.settings.sections.stats.sections.backgrounds_favourited')}: {this.state.stats.feature ? this.state.stats.feature['background-favourite'] || 0 : 0}
- {getMessage(languagecode, 'modals.main.settings.sections.stats.sections.backgrounds_downloaded')}: {this.state.stats.feature ? this.state.stats.feature['background-download'] || 0 : 0}
- {getMessage(languagecode, 'modals.main.settings.sections.stats.sections.quotes_favourited')}: {this.state.stats.feature ? this.state.stats.feature['quoted-favourite'] || 0 : 0}
- {getMessage(languagecode, 'modals.main.settings.sections.stats.sections.quicklinks_added')}: {this.state.stats.feature ? this.state.stats.feature['quicklink-add'] || 0 : 0}
- {getMessage(languagecode, 'modals.main.settings.sections.stats.sections.settings_changed')}: {this.state.stats.setting ? Object.keys(this.state.stats.setting).length : 0}
- {getMessage(languagecode, 'modals.main.settings.sections.stats.sections.addons_installed')}: {this.state.stats.marketplace ? this.state.stats.marketplace['install'] : 0}
-
+ {getMessage('modals.main.settings.sections.stats.title')}
+ {getMessage('modals.main.settings.sections.stats.sections.tabs_opened')}: {this.state.stats['tabs-opened'] || 0}
+ {getMessage('modals.main.settings.sections.stats.sections.backgrounds_favourited')}: {this.state.stats.feature ? this.state.stats.feature['background-favourite'] || 0 : 0}
+ {getMessage('modals.main.settings.sections.stats.sections.backgrounds_downloaded')}: {this.state.stats.feature ? this.state.stats.feature['background-download'] || 0 : 0}
+ {getMessage('modals.main.settings.sections.stats.sections.quotes_favourited')}: {this.state.stats.feature ? this.state.stats.feature['quoted-favourite'] || 0 : 0}
+ {getMessage('modals.main.settings.sections.stats.sections.quicklinks_added')}: {this.state.stats.feature ? this.state.stats.feature['quicklink-add'] || 0 : 0}
+ {getMessage('modals.main.settings.sections.stats.sections.settings_changed')}: {this.state.stats.setting ? Object.keys(this.state.stats.setting).length : 0}
+ {getMessage('modals.main.settings.sections.stats.sections.addons_installed')}: {this.state.stats.marketplace ? this.state.stats.marketplace['install'] : 0}
+
>
);
}
diff --git a/src/components/modals/main/settings/sections/Time.jsx b/src/components/modals/main/settings/sections/Time.jsx
index 8395ff65..ed492b2e 100644
--- a/src/components/modals/main/settings/sections/Time.jsx
+++ b/src/components/modals/main/settings/sections/Time.jsx
@@ -17,40 +17,39 @@ export default class TimeSettings extends PureComponent {
}
render() {
- const getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
- const languagecode = variables.languagecode;
+ const getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
let timeSettings;
const digitalOptions = [
{
- name: getMessage(languagecode, 'modals.main.settings.sections.time.digital.twentyfourhour'),
+ name: getMessage('modals.main.settings.sections.time.digital.twentyfourhour'),
value: 'twentyfourhour'
},
{
- name: getMessage(languagecode, 'modals.main.settings.sections.time.digital.twelvehour'),
+ name: getMessage('modals.main.settings.sections.time.digital.twelvehour'),
value: 'twelvehour'
}
];
const digitalSettings = (
<>
- {getMessage(languagecode, 'modals.main.settings.sections.time.digital.title')}
-
+ {getMessage('modals.main.settings.sections.time.digital.title')}
+
-
-
+
+
>
);
const analogSettings = (
<>
- {getMessage(languagecode, 'modals.main.settings.sections.time.analogue.title')}
-
-
-
-
-
+ {getMessage('modals.main.settings.sections.time.analogue.title')}
+
+
+
+
+
>
);
@@ -64,25 +63,25 @@ export default class TimeSettings extends PureComponent {
const longSettings = (
<>
-
-
+
+
>
);
const shortSettings = (
<>
-
+
-
-
-
-
-
+
+
+
+
+
>
);
@@ -95,29 +94,29 @@ export default class TimeSettings extends PureComponent {
return (
<>
- {getMessage(languagecode, 'modals.main.settings.sections.time.title')}
-
- this.setState({ timeType: value })} category='clock'>
-
-
-
+ {getMessage('modals.main.settings.sections.time.title')}
+
+ this.setState({ timeType: value })} category='clock'>
+
+
+
{timeSettings}
{this.state.timeType !== 'analogue' ?
-
+
: null}
- {getMessage(languagecode, 'modals.main.settings.sections.time.date.title')}
-
- this.setState({ dateType: value })} category='date'>
-
-
+ {getMessage('modals.main.settings.sections.time.date.title')}
+
+ this.setState({ dateType: value })} category='date'>
+
+
-
-
+
+
{dateSettings}
-
+
>
);
}
diff --git a/src/components/modals/main/settings/sections/Weather.jsx b/src/components/modals/main/settings/sections/Weather.jsx
index 441cf6e1..fa726df1 100644
--- a/src/components/modals/main/settings/sections/Weather.jsx
+++ b/src/components/modals/main/settings/sections/Weather.jsx
@@ -48,47 +48,46 @@ export default class TimeSettings extends PureComponent {
}
render() {
- const getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
- const languagecode = variables.languagecode;
+ const getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
const tempFormat = [
{
- name: getMessage(languagecode, 'modals.main.settings.sections.weather.temp_format.celsius') + ' (°C)',
+ name: getMessage('modals.main.settings.sections.weather.temp_format.celsius') + ' (°C)',
value: 'celsius'
},
{
- name: getMessage(languagecode, 'modals.main.settings.sections.weather.temp_format.fahrenheit') + ' (°F)',
+ name: getMessage('modals.main.settings.sections.weather.temp_format.fahrenheit') + ' (°F)',
value: 'fahrenheit'
},
{
- name: getMessage(languagecode, 'modals.main.settings.sections.weather.temp_format.kelvin') + ' (K)',
+ name: getMessage('modals.main.settings.sections.weather.temp_format.kelvin') + ' (K)',
value: 'kelvin'
}
];
return (
<>
- {getMessage(languagecode, 'modals.main.settings.sections.weather.title')}
-
+ {getMessage('modals.main.settings.sections.weather.title')}
+
-
-
+
+
- {getMessage(languagecode, 'modals.main.settings.sections.weather.extra_info.title')}
-
-
-
-
-
-
-
-
-
-
+ {getMessage('modals.main.settings.sections.weather.extra_info.title')}
+
+
+
+
+
+
+
+
+
+
>
);
}
diff --git a/src/components/modals/main/settings/sections/background/Background.jsx b/src/components/modals/main/settings/sections/background/Background.jsx
index a51467a1..2ea56ca6 100644
--- a/src/components/modals/main/settings/sections/background/Background.jsx
+++ b/src/components/modals/main/settings/sections/background/Background.jsx
@@ -15,15 +15,14 @@ import ColourSettings from './Colour';
import EventBus from 'modules/helpers/eventbus';
export default class BackgroundSettings extends PureComponent {
- getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
- languagecode = variables.languagecode;
+ getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
constructor() {
super();
this.state = {
customBackground: this.getCustom(),
backgroundType: localStorage.getItem('backgroundType') || 'api',
- backgroundCategories: [this.getMessage(this.languagecode, 'modals.main.loading')]
+ backgroundCategories: [this.getMessage('modals.main.loading')]
};
this.controller = new AbortController();
}
@@ -33,7 +32,7 @@ export default class BackgroundSettings extends PureComponent {
this.setState({
customBackground: ['']
});
- toast(this.getMessage(this.languagecode, 'toasts.reset'));
+ toast(this.getMessage('toasts.reset'));
EventBus.dispatch('refresh', 'background');
}
@@ -73,8 +72,8 @@ export default class BackgroundSettings extends PureComponent {
if (customBackground.startsWith('data:video/') || customBackground.endsWith('.mp4') || customBackground.endsWith('.webm') || customBackground.endsWith('.ogg')) {
return (
<>
-
-
+
+
>
);
} else {
@@ -84,7 +83,7 @@ export default class BackgroundSettings extends PureComponent {
marketplaceType = () => {
if (localStorage.getItem('photo_packs')) {
- return ;
+ return ;
}
}
@@ -123,7 +122,7 @@ export default class BackgroundSettings extends PureComponent {
componentDidMount() {
if (navigator.onLine === false || localStorage.getItem('offlineMode') === 'true') {
return this.setState({
- backgroundCategories: [this.getMessage(this.languagecode, 'modals.update.offline.title')]
+ backgroundCategories: [this.getMessage('modals.update.offline.title')]
});
}
diff --git a/src/components/modals/main/settings/sections/background/Colour.jsx b/src/components/modals/main/settings/sections/background/Colour.jsx
index c60201d8..33ddbb19 100644
--- a/src/components/modals/main/settings/sections/background/Colour.jsx
+++ b/src/components/modals/main/settings/sections/background/Colour.jsx
@@ -13,8 +13,7 @@ export default class ColourSettings extends PureComponent {
DefaultGradientSettings = { angle: '180', gradient: [{ colour: '#ffb032', stop: 0 }], type: 'linear' };
GradientPickerInitalState = undefined;
- getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
- languagecode = variables.languagecode;
+ getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
constructor() {
super();
@@ -28,7 +27,7 @@ export default class ColourSettings extends PureComponent {
this.setState({
gradientSettings: this.DefaultGradientSettings
});
- toast(this.getMessage(this.languagecode, 'toasts.reset'));
+ toast(this.getMessage('toasts.reset'));
}
initialiseColourPickerState(gradientSettings) {
@@ -105,14 +104,14 @@ export default class ColourSettings extends PureComponent {
}
currentGradientSettings = () => {
- if (typeof this.state.gradientSettings === 'object' && this.state.gradientSettings.gradient.every(g => g.colour !== this.getMessage(this.languagecode, 'modals.main.settings.sections.background.source.disabled'))) {
+ if (typeof this.state.gradientSettings === 'object' && this.state.gradientSettings.gradient.every(g => g.colour !== this.getMessage('modals.main.settings.sections.background.source.disabled'))) {
const clampNumber = (num, a, b) => Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b));
return JSON.stringify({
...this.state.gradientSettings,
gradient: [...this.state.gradientSettings.gradient.map(g => { return { ...g, stop: clampNumber(+g.stop, 0, 100) } })].sort((a, b) => (a.stop > b.stop) ? 1 : -1)
});
}
- return this.getMessage(this.languagecode, 'modals.main.settings.sections.background.source.disabled');
+ return this.getMessage('modals.main.settings.sections.background.source.disabled');
}
onColourPickerChange = (attrs, name) => {
@@ -176,14 +175,14 @@ export default class ColourSettings extends PureComponent {
colourSettings = (
<>
{gradientInputs}
- {!gradientHasMoreThanOneColour ? (<>
>) : null}
+ {!gradientHasMoreThanOneColour ? (<>
>) : null}
>
);
}
return (
<>
- {this.getMessage(this.languagecode, 'modals.main.settings.sections.background.source.custom_colour')} this.resetColour()}>{this.getMessage(this.languagecode, 'modals.main.settings.buttons.reset')}
+ {this.getMessage('modals.main.settings.sections.background.source.custom_colour')} this.resetColour()}>{this.getMessage('modals.main.settings.buttons.reset')}
{colourSettings}
>
);
diff --git a/src/components/modals/main/tabs/Addons.jsx b/src/components/modals/main/tabs/Addons.jsx
index 0d598c6e..e070af45 100644
--- a/src/components/modals/main/tabs/Addons.jsx
+++ b/src/components/modals/main/tabs/Addons.jsx
@@ -6,14 +6,13 @@ import Sideload from '../marketplace/sections/Sideload';
import Create from '../marketplace/sections/Create';
export default function Addons() {
- const getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
- const languagecode = variables.languagecode;
+ const getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
return (
-
-
-
+
+
+
);
}
diff --git a/src/components/modals/main/tabs/Marketplace.jsx b/src/components/modals/main/tabs/Marketplace.jsx
index f31310a4..705d4130 100644
--- a/src/components/modals/main/tabs/Marketplace.jsx
+++ b/src/components/modals/main/tabs/Marketplace.jsx
@@ -4,14 +4,13 @@ import Tabs from './backend/Tabs';
import MarketplaceTab from '../marketplace/sections/Marketplace';
export default function Marketplace() {
- const getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
- const languagecode = variables.languagecode;
+ const getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
return (
-
-
-
+
+
+
);
}
diff --git a/src/components/modals/main/tabs/Settings.jsx b/src/components/modals/main/tabs/Settings.jsx
index e8f86753..e8c44c96 100644
--- a/src/components/modals/main/tabs/Settings.jsx
+++ b/src/components/modals/main/tabs/Settings.jsx
@@ -20,29 +20,28 @@ import Keybinds from '../settings/sections/Keybinds';
import Message from '../settings/sections/Message';
export default function Settings() {
- const getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
- const languagecode = variables.languagecode;
+ const getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
return (
<>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
>
);
diff --git a/src/components/modals/main/tabs/backend/Tab.jsx b/src/components/modals/main/tabs/backend/Tab.jsx
index f7efed36..4dc06bbd 100644
--- a/src/components/modals/main/tabs/backend/Tab.jsx
+++ b/src/components/modals/main/tabs/backend/Tab.jsx
@@ -27,8 +27,7 @@ import {
} from '@mui/icons-material';
function Tab({ label, currentTab, onClick, navbarTab }) {
- const getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
- const languagecode = variables.languagecode;
+ const getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
let className = 'tab-list-item';
if (currentTab === label) {
@@ -44,40 +43,40 @@ function Tab({ label, currentTab, onClick, navbarTab }) {
let icon, divider;
switch (label) {
- case getMessage(languagecode, 'modals.main.navbar.settings'): icon = ; break;
- case getMessage(languagecode, 'modals.main.navbar.addons'): icon = ; break;
- case getMessage(languagecode, 'modals.main.navbar.marketplace'): icon = ; break;
+ case getMessage('modals.main.navbar.settings'): icon = ; break;
+ case getMessage('modals.main.navbar.addons'): icon = ; break;
+ case getMessage('modals.main.navbar.marketplace'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.time.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.greeting.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.quote.title'): icon =
; break;
- case getMessage(languagecode, 'modals.main.settings.sections.background.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.search.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.weather.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.quicklinks.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.appearance.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.order.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.message.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.language.title'): icon = ; divider = true; break;
- case getMessage(languagecode, 'modals.main.settings.sections.advanced.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.keybinds.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.stats.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.experimental.title'): icon = ; divider = true; break;
- case getMessage(languagecode, 'modals.main.settings.sections.changelog'): icon = ; break;
- case getMessage(languagecode, 'modals.main.settings.sections.about.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.time.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.greeting.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.quote.title'): icon =
; break;
+ case getMessage('modals.main.settings.sections.background.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.search.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.weather.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.quicklinks.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.appearance.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.order.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.message.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.language.title'): icon = ; divider = true; break;
+ case getMessage('modals.main.settings.sections.advanced.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.keybinds.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.stats.title'): icon = ; break;
+ case getMessage('modals.main.settings.sections.experimental.title'): icon = ; divider = true; break;
+ case getMessage('modals.main.settings.sections.changelog'): icon = ; break;
+ case getMessage('modals.main.settings.sections.about.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.addons.added'): icon = ; break;
- case getMessage(languagecode, 'modals.main.addons.sideload'): icon = ; break;
- case getMessage(languagecode, 'modals.main.addons.create.title'): icon = ; break;
+ case getMessage('modals.main.addons.added'): icon = ; break;
+ case getMessage('modals.main.addons.sideload'): icon = ; break;
+ case getMessage('modals.main.addons.create.title'): icon = ; break;
- case getMessage(languagecode, 'modals.main.marketplace.photo_packs'): icon = ; break;
- case getMessage(languagecode, 'modals.main.marketplace.quote_packs'): icon =
; break;
- case getMessage(languagecode, 'modals.main.marketplace.preset_settings'): icon = ; break;
+ case getMessage('modals.main.marketplace.photo_packs'): icon = ; break;
+ case getMessage('modals.main.marketplace.quote_packs'): icon =
; break;
+ case getMessage('modals.main.marketplace.preset_settings'): icon = ; break;
default: break;
}
- if (label === getMessage(languagecode, 'modals.main.settings.sections.experimental.title')) {
+ if (label === getMessage('modals.main.settings.sections.experimental.title')) {
if (localStorage.getItem('experimental') === 'false') {
return
;
}
diff --git a/src/components/modals/welcome/Welcome.jsx b/src/components/modals/welcome/Welcome.jsx
index 934d402f..3ea518a3 100644
--- a/src/components/modals/welcome/Welcome.jsx
+++ b/src/components/modals/welcome/Welcome.jsx
@@ -9,8 +9,7 @@ import ProgressBar from './ProgressBar';
import './welcome.scss';
export default class WelcomeModal extends PureComponent {
- getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
- languagecode = variables.languagecode;
+ getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
constructor() {
super();
@@ -18,7 +17,7 @@ export default class WelcomeModal extends PureComponent {
image: './././icons/undraw_celebration.svg',
currentTab: 0,
finalTab: 4,
- buttonText: this.getMessage(this.languagecode, 'modals.welcome.buttons.next')
+ buttonText: this.getMessage('modals.welcome.buttons.next')
};
this.images = [
'./././icons/undraw_celebration.svg',
@@ -38,18 +37,18 @@ export default class WelcomeModal extends PureComponent {
return this.setState({
currentTab: this.state.currentTab - 1,
image: this.images[this.state.currentTab - 1],
- buttonText: this.getMessage(this.languagecode, 'modals.welcome.buttons.next')
+ buttonText: this.getMessage('modals.welcome.buttons.next')
});
}
- if (this.state.buttonText === this.getMessage(this.languagecode, 'modals.welcome.buttons.close')) {
+ if (this.state.buttonText === this.getMessage('modals.welcome.buttons.close')) {
return this.props.modalClose();
}
this.setState({
currentTab: this.state.currentTab + 1,
image: this.images[this.state.currentTab + 1],
- buttonText: (this.state.currentTab !== this.state.finalTab) ? this.getMessage(this.languagecode, 'modals.welcome.buttons.next') : this.getMessage(this.languagecode, 'modals.welcome.buttons.close')
+ buttonText: (this.state.currentTab !== this.state.finalTab) ? this.getMessage('modals.welcome.buttons.next') : this.getMessage('modals.welcome.buttons.close')
});
}
@@ -58,7 +57,7 @@ export default class WelcomeModal extends PureComponent {
this.setState({
currentTab: tab,
image: this.images[tab],
- buttonText: (tab !== this.state.finalTab + 1) ? this.getMessage(this.languagecode, 'modals.welcome.buttons.next') : this.getMessage(this.languagecode, 'modals.welcome.buttons.close')
+ buttonText: (tab !== this.state.finalTab + 1) ? this.getMessage('modals.welcome.buttons.next') : this.getMessage('modals.welcome.buttons.close')
});
localStorage.setItem('bgtransition', true);
@@ -71,7 +70,7 @@ export default class WelcomeModal extends PureComponent {
this.setState({
currentTab: Number(welcomeTab),
image: this.images[Number(welcomeTab)],
- buttonText: (Number(welcomeTab) !== this.state.finalTab + 1) ? this.getMessage(this.languagecode, 'modals.welcome.buttons.next') : this.getMessage(this.languagecode, 'modals.welcome.buttons.close')
+ buttonText: (Number(welcomeTab) !== this.state.finalTab + 1) ? this.getMessage('modals.welcome.buttons.next') : this.getMessage('modals.welcome.buttons.close')
});
}
@@ -100,7 +99,7 @@ export default class WelcomeModal extends PureComponent {
this.switchTab(tab)}/>