From 8c1a9a05599c1e1b45992ab14fc391f89f34e63d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 26 Mar 2019 14:43:48 +0100 Subject: adding i18n framework --- app/client/common/header.component.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app/client/common/header.component.js') diff --git a/app/client/common/header.component.js b/app/client/common/header.component.js index 8450e8a..d55ec51 100644 --- a/app/client/common/header.component.js +++ b/app/client/common/header.component.js @@ -18,7 +18,7 @@ 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 @@ -26,7 +26,7 @@ function Header(props){ const tool = modules[app.tool] const links = tool.links().map((link,i) => { return ( - {link.name} + {i18n.header[link.name] || link.name} ) }) return ( @@ -45,8 +45,8 @@ function Header(props){ {tool_list} - system - dashboard + {i18n.header.system} + {i18n.header.dashboard} {links} {playing && {fps} fps} @@ -58,6 +58,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) => ({ -- cgit v1.2.3-70-g09d2 From 1eae3adac33a3299d6165e88f78336d4899618a3 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 29 Mar 2019 19:46:24 +0100 Subject: gray background on pyro --- app/client/common/header.component.js | 8 ++- app/client/i18n/i18n.en.js | 4 ++ app/client/i18n/i18n.moon.js | 99 -------------------------------- app/client/i18n/i18n.pyro.js | 104 ++++++++++++++++++++++++++++++++++ app/client/i18n/index.js | 8 +-- public/assets/css/css.css | 60 ++++++++++++++++++++ 6 files changed, 178 insertions(+), 105 deletions(-) delete mode 100644 app/client/i18n/i18n.moon.js create mode 100644 app/client/i18n/i18n.pyro.js (limited to 'app/client/common/header.component.js') diff --git a/app/client/common/header.component.js b/app/client/common/header.component.js index d55ec51..6b0c89b 100644 --- a/app/client/common/header.component.js +++ b/app/client/common/header.component.js @@ -21,7 +21,7 @@ function Header(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 + return }) const tool = modules[app.tool] const links = tool.links().map((link,i) => { @@ -29,9 +29,13 @@ function Header(props){ {i18n.header[link.name] || link.name} ) }) + 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 (
- {site.name} cortex + {site_title}