summaryrefslogtreecommitdiff
path: root/app/client/common
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/common')
-rw-r--r--app/client/common/fileList.component.js8
-rw-r--r--app/client/common/header.component.js17
2 files changed, 16 insertions, 9 deletions
diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js
index 12f6865..c4da4d7 100644
--- a/app/client/common/fileList.component.js
+++ b/app/client/common/fileList.component.js
@@ -17,7 +17,8 @@ export const FileList = props => {
orderBy='name asc',
className='',
fileListClassName='filelist',
- rowClassName='row file'
+ rowClassName='row file',
+ options,
} = props
const { mapFn, sortFn } = util.sort.orderByFn(orderBy)
let sortedFiles = (files || [])
@@ -36,6 +37,7 @@ export const FileList = props => {
linkFiles={linkFiles}
onDelete={onDelete}
onClick={onClick}
+ options={options}
/>
})
if (!fileList || !fileList.length) {
@@ -73,7 +75,7 @@ export const FileList = props => {
}
export const FileRow = props => {
- const { file, linkFiles, onDelete, onClick, className='row file', username='' } = props
+ const { file, linkFiles, onDelete, onClick, className='row file', username='', options } = props
const fields = fieldSet(props.fields)
const size = util.hush_size(file.size)
@@ -146,7 +148,7 @@ export const FileRow = props => {
{fields.has('delete') && onDelete && file.id &&
<div className='destroy' onClick={(e) => onDelete(file)}>x</div>
}
- {props.options && props.options(file)}
+ {options && props.options(file)}
</div>
)
}
diff --git a/app/client/common/header.component.js b/app/client/common/header.component.js
index 8450e8a..6b0c89b 100644
--- a/app/client/common/header.component.js
+++ b/app/client/common/header.component.js
@@ -18,20 +18,24 @@ function NavLink(props){
}
function Header(props){
- const { site, app, fps, playing, actions, location, history } = props
+ const { site, app, fps, playing, actions, location, history, i18n } = props
const tool_list = Object.keys(modules).map((name, i) => {
const label = name.replace(/_/, " ")
- return <option value={name} key={i}>{label}</option>
+ return <option value={name} key={i}>{i18n.header[label] || label}</option>
})
const tool = modules[app.tool]
const links = tool.links().map((link,i) => {
return (
- <NavLink key={i} location={location} to={link.url}>{link.name}</NavLink>
+ <NavLink key={i} location={location} to={link.url}>{i18n.header[link.name] || link.name}</NavLink>
)
})
+ const site_title = i18n.header.site_name || (site.name + " cortex")
+ document.querySelector('title').innerHTML = site_title
+ document.body.parentNode.setAttribute('lang', i18n.language)
+ document.body.setAttribute('section', location.pathname.replace(/[0-9]/g, '').replace(/\//g, '_').replace(/^_/, '').replace(/_$/, ''))
return (
<header>
- <span><b>{site.name} cortex</b></span>
+ <span><b>{site_title}</b></span>
<span>
<select onChange={e => {
let path = window.location.pathname.split("/")
@@ -45,8 +49,8 @@ function Header(props){
{tool_list}
</select>
</span>
- <NavLink location={location} to="/system">system</NavLink>
- <NavLink location={location} to="/dashboard">dashboard</NavLink>
+ <NavLink location={location} to="/system">{i18n.header.system}</NavLink>
+ <NavLink location={location} to="/dashboard">{i18n.header.dashboard}</NavLink>
<span>{links}</span>
{playing && <span>{fps} fps</span>}
</header>
@@ -58,6 +62,7 @@ const mapStateToProps = state => ({
app: state.system.app,
fps: state.live.fps,
playing: state.live.playing,
+ i18n: state.system.i18n.strings,
})
const mapDispatchToProps = (dispatch, ownProps) => ({