From d514d8399bbb89e1b42c078f8fc72ef059831dc0 Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 6 Aug 2020 10:50:04 +0300 Subject: [PATCH] Web: Client: Settings: Added translate keys, refactoring --- .../Settings/categories/common/custom-titles.js | 8 +++++--- .../Settings/categories/common/customization.js | 11 ++++------- .../categories/common/language-and-time-zone.js | 4 +++- .../pages/Settings/locales/en/translation.json | 10 +++++++++- .../pages/Settings/locales/ru/translation.json | 9 ++++++++- .../pages/Settings/utils/settingsTree.js | 4 ++-- .../src/components/save-cancel-buttons/index.js | 14 +++++++++++--- 7 files changed, 42 insertions(+), 18 deletions(-) diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/common/custom-titles.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/common/custom-titles.js index a235815995..3614165d60 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/common/custom-titles.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/common/custom-titles.js @@ -186,7 +186,7 @@ class CustomTitles extends React.Component { - Set default title + {t('SetDefaultTitle')} @@ -211,7 +211,9 @@ class CustomTitles extends React.Component { onSaveClick={this.onSaveGreetingSettings} onCancelClick={this.onCancelClick} showReminder={showReminder} - reminderTest="You have unsaved changes" + reminderTest={t('YouHaveUnsavedChanges')} + saveButtonLabel={t('SaveButton')} + cancelButtonLabel={t('CancelButton')} /> } diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/common/customization.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/common/customization.js index 2052654a49..b0420166b2 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/common/customization.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/common/customization.js @@ -191,15 +191,13 @@ class Customization extends React.Component { onClick={this.onClickLink} truncate={true} href="/settings/common/customization/language-and-time-zone"> - Language and time zone settings + {t('StudioTimeLanguageSettings')} {language.label} / {timezone.label} - Language and time zone settings is a way to change the language - of the whole portal for all portal users and to configure the time zone - so that all the events of the portal will be shown with the correct date and time. + {t('LanguageAndTimeZoneSettingsDescription')}
@@ -209,13 +207,12 @@ class Customization extends React.Component { className='inherit-title-link header' onClick={this.onClickLink} href="/settings/common/customization/custom-titles"> - Custom titles + {t('CustomTitles')}
- Custom welcome page title will be displayed on the welcome page of your portal. The same name is also used for the From field of your portal email notifications. - Custom domain name is a way to set an alternative URL for your portal. Custom portal name will appear next to the onlyoffice.com/onlyoffice.eu portal address. + {t('CustomTitlesSettingsDescription')} diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/common/language-and-time-zone.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/common/language-and-time-zone.js index 35dfd5eae2..8a9ce73e27 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/common/language-and-time-zone.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/common/language-and-time-zone.js @@ -307,7 +307,9 @@ class LanguageAndTimeZone extends React.Component { onSaveClick={this.onSaveLngTZSettings} onCancelClick={this.onCancelClick} showReminder={showReminder} - reminderTest="You have unsaved changes" + reminderTest={t('YouHaveUnsavedChanges')} + saveButtonLabel={t('SaveButton')} + cancelButtonLabel={t('CancelButton')} /> } diff --git a/web/ASC.Web.Client/src/components/pages/Settings/locales/en/translation.json b/web/ASC.Web.Client/src/components/pages/Settings/locales/en/translation.json index f26c07a51a..3ef81cbde7 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/locales/en/translation.json +++ b/web/ASC.Web.Client/src/components/pages/Settings/locales/en/translation.json @@ -20,6 +20,7 @@ "Language": "Language", "TimeZone": "Time Zone", "SaveButton": "Save", + "CancelButton": "Cancel", "SuccessfullySaveSettingsMessage": "Settings have been successfully updated", "NotFoundLanguage": "In case you cannot find your language in the list of the available ones, feel free to write to us at <1>{{supportEmail}} to take part in the translation and get up to 1 year free of charge.", "Settings": "Settings", @@ -45,7 +46,9 @@ "LoadingProcessing": "Loading...", "LoadingDescription": "Please wait...", "GreetingSettingsTitle": "Welcome Page Settings", + "WelcomePageTitle": "Welcome page title", "GreetingTitle": "Title", + "SetDefaultTitle": "Set default title", "RestoreDefaultButton": "Restore to Default", "SuccessfullySaveGreetingSettingsMessage": "Welcome Page settings have been successfully saved", "LogoSettings": "Portal Logo Settings", @@ -96,5 +99,10 @@ "DirectionAscLabel":"A-Z", "DirectionDescLabel":"Z-A", "MeLabel": "Me", - "OrganizationName": "ONLYOFFICE" + "OrganizationName": "ONLYOFFICE", + "YouHaveUnsavedChanges": "You have unsaved changes", + "CustomTitles": "Custom titles", + "LanguageAndTimeZoneSettingsDescription": "Language and time zone settings is a way to change the language of the whole portal for all portal users and to configure the time zone so that all the events of the portal will be shown with the correct date and time.", + "CustomTitlesSettingsDescription": "Custom welcome page title will be displayed on the welcome page of your portal. The same name is also used for the From field of your portal email notifications. Custom domain name is a way to set an alternative URL for your portal. Custom portal name will appear next to the onlyoffice.com/onlyoffice.eu portal address." + } \ No newline at end of file diff --git a/web/ASC.Web.Client/src/components/pages/Settings/locales/ru/translation.json b/web/ASC.Web.Client/src/components/pages/Settings/locales/ru/translation.json index 682e6d504e..993ec21c4b 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/locales/ru/translation.json +++ b/web/ASC.Web.Client/src/components/pages/Settings/locales/ru/translation.json @@ -19,6 +19,7 @@ "Language": "Язык", "TimeZone": "Часовой пояс", "SaveButton": "Сохранить", + "CancelButton": "Отменить", "SuccessfullySaveSettingsMessage": "Настройки успешно обновлены", "NotFoundLanguage": "Если Вы не можете найти свой язык в списке доступных, Вы всегда можете написать нам по адресу <1>{{supportEmail}}, чтобы принять участие в переводе и получить до 1 года бесплатного использования.", "Settings": "Настройки", @@ -44,7 +45,9 @@ "LoadingProcessing": "Загрузка...", "LoadingDescription": "Пожалуйста подождите...", "GreetingSettingsTitle": "Настройки страницы приветствия", + "WelcomePageTitle": "Заголовок страницы приветствия", "GreetingTitle": "Заголовок", + "SetDefaultTitle": "Установить заголовок по умолчанию", "RestoreDefaultButton": "Настройки по умолчанию", "SuccessfullySaveGreetingSettingsMessage": "Настройки страницы приветствия успешно сохранены", "LogoSettings": "Настройки логотипа портала", @@ -96,5 +99,9 @@ "DirectionAscLabel":"А-Я", "DirectionDescLabel":"Я-А", "MeLabel": "Я", - "OrganizationName": "ONLYOFFICE" + "OrganizationName": "ONLYOFFICE", + "YouHaveUnsavedChanges": "Имеются несохраненные изменения", + "CustomTitles": "Пользовательские заголовки", + "LanguageAndTimeZoneSettingsDescription": "Настройки языка и часового пояса - это способ изменить язык всего портала для всех пользователей портала и настроить часовой пояс, чтобы все события портала отображались с правильной датой и временем.", + "CustomTitlesSettingsDescription": "Пользовательский заголовок страницы приветствия будет отображаться на странице приветствия вашего портала. Это же имя используется для поля 'От' вашего электронного уведомления портала. Пользовательское доменное имя - это способ установить альтернативный URL-адрес для вашего портала. Пользовательское имя портала будет отображаться рядом с адресом портала onlyoffice.com/onlyoffice.eu." } \ No newline at end of file diff --git a/web/ASC.Web.Client/src/components/pages/Settings/utils/settingsTree.js b/web/ASC.Web.Client/src/components/pages/Settings/utils/settingsTree.js index f15d5985ba..66190fed36 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/utils/settingsTree.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/utils/settingsTree.js @@ -20,14 +20,14 @@ export const settingsTree = [ key: '0-0-0', icon: '', link: 'language-and-time-zone', - tKey: 'Language and time zone settings', + tKey: 'StudioTimeLanguageSettings', }, { key: '0-0-1', icon: '', link: 'custom-titles', - tKey: 'Custom titles', + tKey: 'CustomTitles', }, ], diff --git a/web/ASC.Web.Components/src/components/save-cancel-buttons/index.js b/web/ASC.Web.Components/src/components/save-cancel-buttons/index.js index 1e65e86a3d..367953b32a 100644 --- a/web/ASC.Web.Components/src/components/save-cancel-buttons/index.js +++ b/web/ASC.Web.Components/src/components/save-cancel-buttons/index.js @@ -36,7 +36,7 @@ const StyledSaveCancelButtons = styled.div` class SaveCancelButtons extends React.Component{ render(){ - const { onSaveClick, onCancelClick, showReminder, reminderTest } = this.props + const { onSaveClick, onCancelClick, showReminder, reminderTest, saveButtonLabel, cancelButtonLabel } = this.props return(
@@ -46,13 +46,13 @@ class SaveCancelButtons extends React.Component{ isDisabled={false} primary onClick={onSaveClick} - label="Save" + label={saveButtonLabel} />
{showReminder && {reminderTest} } @@ -63,9 +63,17 @@ class SaveCancelButtons extends React.Component{ SaveCancelButtons.propTypes = { reminderTest: PropTypes.string, + saveButtonLabel: PropTypes.string, + cancelButtonLabel: PropTypes.string, onSaveClick: PropTypes.func, onCancelClick: PropTypes.func, showReminder: PropTypes.bool }; + +SaveCancelButtons.defaultProps = { + saveButtonLabel: "Save", + cancelButtonLabel: "Cancel" +} + export default SaveCancelButtons \ No newline at end of file