mirror of https://github.com/mue/mue.git
style: Variables for translation to improve clarity and reduce line length
This commit is contained in:
parent
c7f21c295c
commit
959a928366
|
@ -110,10 +110,12 @@ function Navbar() {
|
||||||
variables.stats.postEvent('feature', 'App link delete');
|
variables.stats.postEvent('feature', 'App link delete');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const NAVBAR_SECTION = 'modals.main.settings.sections.appearance.navbar';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header
|
<Header
|
||||||
title={variables.getMessage('modals.main.settings.sections.appearance.navbar.title')}
|
title={variables.getMessage(`${NAVBAR_SECTION}.title`)}
|
||||||
setting="navbar"
|
setting="navbar"
|
||||||
category="widgets"
|
category="widgets"
|
||||||
zoomSetting="zoomNavbar"
|
zoomSetting="zoomNavbar"
|
||||||
|
@ -128,12 +130,12 @@ function Navbar() {
|
||||||
>
|
>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="navbarHover"
|
name="navbarHover"
|
||||||
text={variables.getMessage('modals.main.settings.sections.appearance.navbar.hover')}
|
text={variables.getMessage(`${NAVBAR_SECTION}.hover`)}
|
||||||
category="navbar"
|
category="navbar"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="notesEnabled"
|
name="notesEnabled"
|
||||||
text={variables.getMessage('modals.main.settings.sections.appearance.navbar.notes')}
|
text={variables.getMessage(`${NAVBAR_SECTION}.notes`)}
|
||||||
category="navbar"
|
category="navbar"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
@ -143,7 +145,7 @@ function Navbar() {
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="refresh"
|
name="refresh"
|
||||||
text={variables.getMessage('modals.main.settings.sections.appearance.navbar.refresh')}
|
text={variables.getMessage(`${NAVBAR_SECTION}.refresh`)}
|
||||||
category="navbar"
|
category="navbar"
|
||||||
onChange={setShowRefreshOptions}
|
onChange={setShowRefreshOptions}
|
||||||
/>
|
/>
|
||||||
|
@ -161,7 +163,7 @@ function Navbar() {
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
{showRefreshOptions && (
|
{showRefreshOptions && (
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.sections.appearance.navbar.refresh')}
|
title={variables.getMessage(`${NAVBAR_SECTION}.refresh`)}
|
||||||
subtitle={variables.getMessage(
|
subtitle={variables.getMessage(
|
||||||
'modals.main.settings.sections.appearance.navbar.refresh_subtitle',
|
'modals.main.settings.sections.appearance.navbar.refresh_subtitle',
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import variables from 'modules/variables';
|
import variables from 'modules/variables';
|
||||||
import { PureComponent, createRef } from 'react';
|
import { PureComponent, createRef } from 'react';
|
||||||
import { MdAddLink, MdLinkOff, MdCancel, MdEdit } from 'react-icons/md';
|
import { MdAddLink, MdLinkOff } from 'react-icons/md';
|
||||||
import Header from '../Header';
|
import Header from '../Header';
|
||||||
import Checkbox from '../Checkbox';
|
import Checkbox from '../Checkbox';
|
||||||
import Dropdown from '../Dropdown';
|
import Dropdown from '../Dropdown';
|
||||||
|
@ -124,10 +124,12 @@ export default class QuickLinks extends PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const QUICKLINKS_SECTION = 'modals.main.settings.sections.quicklinks';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header
|
<Header
|
||||||
title={variables.getMessage('modals.main.settings.sections.quicklinks.title')}
|
title={variables.getMessage(`${QUICKLINKS_SECTION}.title`)}
|
||||||
setting="quicklinksenabled"
|
setting="quicklinksenabled"
|
||||||
category="quicklinks"
|
category="quicklinks"
|
||||||
element=".quicklinks-container"
|
element=".quicklinks-container"
|
||||||
|
@ -136,49 +138,45 @@ export default class QuickLinks extends PureComponent {
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.additional_settings')}
|
title={variables.getMessage('modals.main.settings.additional_settings')}
|
||||||
subtitle={variables.getMessage('modals.main.settings.sections.quicklinks.additional')}
|
subtitle={variables.getMessage(`${QUICKLINKS_SECTION}.additional`)}
|
||||||
>
|
>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="quicklinksnewtab"
|
name="quicklinksnewtab"
|
||||||
text={variables.getMessage('modals.main.settings.sections.quicklinks.open_new')}
|
text={variables.getMessage(`${QUICKLINKS_SECTION}.open_new`)}
|
||||||
category="quicklinks"
|
category="quicklinks"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="quicklinkstooltip"
|
name="quicklinkstooltip"
|
||||||
text={variables.getMessage('modals.main.settings.sections.quicklinks.tooltip')}
|
text={variables.getMessage(`${QUICKLINKS_SECTION}.tooltip`)}
|
||||||
category="quicklinks"
|
category="quicklinks"
|
||||||
/>
|
/>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.sections.quicklinks.styling')}
|
title={variables.getMessage(`${QUICKLINKS_SECTION}.styling`)}
|
||||||
subtitle={variables.getMessage(
|
subtitle={variables.getMessage(
|
||||||
'modals.main.settings.sections.quicklinks.styling_description',
|
'modals.main.settings.sections.quicklinks.styling_description',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
label={variables.getMessage('modals.main.settings.sections.quicklinks.style')}
|
label={variables.getMessage(`${QUICKLINKS_SECTION}.style`)}
|
||||||
name="quickLinksStyle"
|
name="quickLinksStyle"
|
||||||
category="quicklinks"
|
category="quicklinks"
|
||||||
>
|
>
|
||||||
<option value="icon">
|
<option value="icon">
|
||||||
{variables.getMessage('modals.main.settings.sections.quicklinks.options.icon')}
|
{variables.getMessage(`${QUICKLINKS_SECTION}.options.icon`)}
|
||||||
</option>
|
</option>
|
||||||
<option value="text">
|
<option value="text">
|
||||||
{variables.getMessage('modals.main.settings.sections.quicklinks.options.text_only')}
|
{variables.getMessage(`${QUICKLINKS_SECTION}.options.text_only`)}
|
||||||
</option>
|
</option>
|
||||||
<option value="metro">
|
<option value="metro">
|
||||||
{variables.getMessage('modals.main.settings.sections.quicklinks.options.metro')}
|
{variables.getMessage(`${QUICKLINKS_SECTION}.options.metro`)}
|
||||||
</option>
|
</option>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
|
|
||||||
<SettingsItem
|
<SettingsItem title={variables.getMessage(`${QUICKLINKS_SECTION}.title`)} final={true}>
|
||||||
title={variables.getMessage('modals.main.settings.sections.quicklinks.title')}
|
|
||||||
final={true}
|
|
||||||
>
|
|
||||||
<button onClick={() => this.setState({ showAddModal: true })}>
|
<button onClick={() => this.setState({ showAddModal: true })}>
|
||||||
{variables.getMessage('modals.main.settings.sections.quicklinks.add_link')}{' '}
|
{variables.getMessage(`${QUICKLINKS_SECTION}.add_link`)} <MdAddLink />
|
||||||
<MdAddLink />
|
|
||||||
</button>
|
</button>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
|
|
||||||
|
@ -187,13 +185,13 @@ export default class QuickLinks extends PureComponent {
|
||||||
<div className="emptyNewMessage">
|
<div className="emptyNewMessage">
|
||||||
<MdLinkOff />
|
<MdLinkOff />
|
||||||
<span className="title">
|
<span className="title">
|
||||||
{variables.getMessage('modals.main.settings.sections.quicklinks.no_quicklinks')}
|
{variables.getMessage(`${QUICKLINKS_SECTION}.no_quicklinks`)}
|
||||||
</span>
|
</span>
|
||||||
<span className="subtitle">
|
<span className="subtitle">
|
||||||
{variables.getMessage('modals.main.settings.sections.message.add_some')}
|
{variables.getMessage('modals.main.settings.sections.message.add_some')}
|
||||||
</span>
|
</span>
|
||||||
<button onClick={() => this.setState({ showAddModal: true })}>
|
<button onClick={() => this.setState({ showAddModal: true })}>
|
||||||
{variables.getMessage('modals.main.settings.sections.quicklinks.add_link')}
|
{variables.getMessage(`${QUICKLINKS_SECTION}.add_link`)}
|
||||||
<MdAddLink />
|
<MdAddLink />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -92,17 +92,19 @@ export default class QuoteSettings extends PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const QUOTE_SECTION = 'modals.main.settings.sections.quote';
|
||||||
|
|
||||||
let customSettings;
|
let customSettings;
|
||||||
if (this.state.quoteType === 'custom' && this.state.sourceSection === true) {
|
if (this.state.quoteType === 'custom' && this.state.sourceSection === true) {
|
||||||
customSettings = (
|
customSettings = (
|
||||||
<>
|
<>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.sections.quote.custom')}
|
title={variables.getMessage(`${QUOTE_SECTION}.custom`)}
|
||||||
subtitle={variables.getMessage('modals.main.settings.sections.quote.custom_subtitle')}
|
subtitle={variables.getMessage(`${QUOTE_SECTION}.custom_subtitle`)}
|
||||||
final={true}
|
final={true}
|
||||||
>
|
>
|
||||||
<button onClick={() => this.modifyCustomQuote('add')}>
|
<button onClick={() => this.modifyCustomQuote('add')}>
|
||||||
{variables.getMessage('modals.main.settings.sections.quote.add')} <MdAdd />
|
{variables.getMessage(`${QUOTE_SECTION}.add`)} <MdAdd />
|
||||||
</button>
|
</button>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
|
|
||||||
|
@ -152,14 +154,12 @@ export default class QuoteSettings extends PureComponent {
|
||||||
<div className="photosEmpty">
|
<div className="photosEmpty">
|
||||||
<div className="emptyNewMessage">
|
<div className="emptyNewMessage">
|
||||||
<MdOutlineFormatQuote />
|
<MdOutlineFormatQuote />
|
||||||
<span className="title">
|
<span className="title">{variables.getMessage(`${QUOTE_SECTION}.no_quotes`)}</span>
|
||||||
{variables.getMessage('modals.main.settings.sections.quote.no_quotes')}
|
|
||||||
</span>
|
|
||||||
<span className="subtitle">
|
<span className="subtitle">
|
||||||
{variables.getMessage('modals.main.settings.sections.message.add_some')}
|
{variables.getMessage('modals.main.settings.sections.message.add_some')}
|
||||||
</span>
|
</span>
|
||||||
<button onClick={() => this.modifyCustomQuote('add')}>
|
<button onClick={() => this.modifyCustomQuote('add')}>
|
||||||
{variables.getMessage('modals.main.settings.sections.quote.add')} <MdAdd />
|
{variables.getMessage(`${QUOTE_SECTION}.add`)} <MdAdd />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -175,15 +175,13 @@ export default class QuoteSettings extends PureComponent {
|
||||||
<>
|
<>
|
||||||
{this.state.sourceSection ? (
|
{this.state.sourceSection ? (
|
||||||
<span className="mainTitle" onClick={() => this.setState({ sourceSection: false })}>
|
<span className="mainTitle" onClick={() => this.setState({ sourceSection: false })}>
|
||||||
<span className="backTitle">
|
<span className="backTitle">{variables.getMessage(`${QUOTE_SECTION}.title`)}</span>
|
||||||
{variables.getMessage('modals.main.settings.sections.quote.title')}
|
|
||||||
</span>
|
|
||||||
<MdOutlineKeyboardArrowRight />{' '}
|
<MdOutlineKeyboardArrowRight />{' '}
|
||||||
{variables.getMessage('modals.main.settings.sections.background.source.title')}
|
{variables.getMessage('modals.main.settings.sections.background.source.title')}
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<Header
|
<Header
|
||||||
title={variables.getMessage('modals.main.settings.sections.quote.title')}
|
title={variables.getMessage(`${QUOTE_SECTION}.title`)}
|
||||||
setting="quote"
|
setting="quote"
|
||||||
category="quote"
|
category="quote"
|
||||||
element=".quotediv"
|
element=".quotediv"
|
||||||
|
@ -199,7 +197,7 @@ export default class QuoteSettings extends PureComponent {
|
||||||
{variables.getMessage('modals.main.settings.sections.background.source.title')}
|
{variables.getMessage('modals.main.settings.sections.background.source.title')}
|
||||||
</span>
|
</span>
|
||||||
<span className="subtitle">
|
<span className="subtitle">
|
||||||
{variables.getMessage('modals.main.settings.sections.quote.source_subtitle')}
|
{variables.getMessage(`${QUOTE_SECTION}.source_subtitle`)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -214,23 +212,21 @@ export default class QuoteSettings extends PureComponent {
|
||||||
<option value="api">
|
<option value="api">
|
||||||
{variables.getMessage('modals.main.settings.sections.background.type.api')}
|
{variables.getMessage('modals.main.settings.sections.background.type.api')}
|
||||||
</option>
|
</option>
|
||||||
<option value="custom">
|
<option value="custom">{variables.getMessage(`${QUOTE_SECTION}.custom`)}</option>
|
||||||
{variables.getMessage('modals.main.settings.sections.quote.custom')}
|
|
||||||
</option>
|
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{!this.state.sourceSection && (
|
{!this.state.sourceSection && (
|
||||||
<>
|
<>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.sections.quote.buttons.title')}
|
title={variables.getMessage(`${QUOTE_SECTION}.buttons.title`)}
|
||||||
subtitle={variables.getMessage(
|
subtitle={variables.getMessage(
|
||||||
'modals.main.settings.sections.quote.buttons.subtitle',
|
'modals.main.settings.sections.quote.buttons.subtitle',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="copyButton"
|
name="copyButton"
|
||||||
text={variables.getMessage('modals.main.settings.sections.quote.buttons.copy')}
|
text={variables.getMessage(`${QUOTE_SECTION}.buttons.copy`)}
|
||||||
category="quote"
|
category="quote"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
@ -240,14 +236,14 @@ export default class QuoteSettings extends PureComponent {
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="favouriteQuoteEnabled"
|
name="favouriteQuoteEnabled"
|
||||||
text={variables.getMessage('modals.main.settings.sections.quote.buttons.favourite')}
|
text={variables.getMessage(`${QUOTE_SECTION}.buttons.favourite`)}
|
||||||
category="quote"
|
category="quote"
|
||||||
/>
|
/>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
|
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.additional_settings')}
|
title={variables.getMessage('modals.main.settings.additional_settings')}
|
||||||
subtitle={variables.getMessage('modals.main.settings.sections.quote.additional')}
|
subtitle={variables.getMessage(`${QUOTE_SECTION}.additional`)}
|
||||||
final={true}
|
final={true}
|
||||||
>
|
>
|
||||||
{/*<Dropdown
|
{/*<Dropdown
|
||||||
|
@ -281,12 +277,12 @@ export default class QuoteSettings extends PureComponent {
|
||||||
</Dropdown>*/}
|
</Dropdown>*/}
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="authorLink"
|
name="authorLink"
|
||||||
text={variables.getMessage('modals.main.settings.sections.quote.author_link')}
|
text={variables.getMessage(`${QUOTE_SECTION}.author_link`)}
|
||||||
element=".other"
|
element=".other"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="authorImg"
|
name="authorImg"
|
||||||
text={variables.getMessage('modals.main.settings.sections.quote.author_img')}
|
text={variables.getMessage(`${QUOTE_SECTION}.author_img`)}
|
||||||
element=".other"
|
element=".other"
|
||||||
/>
|
/>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
|
|
|
@ -68,46 +68,48 @@ export default class SearchSettings extends PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const SEARCH_SECTION = 'modals.main.settings.sections.search';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header
|
<Header
|
||||||
title={variables.getMessage('modals.main.settings.sections.search.title')}
|
title={variables.getMessage(`${SEARCH_SECTION}.title`)}
|
||||||
setting="searchBar"
|
setting="searchBar"
|
||||||
category="widgets"
|
category="widgets"
|
||||||
switch={true}
|
switch={true}
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.additional_settings')}
|
title={variables.getMessage('modals.main.settings.additional_settings')}
|
||||||
subtitle={variables.getMessage('modals.main.settings.sections.search.additional')}
|
subtitle={variables.getMessage(`${SEARCH_SECTION}.additional`)}
|
||||||
>
|
>
|
||||||
{/* not supported on firefox */}
|
{/* not supported on firefox */}
|
||||||
{navigator.userAgent.includes('Chrome') && typeof InstallTrigger === 'undefined' ? (
|
{navigator.userAgent.includes('Chrome') && typeof InstallTrigger === 'undefined' ? (
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="voiceSearch"
|
name="voiceSearch"
|
||||||
text={variables.getMessage('modals.main.settings.sections.search.voice_search')}
|
text={variables.getMessage(`${SEARCH_SECTION}.voice_search`)}
|
||||||
category="search"
|
category="search"
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="searchDropdown"
|
name="searchDropdown"
|
||||||
text={variables.getMessage('modals.main.settings.sections.search.dropdown')}
|
text={variables.getMessage(`${SEARCH_SECTION}.dropdown`)}
|
||||||
category="search"
|
category="search"
|
||||||
element=".other"
|
element=".other"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="searchFocus"
|
name="searchFocus"
|
||||||
text={variables.getMessage('modals.main.settings.sections.search.focus')}
|
text={variables.getMessage(`${SEARCH_SECTION}.focus`)}
|
||||||
category="search"
|
category="search"
|
||||||
element=".other"
|
element=".other"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="autocomplete"
|
name="autocomplete"
|
||||||
text={variables.getMessage('modals.main.settings.sections.search.autocomplete')}
|
text={variables.getMessage(`${SEARCH_SECTION}.autocomplete`)}
|
||||||
category="search"
|
category="search"
|
||||||
/>
|
/>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.sections.search.search_engine')}
|
title={variables.getMessage(`${SEARCH_SECTION}.search_engine`)}
|
||||||
subtitle={variables.getMessage(
|
subtitle={variables.getMessage(
|
||||||
'modals.main.settings.sections.search.search_engine_subtitle',
|
'modals.main.settings.sections.search.search_engine_subtitle',
|
||||||
)}
|
)}
|
||||||
|
@ -124,17 +126,14 @@ export default class SearchSettings extends PureComponent {
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
))}
|
))}
|
||||||
<MenuItem value="custom">
|
<MenuItem value="custom">
|
||||||
{variables.getMessage('modals.main.settings.sections.search.custom').split(' ')[0]}
|
{variables.getMessage(`${SEARCH_SECTION}.custom`).split(' ')[0]}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
<div style={{ display: this.state.customDisplay }}>
|
<div style={{ display: this.state.customDisplay }}>
|
||||||
<SettingsItem
|
<SettingsItem title={variables.getMessage(`${SEARCH_SECTION}.custom`)} final={true}>
|
||||||
title={variables.getMessage('modals.main.settings.sections.search.custom')}
|
|
||||||
final={true}
|
|
||||||
>
|
|
||||||
<TextField
|
<TextField
|
||||||
label={variables.getMessage('modals.main.settings.sections.search.custom')}
|
label={variables.getMessage(`${SEARCH_SECTION}.custom`)}
|
||||||
value={this.state.customValue}
|
value={this.state.customValue}
|
||||||
onInput={(e) => this.setState({ customValue: e.target.value })}
|
onInput={(e) => this.setState({ customValue: e.target.value })}
|
||||||
varient="outlined"
|
varient="outlined"
|
||||||
|
|
|
@ -26,23 +26,23 @@ export default class TimeSettings extends PureComponent {
|
||||||
render() {
|
render() {
|
||||||
let timeSettings = null;
|
let timeSettings = null;
|
||||||
|
|
||||||
|
const TIME_SECTION = 'modals.main.settings.sections.time';
|
||||||
|
|
||||||
const digitalSettings = (
|
const digitalSettings = (
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.sections.time.digital.title')}
|
title={variables.getMessage(`${TIME_SECTION}.digital.title`)}
|
||||||
subtitle={variables.getMessage('modals.main.settings.sections.time.digital.subtitle')}
|
subtitle={variables.getMessage(`${TIME_SECTION}.digital.subtitle`)}
|
||||||
final={true}
|
final={true}
|
||||||
>
|
>
|
||||||
<Radio
|
<Radio
|
||||||
name="timeformat"
|
name="timeformat"
|
||||||
options={[
|
options={[
|
||||||
{
|
{
|
||||||
name: variables.getMessage(
|
name: variables.getMessage(`${TIME_SECTION}.digital.twentyfourhour`),
|
||||||
'modals.main.settings.sections.time.digital.twentyfourhour',
|
|
||||||
),
|
|
||||||
value: 'twentyfourhour',
|
value: 'twentyfourhour',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: variables.getMessage('modals.main.settings.sections.time.digital.twelvehour'),
|
name: variables.getMessage(`${TIME_SECTION}.digital.twelvehour`),
|
||||||
value: 'twelvehour',
|
value: 'twelvehour',
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
@ -51,12 +51,12 @@ export default class TimeSettings extends PureComponent {
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="seconds"
|
name="seconds"
|
||||||
text={variables.getMessage('modals.main.settings.sections.time.digital.seconds')}
|
text={variables.getMessage(`${TIME_SECTION}.digital.seconds`)}
|
||||||
category="clock"
|
category="clock"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="zero"
|
name="zero"
|
||||||
text={variables.getMessage('modals.main.settings.sections.time.digital.zero')}
|
text={variables.getMessage(`${TIME_SECTION}.digital.zero`)}
|
||||||
category="clock"
|
category="clock"
|
||||||
/>
|
/>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
|
@ -64,38 +64,38 @@ export default class TimeSettings extends PureComponent {
|
||||||
|
|
||||||
const analogSettings = (
|
const analogSettings = (
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.sections.time.analogue.title')}
|
title={variables.getMessage(`${TIME_SECTION}.analogue.title`)}
|
||||||
subtitle={variables.getMessage('modals.main.settings.sections.time.analogue.subtitle')}
|
subtitle={variables.getMessage(`${TIME_SECTION}.analogue.subtitle`)}
|
||||||
final={true}
|
final={true}
|
||||||
>
|
>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="secondHand"
|
name="secondHand"
|
||||||
text={variables.getMessage('modals.main.settings.sections.time.analogue.second_hand')}
|
text={variables.getMessage(`${TIME_SECTION}.analogue.second_hand`)}
|
||||||
category="clock"
|
category="clock"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="minuteHand"
|
name="minuteHand"
|
||||||
text={variables.getMessage('modals.main.settings.sections.time.analogue.minute_hand')}
|
text={variables.getMessage(`${TIME_SECTION}.analogue.minute_hand`)}
|
||||||
category="clock"
|
category="clock"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="hourHand"
|
name="hourHand"
|
||||||
text={variables.getMessage('modals.main.settings.sections.time.analogue.hour_hand')}
|
text={variables.getMessage(`${TIME_SECTION}.analogue.hour_hand`)}
|
||||||
category="clock"
|
category="clock"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="hourMarks"
|
name="hourMarks"
|
||||||
text={variables.getMessage('modals.main.settings.sections.time.analogue.hour_marks')}
|
text={variables.getMessage(`${TIME_SECTION}.analogue.hour_marks`)}
|
||||||
category="clock"
|
category="clock"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="minuteMarks"
|
name="minuteMarks"
|
||||||
text={variables.getMessage('modals.main.settings.sections.time.analogue.minute_marks')}
|
text={variables.getMessage(`${TIME_SECTION}.analogue.minute_marks`)}
|
||||||
category="clock"
|
category="clock"
|
||||||
/>
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="roundClock"
|
name="roundClock"
|
||||||
text={variables.getMessage('modals.main.settings.sections.time.analogue.round_clock')}
|
text={variables.getMessage(`${TIME_SECTION}.analogue.round_clock`)}
|
||||||
category="clock"
|
category="clock"
|
||||||
/>
|
/>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
|
@ -160,7 +160,7 @@ export default class TimeSettings extends PureComponent {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header
|
<Header
|
||||||
title={variables.getMessage('modals.main.settings.sections.time.title')}
|
title={variables.getMessage(`${TIME_SECTION}.title`)}
|
||||||
setting="time"
|
setting="time"
|
||||||
category="clock"
|
category="clock"
|
||||||
element=".clock-container"
|
element=".clock-container"
|
||||||
|
@ -168,8 +168,8 @@ export default class TimeSettings extends PureComponent {
|
||||||
switch={true}
|
switch={true}
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.sections.time.type')}
|
title={variables.getMessage(`${TIME_SECTION}.type`)}
|
||||||
subtitle={variables.getMessage('modals.main.settings.sections.time.type_subtitle')}
|
subtitle={variables.getMessage(`${TIME_SECTION}.type_subtitle`)}
|
||||||
final={this.state.timeType === 'percentageComplete'}
|
final={this.state.timeType === 'percentageComplete'}
|
||||||
>
|
>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
|
@ -177,17 +177,15 @@ export default class TimeSettings extends PureComponent {
|
||||||
onChange={(value) => this.setState({ timeType: value })}
|
onChange={(value) => this.setState({ timeType: value })}
|
||||||
category="clock"
|
category="clock"
|
||||||
>
|
>
|
||||||
<option value="digital">
|
<option value="digital">{variables.getMessage(`${TIME_SECTION}.digital.title`)}</option>
|
||||||
{variables.getMessage('modals.main.settings.sections.time.digital.title')}
|
|
||||||
</option>
|
|
||||||
<option value="analogue">
|
<option value="analogue">
|
||||||
{variables.getMessage('modals.main.settings.sections.time.analogue.title')}
|
{variables.getMessage(`${TIME_SECTION}.analogue.title`)}
|
||||||
</option>
|
</option>
|
||||||
<option value="percentageComplete">
|
<option value="percentageComplete">
|
||||||
{variables.getMessage('modals.main.settings.sections.time.percentage_complete')}
|
{variables.getMessage(`${TIME_SECTION}.percentage_complete`)}
|
||||||
</option>
|
</option>
|
||||||
<option value="verticalClock">
|
<option value="verticalClock">
|
||||||
{variables.getMessage('modals.main.settings.sections.time.vertical_clock.title')}
|
{variables.getMessage(`${TIME_SECTION}.vertical_clock.title`)}
|
||||||
</option>
|
</option>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
|
|
|
@ -63,44 +63,64 @@ export default class TimeSettings extends PureComponent {
|
||||||
render() {
|
render() {
|
||||||
const weatherType = localStorage.getItem('weatherType');
|
const weatherType = localStorage.getItem('weatherType');
|
||||||
|
|
||||||
|
const WEATHER_SECTION = 'modals.main.settings.sections.weather';
|
||||||
|
|
||||||
|
const weatherOptions = [
|
||||||
|
{
|
||||||
|
name: 'weatherdescription',
|
||||||
|
textKey: `${WEATHER_SECTION}.extra_info.show_description`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'cloudiness',
|
||||||
|
textKey: `${WEATHER_SECTION}.extra_info.cloudiness`,
|
||||||
|
},
|
||||||
|
{ name: 'humidity', textKey: `${WEATHER_SECTION}.extra_info.humidity` },
|
||||||
|
{
|
||||||
|
name: 'visibility',
|
||||||
|
textKey: `${WEATHER_SECTION}.extra_info.visibility`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'windspeed',
|
||||||
|
textKey: `${WEATHER_SECTION}.extra_info.wind_speed`,
|
||||||
|
onChange: () => this.setState({ windSpeed: localStorage.getItem('windspeed') !== 'true' }),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'windDirection',
|
||||||
|
textKey: `${WEATHER_SECTION}.extra_info.wind_direction`,
|
||||||
|
disabled: this.state.windSpeed,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'atmosphericpressure',
|
||||||
|
textKey: `${WEATHER_SECTION}.extra_info.atmospheric_pressure`,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header
|
<Header
|
||||||
title={variables.getMessage('modals.main.settings.sections.weather.title')}
|
title={variables.getMessage(`${WEATHER_SECTION}.title`)}
|
||||||
setting="weatherEnabled"
|
setting="weatherEnabled"
|
||||||
category="widgets"
|
category="widgets"
|
||||||
zoomSetting="zoomWeather"
|
zoomSetting="zoomWeather"
|
||||||
zoomCategory="weather"
|
zoomCategory="weather"
|
||||||
switch={true}
|
switch={true}
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem title={variables.getMessage(`${WEATHER_SECTION}.widget_type`)}>
|
||||||
title={variables.getMessage('modals.main.settings.sections.weather.widget_type')}
|
|
||||||
>
|
|
||||||
<Dropdown
|
<Dropdown
|
||||||
label={variables.getMessage('modals.main.settings.sections.time.type')}
|
label={variables.getMessage('modals.main.settings.sections.time.type')}
|
||||||
name="weatherType"
|
name="weatherType"
|
||||||
category="weather"
|
category="weather"
|
||||||
onChange={() => this.forceUpdate()}
|
onChange={() => this.forceUpdate()}
|
||||||
>
|
>
|
||||||
<option value="1">
|
<option value="1">{variables.getMessage(`${WEATHER_SECTION}.options.basic`)}</option>
|
||||||
{variables.getMessage('modals.main.settings.sections.weather.options.basic')}
|
<option value="2">{variables.getMessage(`${WEATHER_SECTION}.options.standard`)}</option>
|
||||||
</option>
|
<option value="3">{variables.getMessage(`${WEATHER_SECTION}.options.expanded`)}</option>
|
||||||
<option value="2">
|
<option value="4">{variables.getMessage(`${WEATHER_SECTION}.options.custom`)}</option>
|
||||||
{variables.getMessage('modals.main.settings.sections.weather.options.standard')}
|
|
||||||
</option>
|
|
||||||
<option value="3">
|
|
||||||
{variables.getMessage('modals.main.settings.sections.weather.options.expanded')}
|
|
||||||
</option>
|
|
||||||
<option value="4">
|
|
||||||
{variables.getMessage('modals.main.settings.sections.weather.options.custom')}
|
|
||||||
</option>
|
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
<SettingsItem
|
<SettingsItem title={variables.getMessage(`${WEATHER_SECTION}.location`)}>
|
||||||
title={variables.getMessage('modals.main.settings.sections.weather.location')}
|
|
||||||
>
|
|
||||||
<TextField
|
<TextField
|
||||||
label={variables.getMessage('modals.main.settings.sections.weather.location')}
|
label={variables.getMessage(`${WEATHER_SECTION}.location`)}
|
||||||
value={this.state.location}
|
value={this.state.location}
|
||||||
onChange={(e) => this.changeLocation(e)}
|
onChange={(e) => this.changeLocation(e)}
|
||||||
placeholder="London"
|
placeholder="London"
|
||||||
|
@ -109,34 +129,26 @@ export default class TimeSettings extends PureComponent {
|
||||||
/>
|
/>
|
||||||
<span className="link" onClick={() => this.getAuto()}>
|
<span className="link" onClick={() => this.getAuto()}>
|
||||||
<MdAutoAwesome />
|
<MdAutoAwesome />
|
||||||
{variables.getMessage('modals.main.settings.sections.weather.auto')}
|
{variables.getMessage(`${WEATHER_SECTION}.auto`)}
|
||||||
</span>
|
</span>
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.sections.weather.temp_format.title')}
|
title={variables.getMessage(`${WEATHER_SECTION}.temp_format.title`)}
|
||||||
final={weatherType !== '4'}
|
final={weatherType !== '4'}
|
||||||
>
|
>
|
||||||
<Radio
|
<Radio
|
||||||
name="tempformat"
|
name="tempformat"
|
||||||
options={[
|
options={[
|
||||||
{
|
{
|
||||||
name:
|
name: variables.getMessage(`${WEATHER_SECTION}.temp_format.celsius`) + ' (°C)',
|
||||||
variables.getMessage(
|
|
||||||
'modals.main.settings.sections.weather.temp_format.celsius',
|
|
||||||
) + ' (°C)',
|
|
||||||
value: 'celsius',
|
value: 'celsius',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:
|
name: variables.getMessage(`${WEATHER_SECTION}.temp_format.fahrenheit`) + ' (°F)',
|
||||||
variables.getMessage(
|
|
||||||
'modals.main.settings.sections.weather.temp_format.fahrenheit',
|
|
||||||
) + ' (°F)',
|
|
||||||
value: 'fahrenheit',
|
value: 'fahrenheit',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:
|
name: variables.getMessage(`${WEATHER_SECTION}.temp_format.kelvin`) + ' (K)',
|
||||||
variables.getMessage('modals.main.settings.sections.weather.temp_format.kelvin') +
|
|
||||||
' (K)',
|
|
||||||
value: 'kelvin',
|
value: 'kelvin',
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
@ -145,64 +157,19 @@ export default class TimeSettings extends PureComponent {
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
{weatherType === '4' && (
|
{weatherType === '4' && (
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
title={variables.getMessage('modals.main.settings.sections.weather.custom_settings')}
|
title={variables.getMessage(`${WEATHER_SECTION}.custom_settings`)}
|
||||||
final={true}
|
final={true}
|
||||||
>
|
>
|
||||||
<Checkbox
|
{weatherOptions.map((item) => (
|
||||||
name="weatherdescription"
|
<Checkbox
|
||||||
text={variables.getMessage(
|
key={item.name}
|
||||||
'modals.main.settings.sections.weather.extra_info.show_description',
|
name={item.name}
|
||||||
)}
|
text={variables.getMessage(item.textKey)}
|
||||||
category="weather"
|
category="weather"
|
||||||
/>
|
onChange={item.onChange}
|
||||||
<Checkbox
|
disabled={item.disabled}
|
||||||
name="cloudiness"
|
/>
|
||||||
text={variables.getMessage(
|
))}
|
||||||
'modals.main.settings.sections.weather.extra_info.cloudiness',
|
|
||||||
)}
|
|
||||||
category="weather"
|
|
||||||
/>
|
|
||||||
<Checkbox
|
|
||||||
name="humidity"
|
|
||||||
text={variables.getMessage(
|
|
||||||
'modals.main.settings.sections.weather.extra_info.humidity',
|
|
||||||
)}
|
|
||||||
category="weather"
|
|
||||||
/>
|
|
||||||
<Checkbox
|
|
||||||
name="visibility"
|
|
||||||
text={variables.getMessage(
|
|
||||||
'modals.main.settings.sections.weather.extra_info.visibility',
|
|
||||||
)}
|
|
||||||
category="weather"
|
|
||||||
/>
|
|
||||||
<Checkbox
|
|
||||||
name="windspeed"
|
|
||||||
text={variables.getMessage(
|
|
||||||
'modals.main.settings.sections.weather.extra_info.wind_speed',
|
|
||||||
)}
|
|
||||||
category="weather"
|
|
||||||
onChange={() =>
|
|
||||||
this.setState({
|
|
||||||
windSpeed: localStorage.getItem('windspeed') !== 'true',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<Checkbox
|
|
||||||
name="windDirection"
|
|
||||||
text={variables.getMessage(
|
|
||||||
'modals.main.settings.sections.weather.extra_info.wind_direction',
|
|
||||||
)}
|
|
||||||
category="weather"
|
|
||||||
disabled={this.state.windSpeed}
|
|
||||||
/>
|
|
||||||
<Checkbox
|
|
||||||
name="atmosphericpressure"
|
|
||||||
text={variables.getMessage(
|
|
||||||
'modals.main.settings.sections.weather.extra_info.atmospheric_pressure',
|
|
||||||
)}
|
|
||||||
category="weather"
|
|
||||||
/>
|
|
||||||
</SettingsItem>
|
</SettingsItem>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in New Issue