Skip to content

Commit

Permalink
Merge pull request #2691 from ever-co/stage
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Jul 7, 2024
2 parents 382d447 + 900eca5 commit 40cc062
Show file tree
Hide file tree
Showing 58 changed files with 1,675 additions and 481 deletions.
4 changes: 3 additions & 1 deletion apps/server-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
"i18next-electron-fs-backend": "^3.0.1",
"i18next-fs-backend": "^2.3.1",
"i18next-resources-to-backend": "^1.2.1",
"react-i18next": "^14.1.0"
"react-i18next": "^14.1.0",
"@radix-ui/react-switch": "^1.1.0",
"classnames": "^2.5.1"
},
"devDependencies": {
"electron": "28.1.0",
Expand Down
4 changes: 2 additions & 2 deletions apps/server-web/src/configs/i18n.mainconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const prependPath = app.isPackaged

i18n.use(backend).init({
backend: {
loadPath: prependPath + '/src/locales/{{lng}}/{{ns}}.json',
addPath: prependPath + '/src/locales/{{lng}}/{{ns}}.missing.json'
loadPath: prependPath + '/src/locales/i18n/{{lng}}/{{ns}}.json',
addPath: prependPath + '/src/locales/i18n/{{lng}}/{{ns}}.missing.json'
},
debug: false,
ns: 'translation',
Expand Down
7 changes: 5 additions & 2 deletions apps/server-web/src/configs/i18nResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import resourcesToBackend from 'i18next-resources-to-backend';

i18n
.use(
resourcesToBackend((language: string, namespace: string) => import(`../locales/${language}/${namespace}.json`))
resourcesToBackend((language: string, namespace: string) => import(`../locales/i18n/${language}/${namespace}.json`))
)
.init({
debug: true,
Expand All @@ -13,6 +13,9 @@ i18n
}
});
i18n.on('failedLoading', (lng, ns, msg) => console.error(msg))
i18n.languages = ['en', 'bg'];
i18n.languages = [
'en',
'bg',
];

export default i18n;
1 change: 0 additions & 1 deletion apps/server-web/src/locales/bg/translation.missing.json

This file was deleted.

38 changes: 0 additions & 38 deletions apps/server-web/src/locales/en/translation.json

This file was deleted.

6 changes: 0 additions & 6 deletions apps/server-web/src/locales/en/translation.missing.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"MENU": {
"SERVER": "сървър",
"UPDATER": "Актуализатор",
"UPDATER": "Актуализация",
"ABOUT": "относно",
"SERVER_START": "Започнете",
"SERVER_STOP": "Спри се",
Expand All @@ -16,7 +16,9 @@
"FIELDS": {
"PORT": "ПРИСТАНИЩЕ",
"GAUZY_API_SERVER_URL": "Gauzy API сървър Url",
"NEXT_PUBLIC_GAUZY_API_SERVER_URL": "Публичен Gauzy API сървър Url"
"NEXT_PUBLIC_GAUZY_API_SERVER_URL": "Публичен Gauzy API сървър Url",
"LANGUAGES": "Езици",
"OPTIONS": "Настроики"
},
"BUTTON": {
"SAVE_SETTING": "Запазване на настройката",
Expand All @@ -28,7 +30,19 @@
"QUIT_N_INSTALL": "Излезте и инсталирайте",
"UP_TO_DATE": "Актуална",
"UPDATE_AVAILABLE": "Налична актуализация",
"CHECK_FOR_UPDATE": "Проверка за актуализация"
"CHECK_FOR_UPDATE": "Проверка за актуализация",
"SERVER_CONFIG": "Конфигурация на сървъра",
"UPDATE_OPTIONS": {
"A_DAY": "Ден",
"A_HOURS": "A часа",
"3_HOURS": "3 часа",
"30_MINUTES": "30 минути"
},
"AUTO_UPDATE_TITLE": "Автоматична проверка на актуализацията",
"AUTO_UPDATE_SUBTITLE": "Активирайте автоматичната проверка на актуализацията, за да стартирате заявка за проверка дали е налична нова версия и да уведомите",
"AUTO_UPDATE_TOGLE": "Автоматична актуализация",
"CHECK_UPDATE_TITLE": "Проверете и актуализирайте версията на приложението си",
"CHECK_UPDATE_SUBTITLE": "Налична е нова актуализация! Моля, щракнете върху бутона Изтегляне сега по-долу."
}
},
"MESSAGE": {
Expand Down
15 changes: 15 additions & 0 deletions apps/server-web/src/locales/i18n/bg/translation.missing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"Status: Started": "Status: Started",
"Start": "Start",
"Stop": "Stop",
"Setting": "Setting",
"About": "About",
"Quit": "Quit",
"Статус: Спряна": "Статус: Спряна",
"Започнете": "Започнете",
"Спри се": "Спри се",
"Настройка": "Настройка",
"относно": "относно",
"Откажете се": "Откажете се",
"Status: Stopped": "Status: Stopped"
}
61 changes: 61 additions & 0 deletions apps/server-web/src/locales/i18n/en/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"MENU": {
"SERVER": "Server",
"UPDATER": "Update",
"ABOUT": "About",
"SERVER_START": "Start",
"SERVER_STOP": "Stop",
"APP_SETTING": "Setting",
"APP_ABOUT": "About",
"APP_QUIT": "Quit",
"GENERAL": "General",
"SERVER_STATUS_STOPPED": "Status: Stopped",
"SERVER_STATUS_STARTED": "Status: Started"
},
"FORM": {
"FIELDS": {
"PORT": "PORT",
"GAUZY_API_SERVER_URL": "Gauzy API Server Url",
"NEXT_PUBLIC_GAUZY_API_SERVER_URL": "Public Gauzy API Server Url",
"LANGUAGES": "Languages",
"OPTIONS": "Options"
},
"BUTTON": {
"SAVE_SETTING": "Save Setting",
"OK": "OK",
"YES": "Yes",
"NO": "No",
"DOWNLOAD_NOW": "Download Now",
"LATER": "Later",
"CANCEL": "Cancel"
},
"LABELS": {
"CHECKING": "Checking",
"DOWNLOADING": "Downloading",
"QUIT_N_INSTALL": "Quit and Install",
"UP_TO_DATE": "Up to date",
"UPDATE_AVAILABLE": "Update Available",
"CHECK_FOR_UPDATE": "Check For Update",
"SERVER_CONFIG": "Server Configuration",
"UPDATE_OPTIONS": {
"A_DAY": "A Day",
"A_HOURS": "A Hours",
"3_HOURS": "30 Hours",
"30_MINUTES": "30 Minutes"
},
"AUTO_UPDATE_TITLE": "Automatic Update Check",
"AUTO_UPDATE_SUBTITLE": "Enable automatice update check, in order to run a request to check if new version is available and notify",
"AUTO_UPDATE_TOGLE": "Automatic Update",
"CHECK_UPDATE_TITLE": "Check & Update your app version",
"CHECK_UPDATE_SUBTITLE": "New Update is available! Please click button Download Now below."
}
},
"MESSAGE": {
"SUCCESS": "Success",
"ERROR": "Error",
"WARNING": "Warning",
"INFO": "Info",
"UPDATE_AVAILABLE": "New Update is available! Please click button Download Now below.",
"EXIT_MESSAGE": "Server web still running, Are you sure to exit the app ?"
}
}
19 changes: 19 additions & 0 deletions apps/server-web/src/locales/i18n/en/translation.missing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"MENU": {
"STATUS": "MENU.STATUS",
"STOPPED": "MENU.STOPPED"
},
"SERVER_STATUS_STOPPED": "SERVER_STATUS_STOPPED",
"Статус: Спряна": "Статус: Спряна",
"Започнете": "Започнете",
"Спри се": "Спри се",
"Настройка": "Настройка",
"относно": "относно",
"Откажете се": "Откажете се",
"Status: Stopped": "Status: Stopped",
"Start": "Start",
"Stop": "Stop",
"Setting": "Setting",
"About": "About",
"Quit": "Quit"
}
59 changes: 31 additions & 28 deletions apps/server-web/src/main/helpers/constant.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
export const EventLists = {
webServerStarted: 'WEB_SERVER_STARTED',
webServerStopped: 'WEB_SERVER_STOPPED',
webServerStart: 'WEB_SERVER_START',
webServerStop: 'WEB_SERVER_STOP',
gotoSetting: 'GO_TO_SETTING',
gotoAbout: 'GO_TO_ABOUT',
UPDATE_AVAILABLE: 'UPDATE_AVAILABLE',
UPDATE_ERROR: 'UPDATE_ERROR',
UPDATE_NOT_AVAILABLE: 'UPDATE_NOT_AVAILABLE',
UPDATE_PROGRESS: 'UPDATE_PROGRESS',
UPDATE_DOWNLOADED: 'UPDATE_DOWNLOADED',
UPDATE_CANCELLED: 'UPDATE_CANCELLED',
CHANGE_LANGUAGE: 'CHANGE_LANGUAGE'
}
webServerStarted: 'WEB_SERVER_STARTED',
webServerStopped: 'WEB_SERVER_STOPPED',
webServerStart: 'WEB_SERVER_START',
webServerStop: 'WEB_SERVER_STOP',
gotoSetting: 'GO_TO_SETTING',
gotoAbout: 'GO_TO_ABOUT',
UPDATE_AVAILABLE: 'UPDATE_AVAILABLE',
UPDATE_ERROR: 'UPDATE_ERROR',
UPDATE_NOT_AVAILABLE: 'UPDATE_NOT_AVAILABLE',
UPDATE_PROGRESS: 'UPDATE_PROGRESS',
UPDATE_DOWNLOADED: 'UPDATE_DOWNLOADED',
UPDATE_CANCELLED: 'UPDATE_CANCELLED',
CHANGE_LANGUAGE: 'CHANGE_LANGUAGE'
}

export const SettingPageTypeMessage = {
loadSetting: 'load-setting',
checkUpdate: 'check-for-update',
updateAvailable: 'update-available',
downloadingUpdate: 'downloading-update',
downloaded: 'downloaded-update',
installUpdate: 'install-update',
saveSetting: 'save-setting',
updateError: 'update-error',
upToDate: 'up-to-date',
mainResponse: 'main-response',
showVersion: 'show-version',
selectMenu: 'select-menu',
langChange: 'lang'
export const SettingPageTypeMessage = {
loadSetting: 'load-setting',
checkUpdate: 'check-for-update',
updateAvailable: 'update-available',
downloadingUpdate: 'downloading-update',
downloaded: 'downloaded-update',
installUpdate: 'install-update',
saveSetting: 'save-setting',
updateError: 'update-error',
upToDate: 'up-to-date',
mainResponse: 'main-response',
showVersion: 'show-version',
selectMenu: 'select-menu',
langChange: 'lang',
updateSetting: 'update-setting',
updateSettingResponse: 'update-setting-response',
updateCancel: 'update-cancel'
}
2 changes: 1 addition & 1 deletion apps/server-web/src/main/helpers/desktop-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export enum ServerState {
export class DesktopServer {
private state: ServerState = ServerState.STOPPED;
private stateObserver: Observer<ServerState, void>;
private eventEmitter:EventEmitter;
private eventEmitter: EventEmitter;
constructor(private readonly isOnlyApiServer = false, eventEmitter: EventEmitter) {
// super();

Expand Down
4 changes: 3 additions & 1 deletion apps/server-web/src/main/helpers/interfaces/i-server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
interface GeneralConfig {
lang: string
lang?: string
autoUpdate?: boolean
updateCheckPeriode?: string
[key: string]: any
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export const LocalStore = {
let config: WebServer | any = store.get('config');
Object.keys(values).forEach((key: string) => {
if (key === 'server') {
config[key] = {...config[key], ...values.server }
config[key] = { ...config[key], ...values.server }
}

if (key === 'general') {
config[key] = {...config[key], ...values.general }
config[key] = { ...config[key], ...values.general }
}
})
store.set({
Expand All @@ -33,7 +33,9 @@ export const LocalStore = {
NEXT_PUBLIC_GAUZY_API_SERVER_URL: 'http://localhost:3000'
},
general: {
lang: 'en'
lang: 'en',
autoUpdate: true,
updateCheckPeriode: '30'
}
}
store.set({ config });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export abstract class ServerTask {
if (this.eventEmmitter) {
this.eventEmmitter.emit(EventLists.webServerStarted);
}
this.config.setting = { server: { ...this.config.setting.server ,[this.pid]: service.pid } };
this.config.setting = { server: { ...this.config.setting.server, [this.pid]: service.pid } };
} catch (error) {
console.error('Error running task:', error);
this.handleError(error);
Expand Down
2 changes: 1 addition & 1 deletion apps/server-web/src/main/helpers/services/web-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class WebService extends ServerTask {
const args = { ...env, serviceName: 'WebServer' };

// Note: do not change this prefix because we may use it to detect the success message from the running server!
const successMessage = 'Listening at http';
const successMessage = 'Starting...';

const errorMessage = 'Error running API server:';

Expand Down
Loading

0 comments on commit 40cc062

Please sign in to comment.