mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-24 08:29:14 +00:00
fix: bundle translations
This commit is contained in:
committed by
Carlos Valente
parent
8d2d8ef979
commit
ec1df8b958
@@ -34,6 +34,10 @@ e2e/tests/fixtures/tmp/*
|
|||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
|
# bundled assets
|
||||||
|
translations.json
|
||||||
|
override.css
|
||||||
|
|
||||||
# working stuff
|
# working stuff
|
||||||
**/TODO.md
|
**/TODO.md
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,8 @@
|
|||||||
"from": "../server/src/user/",
|
"from": "../server/src/user/",
|
||||||
"to": "extraResources/user/",
|
"to": "extraResources/user/",
|
||||||
"filter": [
|
"filter": [
|
||||||
"**/*"
|
"**/*",
|
||||||
|
"*{.ts}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { existsSync } from 'fs';
|
|
||||||
import { writeFile } from 'node:fs/promises';
|
import { writeFile } from 'node:fs/promises';
|
||||||
import { defaultCss } from '../src/user/styles/bundledCss';
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
|
import { defaultCss } from '../src/user/styles/bundledCss';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Script to write contents of bundledCss to override.css
|
* Script to write contents of bundledCss to override.css
|
||||||
*/
|
*/
|
||||||
@@ -11,10 +11,6 @@ async function bundleCss() {
|
|||||||
const stylesDir = path.resolve(process.cwd(), 'src', 'user', 'styles');
|
const stylesDir = path.resolve(process.cwd(), 'src', 'user', 'styles');
|
||||||
const cssFile = path.resolve(stylesDir, 'override.css');
|
const cssFile = path.resolve(stylesDir, 'override.css');
|
||||||
|
|
||||||
if (!existsSync(cssFile)) {
|
|
||||||
throw new Error('File does not exist');
|
|
||||||
}
|
|
||||||
|
|
||||||
await writeFile(cssFile, defaultCss, { encoding: 'utf8' });
|
await writeFile(cssFile, defaultCss, { encoding: 'utf8' });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed writing to CSS file: ', error);
|
console.error('Failed writing to CSS file: ', error);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { existsSync } from 'fs';
|
|
||||||
import { writeFile } from 'node:fs/promises';
|
import { writeFile } from 'node:fs/promises';
|
||||||
import { defaultTranslation } from '../src/user/translations/bundledTranslation';
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
|
import { defaultTranslation } from '../src/user/translations/bundledTranslations.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Script to write contents of default translation to translation.json
|
* Script to write contents of default translation to translation.json
|
||||||
*/
|
*/
|
||||||
@@ -11,10 +11,6 @@ async function bundleTranslation() {
|
|||||||
const translationDir = path.resolve(process.cwd(), 'src', 'user', 'translations');
|
const translationDir = path.resolve(process.cwd(), 'src', 'user', 'translations');
|
||||||
const translationsFile = path.resolve(translationDir, 'translations.json');
|
const translationsFile = path.resolve(translationDir, 'translations.json');
|
||||||
|
|
||||||
if (!existsSync(translationsFile)) {
|
|
||||||
throw new Error('File does not exist');
|
|
||||||
}
|
|
||||||
|
|
||||||
await writeFile(translationsFile, defaultTranslation, { encoding: 'utf8' });
|
await writeFile(translationsFile, defaultTranslation, { encoding: 'utf8' });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed writing to translations file: ', error);
|
console.error('Failed writing to translations file: ', error);
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ export function getAppDataPath(): string {
|
|||||||
* │ │ ├─ override.css
|
* │ │ ├─ override.css
|
||||||
* │ ├─ logo/
|
* │ ├─ logo/
|
||||||
* │ │ ├─ logo.png
|
* │ │ ├─ logo.png
|
||||||
|
* │ ├─ translations/
|
||||||
|
* │ │ ├─ translations.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** resolve file URL in both CJS and ESM (build and dev) */
|
/** resolve file URL in both CJS and ESM (build and dev) */
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
|
|
||||||
/**
|
|
||||||
* This CSS file allows user customisation of the UI
|
|
||||||
* We expose some CSS properties to facilitate this (see below in :root)
|
|
||||||
* In the cases where this is missing, you can add your selectors here
|
|
||||||
*/
|
|
||||||
|
|
||||||
:root {
|
|
||||||
/** Background colour for the views */
|
|
||||||
--background-color-override: #ececec;
|
|
||||||
|
|
||||||
/** Main text colour for the views */
|
|
||||||
--color-override: #101010;
|
|
||||||
|
|
||||||
/** Text colour for the views */
|
|
||||||
--secondary-color-override: #404040;
|
|
||||||
|
|
||||||
/** Accent text colour, used on active elements */
|
|
||||||
--accent-color-override: #fa5656;
|
|
||||||
|
|
||||||
/** Label text colour, used on active elements */
|
|
||||||
--label-color-override: #6c6c6c;
|
|
||||||
|
|
||||||
/** Timer text colour */
|
|
||||||
--timer-color-override: #202020;
|
|
||||||
--timer-warning-color-override: #ffbc56;
|
|
||||||
--timer-danger-color-override: #e69000;
|
|
||||||
--timer-overtime-color-override: #fa5656;
|
|
||||||
--timer-pending-color-override: #578AF4;
|
|
||||||
|
|
||||||
/** Background for card elements on background */
|
|
||||||
--card-background-color-override: #fff;
|
|
||||||
|
|
||||||
/** Font used for all text in views */
|
|
||||||
--font-family-override: 'Open Sans';
|
|
||||||
|
|
||||||
/** Colour used for external message and aux timer in /timer */
|
|
||||||
--external-color-override: #161616;
|
|
||||||
|
|
||||||
/** View specific features: /backstage */
|
|
||||||
/** ---- Background highlight for blink behaviour */
|
|
||||||
--card-background-color-blink-override: #339e4e;
|
|
||||||
/** ---- Colour used for progress bar background */
|
|
||||||
--timer-progress-bg-override: #fff;
|
|
||||||
/** ---- Colour used for progress bar progress */
|
|
||||||
--timer-progress-override: #202020;
|
|
||||||
|
|
||||||
/** View specific features: /op */
|
|
||||||
--operator-customfield-font-size-override: 1.25rem;
|
|
||||||
--operator-running-bg-override: #339e4e;
|
|
||||||
|
|
||||||
/** View specific features: /studio */
|
|
||||||
--studio-active: #101010;
|
|
||||||
--studio-idle: #cfcfcf;
|
|
||||||
--studio-active-label: #101010;
|
|
||||||
--studio-idle-label: #595959;
|
|
||||||
--studio-overtime: #101010;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* You can inspect the page in your browser and add the selectors here.
|
|
||||||
* In the below example, we change the colour of the overlay message in the stage-timer view.
|
|
||||||
*/
|
|
||||||
.stage-timer > .message-overlay--active > div {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user