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/i18n/i18n.en.js | 99 ++++++++++++++++++++++++++++++++++++++++++++ app/client/i18n/i18n.moon.js | 99 ++++++++++++++++++++++++++++++++++++++++++++ app/client/i18n/index.js | 15 +++++++ 3 files changed, 213 insertions(+) create mode 100644 app/client/i18n/i18n.en.js create mode 100644 app/client/i18n/i18n.moon.js create mode 100644 app/client/i18n/index.js (limited to 'app/client/i18n') diff --git a/app/client/i18n/i18n.en.js b/app/client/i18n/i18n.en.js new file mode 100644 index 0000000..406afa6 --- /dev/null +++ b/app/client/i18n/i18n.en.js @@ -0,0 +1,99 @@ +export default { + header: { + system: "system", + dashboard: "dashboard", + folders: "folders", + sequences: "sequences", + checkpoints: "checkpoints", + results: "results", + uprez: "uprez", + live: "live", + pix2pixhd: "pix2pixhd", + pix2pix: "pix2pix", + pix2wav: "pix2wav", + samplernn: "samplernn", + morph: "morph", + }, + gpu: { + idle: "GPU Idle", + busy: "GPU Busy", + start: "Start", + restart: "Restart", + stop: "Stop", + interrupt: "Interrupt", + not_processing: "Not Processing", + processing: "Processing", + }, + pix2pixhd: { + live: { + network: { + title: "Network", + view_mode: "view mode", + sequence: "sequence", + checkpoint: "checkpoint", + epoch: "epoch", + }, + playback: { + title: "Playback", + position: "position", + playback_rate: "playback rate", + skip_frames: "skip frames", + fade_sequence: "fade sequence", + frame_delay: "frame delay", + }, + record: { + save_frame: "Save frame", + save: "Save", + record_video: "Record video", + video_name: "Video name", + }, + transition: { + title: "Transition", + period: "period", + min: "min", + max: "max", + }, + recursion: { + title: "Recursion", + frac: "recursive amount", + roll: "roll amount", + axis: "roll axis", + }, + sequence: { + title: "Sequence", + frac: "sequence frac", + process_frac: "process frac", + }, + transform: { + title: "Transform", + rotate: "rotate", + scale: "scale", + }, + clahe: { + title: "Clahe", + clip_limit: "clip limit", + }, + posterize: { + title: "Posterize", + spatial_window: "spatial window", + color_window: "color window", + }, + blur: { + title: "Blur", + radius: "radius", + sigma: "sigma", + }, + canny: { + title: "Canny Edge Detection", + lo: "lower bound", + hi: "upper bound", + }, + hsl: { + title: "Hue / Saturation", + hue: "hue", + saturation: "saturation", + luminosity: "luminosity", + } + } + } +} diff --git a/app/client/i18n/i18n.moon.js b/app/client/i18n/i18n.moon.js new file mode 100644 index 0000000..930c831 --- /dev/null +++ b/app/client/i18n/i18n.moon.js @@ -0,0 +1,99 @@ +export default { + header: { + system: "system", + dashboard: "dashboard", + folders: "folders", + sequences: "sequences", + checkpoints: "checkpoints", + results: "results", + uprez: "uprez", + live: "live", + pix2pixhd: "pix2pixhd", + pix2pix: "pix2pix", + pix2wav: "pix2wav", + samplernn: "samplernn", + morph: "morph", + }, + gpu: { + idle: "GPU Idle", + busy: "GPU Busy", + start: "Start", + restart: "Restart", + stop: "Stop", + interrupt: "Interrupt", + not_processing: "Not Processing", + processing: "Processing", + }, + pix2pixhd: { + live: { + network: { + title: "Mumbo Jumbo", + view_mode: "bollocks", + sequence: "mess", + checkpoint: "skew", + epoch: "REACTIONARY REGRESSION", + }, + playback: { + title: "Divine", + position: "accelerationism", + playback_rate: "apocalypticism", + skip_frames: "pretend there is an emergent phenomenon", + fade_sequence: "speaking in tongues", + frame_delay: "babble", + }, + record: { + save_frame: "PYROMANCE DISCOUNT", + save: "Save", + record_video: "Pyromance Premium", + video_name: "Video name", + }, + transition: { + title: "Enlightenment", + period: "endarkenment", + min: "MONTECARLOCASINO", + max: "RANDOM STUMBLE", + }, + recursion: { + title: "Proprietary button", + frac: "pay $5M to change this", + roll: "pay $5M and still nothing happens", + axis: "When will I die?", + }, + sequence: { + title: "Political thermometer", + frac: "ignition", + process_frac: "wealth coefficient", + }, + transform: { + title: "Hate", + rotate: "0,14 factor", + scale: "Ariernachweis", + }, + clahe: { + title: "Clahe", + clip_limit: "clip limit", + }, + posterize: { + title: "Posterize", + spatial_window: "spatial window", + color_window: "color window", + }, + blur: { + title: "Blur", + radius: "radius", + sigma: "sigma", + }, + canny: { + title: "Canny Edge Detection", + lo: "lower bound", + hi: "upper bound", + }, + hsl: { + title: "Hue / Saturation", + hue: "hue", + saturation: "saturation", + luminosity: "luminosity", + } + } + } +} diff --git a/app/client/i18n/index.js b/app/client/i18n/index.js new file mode 100644 index 0000000..2bdde02 --- /dev/null +++ b/app/client/i18n/index.js @@ -0,0 +1,15 @@ +import en from './i18n.en' +import moon from './i18n.moon' + +const strings = lang => { + switch (lang) { + case 'moon': + return moon + default: + return en + } +} + +const languages = ['en', 'moon'] + +export { strings, languages } -- 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/i18n') 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}