diff --git a/webapp/packages/core-localization/src/locales/en.ts b/webapp/packages/core-localization/src/locales/en.ts index 014ef9deba..69df35fc72 100644 --- a/webapp/packages/core-localization/src/locales/en.ts +++ b/webapp/packages/core-localization/src/locales/en.ts @@ -1,33 +1,5 @@ export const defaultENLocale = [ ['name', 'en'], - ['customConnection_connectionType_custom', 'Parameters'], - ['customConnection_connectionType_url', 'URL'], - ['customConnection_options', 'Options'], - ['customConnection_properties', 'Driver Properties'], - ['customConnection_custom_host', 'Host'], - ['customConnection_custom_obligatory', '(obligatory)'], - ['customConnection_custom_port', 'Port'], - ['customConnection_custom_database', 'Database'], - ['customConnection_custom_server', 'Server'], - ['customConnection_url_JDBC', 'JDBC URL'], - ['customConnection_userName', 'User name'], - ['customConnection_Password', 'Password'], - ['customConnection_test', 'Test Connection'], - ['customConnection_create', 'Create'], - ['data_transfer_dialog_title', 'Export data'], - ['data_transfer_dialog_export', 'Export'], - ['data_transfer_dialog_configuration_title', 'Export configuration'], - ['data_transfer_dialog_preparation', 'We prepare your file for export. Please wait...'], - ['data_transfer_notification_preparation', 'We prepare your file for download. Please wait...'], - ['data_transfer_notification_ready', 'File ready to download'], - ['data_transfer_notification_error', 'Preparation failed or canceled'], - ['data_transfer_notification_download', 'Download'], - ['data_transfer_notification_delete', 'Delete'], - ['data_transfer_exporting_table', 'Table:'], - ['data_transfer_exporting_sql', 'SQL:'], - ['authentication_login_dialog_title', 'Authentication'], - ['authentication_login', 'Login'], - ['authentication_logout', 'Logout'], ['ui_stepper_back', 'Back'], ['ui_processing_loading', 'Loading...'], ['ui_processing_cancel', 'Cancel'], @@ -56,7 +28,6 @@ export const defaultENLocale = [ ['app_shared_settingsMenu_lang', 'Language'], ['app_navigationTree_openNodeTab', 'Open'], ['app_navigationTree_refreshNode', 'Refresh'], - ['core_eventsLog_dbeaverErrorDetails', 'Error details'], ['app_shared_inlineEditor_dialog_title', 'Edit mode'], ['app_shared_inlineEditor_dialog_apply', 'Apply'], ['app_shared_inlineEditor_dialog_cancel', 'Cancel'], @@ -65,4 +36,5 @@ export const defaultENLocale = [ ['app_log_view_entry_timestamp', 'Timestamp'], ['app_log_view_entry_message', 'Message'], ['app_log_view_entry_details', 'Details'], + ['core_eventsLog_dbeaverErrorDetails', 'Error details'], ]; diff --git a/webapp/packages/core-localization/src/locales/ru.ts b/webapp/packages/core-localization/src/locales/ru.ts index e9661a4c07..8f6b7edda1 100644 --- a/webapp/packages/core-localization/src/locales/ru.ts +++ b/webapp/packages/core-localization/src/locales/ru.ts @@ -1,33 +1,5 @@ export const defaultRULocale = [ ['name', 'ru'], - ['customConnection_connectionType_custom', 'Параметры'], - ['customConnection_connectionType_url', 'URL'], - ['customConnection_options', 'Подключение'], - ['customConnection_properties', 'Параметры драйвера'], - ['customConnection_custom_host', 'Хост'], - ['customConnection_custom_obligatory', '(обязательное)'], - ['customConnection_custom_port', 'Порт'], - ['customConnection_custom_database', 'База'], - ['customConnection_custom_server', 'Сервер'], - ['customConnection_url_JDBC', 'JDBC URL'], - ['customConnection_userName', 'Пользователь'], - ['customConnection_Password', 'Пароль'], - ['customConnection_test', 'Проверить'], - ['customConnection_create', 'Создать'], - ['data_transfer_dialog_title', 'Экспорт данных'], - ['data_transfer_dialog_export', 'Экспортировать'], - ['data_transfer_dialog_configuration_title', 'Настройка экспорта'], - ['data_transfer_dialog_preparation', 'Подготавливаем файл к экспорту. Пожалуйста подождите...'], - ['data_transfer_notification_preparation', 'Подготавливаем файл к загрузке. Пожалуйста подождите...'], - ['data_transfer_notification_ready', 'Файл готов к загрузке'], - ['data_transfer_notification_error', 'Подготовка файла к загрузке не удалась или была отменена'], - ['data_transfer_notification_download', 'Загрузить'], - ['data_transfer_notification_delete', 'Удалить'], - ['data_transfer_exporting_table', 'Таблица:'], - ['data_transfer_exporting_sql', 'SQL:'], - ['authentication_login_dialog_title', 'Авторизация'], - ['authentication_login', 'Войти'], - ['authentication_logout', 'Выйти'], ['ui_stepper_back', 'Назад'], ['ui_processing_loading', 'Загрузка...'], ['ui_processing_cancel', 'Отменить'], @@ -56,7 +28,6 @@ export const defaultRULocale = [ ['app_shared_settingsMenu_lang', 'Язык'], ['app_navigationTree_openNodeTab', 'Открыть'], ['app_navigationTree_refreshNode', 'Обновить'], - ['core_eventsLog_dbeaverErrorDetails', 'Детали ошибки'], ['app_shared_inlineEditor_dialog_title', 'Редактирование'], ['app_shared_inlineEditor_dialog_apply', 'Применить'], ['app_shared_inlineEditor_dialog_cancel', 'Отменить'], @@ -65,4 +36,5 @@ export const defaultRULocale = [ ['app_log_view_entry_timestamp', 'Время'], ['app_log_view_entry_message', 'Сообщение'], ['app_log_view_entry_details', 'Детали'], + ['core_eventsLog_dbeaverErrorDetails', 'Детали ошибки'], ]; diff --git a/webapp/packages/plugin-authentication/src/locales/en.ts b/webapp/packages/plugin-authentication/src/locales/en.ts index 267213219d..aef167ef58 100644 --- a/webapp/packages/plugin-authentication/src/locales/en.ts +++ b/webapp/packages/plugin-authentication/src/locales/en.ts @@ -1,4 +1,7 @@ export default [ + ['authentication_login_dialog_title', 'Authentication'], + ['authentication_login', 'Login'], + ['authentication_logout', 'Logout'], ['authentication_administration_item', 'Users'], ['authentication_administration_confirm_user_deletion', 'Confirm user deletion'], ['authentication_create_user_dialog_title', 'Create new user'], diff --git a/webapp/packages/plugin-authentication/src/locales/ru.ts b/webapp/packages/plugin-authentication/src/locales/ru.ts index 46c635a5f5..f2ba33e116 100644 --- a/webapp/packages/plugin-authentication/src/locales/ru.ts +++ b/webapp/packages/plugin-authentication/src/locales/ru.ts @@ -1,4 +1,7 @@ export default [ + ['authentication_login_dialog_title', 'Авторизация'], + ['authentication_login', 'Войти'], + ['authentication_logout', 'Выйти'], ['authentication_administration_item', 'Пользователи'], ['authentication_create_user_dialog_title', 'Создание нового пользователя'], ['authentication_create_user_dialog_create', 'Создать'], diff --git a/webapp/packages/plugin-connection-custom/src/LocaleService.ts b/webapp/packages/plugin-connection-custom/src/LocaleService.ts new file mode 100644 index 0000000000..63ab3fb719 --- /dev/null +++ b/webapp/packages/plugin-connection-custom/src/LocaleService.ts @@ -0,0 +1,32 @@ +/* + * cloudbeaver - Cloud Database Manager + * Copyright (C) 2020 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0. + * you may not use this file except in compliance with the License. + */ + +import { Bootstrap, injectable } from '@cloudbeaver/core-di'; +import { LocalizationService } from '@cloudbeaver/core-localization'; + +@injectable() +export class LocaleService extends Bootstrap { + constructor(private localizationService: LocalizationService) { + super(); + } + + register(): void | Promise { + this.localizationService.addProvider(this.provider.bind(this)); + } + + load(): void | Promise { } + + private async provider(locale: string) { + switch (locale) { + case 'ru': + return (await import('./locales/ru')).default; + default: + return (await import('./locales/en')).default; + } + } +} diff --git a/webapp/packages/plugin-connection-custom/src/locales/en.ts b/webapp/packages/plugin-connection-custom/src/locales/en.ts new file mode 100644 index 0000000000..9ecc459d58 --- /dev/null +++ b/webapp/packages/plugin-connection-custom/src/locales/en.ts @@ -0,0 +1,16 @@ +export default [ + ['customConnection_connectionType_custom', 'Parameters'], + ['customConnection_connectionType_url', 'URL'], + ['customConnection_options', 'Options'], + ['customConnection_properties', 'Driver Properties'], + ['customConnection_custom_host', 'Host'], + ['customConnection_custom_obligatory', '(obligatory)'], + ['customConnection_custom_port', 'Port'], + ['customConnection_custom_database', 'Database'], + ['customConnection_custom_server', 'Server'], + ['customConnection_url_JDBC', 'JDBC URL'], + ['customConnection_userName', 'User name'], + ['customConnection_Password', 'Password'], + ['customConnection_test', 'Test Connection'], + ['customConnection_create', 'Create'], +]; diff --git a/webapp/packages/plugin-connection-custom/src/locales/ru.ts b/webapp/packages/plugin-connection-custom/src/locales/ru.ts new file mode 100644 index 0000000000..97cc00b987 --- /dev/null +++ b/webapp/packages/plugin-connection-custom/src/locales/ru.ts @@ -0,0 +1,16 @@ +export default [ + ['customConnection_connectionType_custom', 'Параметры'], + ['customConnection_connectionType_url', 'URL'], + ['customConnection_options', 'Подключение'], + ['customConnection_properties', 'Параметры драйвера'], + ['customConnection_custom_host', 'Хост'], + ['customConnection_custom_obligatory', '(обязательное)'], + ['customConnection_custom_port', 'Порт'], + ['customConnection_custom_database', 'База'], + ['customConnection_custom_server', 'Сервер'], + ['customConnection_url_JDBC', 'JDBC URL'], + ['customConnection_userName', 'Пользователь'], + ['customConnection_Password', 'Пароль'], + ['customConnection_test', 'Проверить'], + ['customConnection_create', 'Создать'], +]; diff --git a/webapp/packages/plugin-connection-custom/src/manifest.ts b/webapp/packages/plugin-connection-custom/src/manifest.ts index 37846855ae..04bcba0d28 100644 --- a/webapp/packages/plugin-connection-custom/src/manifest.ts +++ b/webapp/packages/plugin-connection-custom/src/manifest.ts @@ -10,6 +10,7 @@ import { PluginManifest } from '@cloudbeaver/core-di'; import { CustomConnectionPluginBootstrap } from './CustomConnectionPluginBootstrap'; import { CustomConnectionService } from './CustomConnectionService'; +import { LocaleService } from './LocaleService'; export const customConnectionPluginManifest: PluginManifest = { info: { @@ -18,6 +19,7 @@ export const customConnectionPluginManifest: PluginManifest = { providers: [ CustomConnectionService, + LocaleService, ], initialize(services): void { diff --git a/webapp/packages/plugin-data-export/src/LocaleService.ts b/webapp/packages/plugin-data-export/src/LocaleService.ts new file mode 100644 index 0000000000..63ab3fb719 --- /dev/null +++ b/webapp/packages/plugin-data-export/src/LocaleService.ts @@ -0,0 +1,32 @@ +/* + * cloudbeaver - Cloud Database Manager + * Copyright (C) 2020 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0. + * you may not use this file except in compliance with the License. + */ + +import { Bootstrap, injectable } from '@cloudbeaver/core-di'; +import { LocalizationService } from '@cloudbeaver/core-localization'; + +@injectable() +export class LocaleService extends Bootstrap { + constructor(private localizationService: LocalizationService) { + super(); + } + + register(): void | Promise { + this.localizationService.addProvider(this.provider.bind(this)); + } + + load(): void | Promise { } + + private async provider(locale: string) { + switch (locale) { + case 'ru': + return (await import('./locales/ru')).default; + default: + return (await import('./locales/en')).default; + } + } +} diff --git a/webapp/packages/plugin-data-export/src/locales/en.ts b/webapp/packages/plugin-data-export/src/locales/en.ts new file mode 100644 index 0000000000..c199614c5a --- /dev/null +++ b/webapp/packages/plugin-data-export/src/locales/en.ts @@ -0,0 +1,13 @@ +export default [ + ['data_transfer_dialog_title', 'Export data'], + ['data_transfer_dialog_export', 'Export'], + ['data_transfer_dialog_configuration_title', 'Export configuration'], + ['data_transfer_dialog_preparation', 'We prepare your file for export. Please wait...'], + ['data_transfer_notification_preparation', 'We prepare your file for download. Please wait...'], + ['data_transfer_notification_ready', 'File ready to download'], + ['data_transfer_notification_error', 'Preparation failed or canceled'], + ['data_transfer_notification_download', 'Download'], + ['data_transfer_notification_delete', 'Delete'], + ['data_transfer_exporting_table', 'Table:'], + ['data_transfer_exporting_sql', 'SQL:'], +]; diff --git a/webapp/packages/plugin-data-export/src/locales/ru.ts b/webapp/packages/plugin-data-export/src/locales/ru.ts new file mode 100644 index 0000000000..98eb4f9c5b --- /dev/null +++ b/webapp/packages/plugin-data-export/src/locales/ru.ts @@ -0,0 +1,13 @@ +export default [ + ['data_transfer_dialog_title', 'Экспорт данных'], + ['data_transfer_dialog_export', 'Экспортировать'], + ['data_transfer_dialog_configuration_title', 'Настройка экспорта'], + ['data_transfer_dialog_preparation', 'Подготавливаем файл к экспорту. Пожалуйста подождите...'], + ['data_transfer_notification_preparation', 'Подготавливаем файл к загрузке. Пожалуйста подождите...'], + ['data_transfer_notification_ready', 'Файл готов к загрузке'], + ['data_transfer_notification_error', 'Подготовка файла к загрузке не удалась или была отменена'], + ['data_transfer_notification_download', 'Загрузить'], + ['data_transfer_notification_delete', 'Удалить'], + ['data_transfer_exporting_table', 'Таблица:'], + ['data_transfer_exporting_sql', 'SQL:'], +]; diff --git a/webapp/packages/plugin-data-export/src/manifest.ts b/webapp/packages/plugin-data-export/src/manifest.ts index e423d44549..aad27c02e5 100644 --- a/webapp/packages/plugin-data-export/src/manifest.ts +++ b/webapp/packages/plugin-data-export/src/manifest.ts @@ -13,6 +13,7 @@ import { DataExportMenuService } from './DataExportMenuService'; import { DataExportProcessService } from './DataExportProcessService'; import { DataExportService } from './DataExportService'; import { DataTransferProcessorsResource } from './DataTransferProcessorsResource'; +import { LocaleService } from './LocaleService'; export const manifest: PluginManifest = { info: { @@ -24,6 +25,7 @@ export const manifest: PluginManifest = { DataExportService, DataExportProcessService, DataTransferProcessorsResource, + LocaleService, ], async initialize(services: IServiceInjector) {