|
@ -15,6 +15,8 @@ import sortBy from 'lodash/fp/sortBy' |
|
|
import chunk from 'lodash/chunk' |
|
|
import chunk from 'lodash/chunk' |
|
|
import styled from 'styled-components' |
|
|
import styled from 'styled-components' |
|
|
import color from 'color' |
|
|
import color from 'color' |
|
|
|
|
|
import fs from 'fs' |
|
|
|
|
|
import path from 'path' |
|
|
|
|
|
|
|
|
import Box from 'components/base/Box' |
|
|
import Box from 'components/base/Box' |
|
|
import Bar from 'components/base/Bar' |
|
|
import Bar from 'components/base/Bar' |
|
@ -23,6 +25,9 @@ import { ChartWrapper } from 'components/base/Chart' |
|
|
|
|
|
|
|
|
import theme from 'styles/theme' |
|
|
import theme from 'styles/theme' |
|
|
|
|
|
|
|
|
|
|
|
const getLanguages = p => fs.readdirSync(p).filter(f => fs.statSync(path.join(p, f)).isDirectory()) |
|
|
|
|
|
const languages = getLanguages(path.join(__static, './i18n')) |
|
|
|
|
|
|
|
|
const mainWindow = remote.BrowserWindow.getAllWindows().find(w => w.name === 'MainWindow') |
|
|
const mainWindow = remote.BrowserWindow.getAllWindows().find(w => w.name === 'MainWindow') |
|
|
|
|
|
|
|
|
type HslColor = { |
|
|
type HslColor = { |
|
@ -149,14 +154,13 @@ class DevToolbar extends PureComponent<any, State> { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
render() { |
|
|
render() { |
|
|
const { i18n } = this.props |
|
|
|
|
|
const { cpuUsage } = this.state |
|
|
const { cpuUsage } = this.state |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<Container> |
|
|
<Container> |
|
|
<Box grow flow={4}> |
|
|
<Box grow flow={4}> |
|
|
<Section title="Languages" horizontal> |
|
|
<Section title="Languages" horizontal> |
|
|
{Object.keys(i18n.store.data).map(lang => ( |
|
|
{languages.map(lang => ( |
|
|
<Item key={lang} onClick={this.handleChangeLanguage(lang)} style={{ flex: 0 }}> |
|
|
<Item key={lang} onClick={this.handleChangeLanguage(lang)} style={{ flex: 0 }}> |
|
|
{lang} |
|
|
{lang} |
|
|
</Item> |
|
|
</Item> |
|
|