Web: Client: Settings: Added translate keys, refactoring

This commit is contained in:
Alexey 2020-08-06 10:50:04 +03:00
parent 2a0641decb
commit d514d8399b
7 changed files with 42 additions and 18 deletions

View File

@ -186,7 +186,7 @@ class CustomTitles extends React.Component {
<FieldContainer
id='fieldContainerWelcomePage'
className='field-container-width'
labelText={`${t("Welcome page title")}:`}
labelText={`${t("WelcomePageTitle")}:`}
isVertical={true}>
<TextInput
scale={true}
@ -200,7 +200,7 @@ class CustomTitles extends React.Component {
type="action"
color="#A3A9AE"
>
Set default title
{t('SetDefaultTitle')}
</Link>
</div>
@ -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')}
/>
}
</StyledComponent>

View File

@ -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')}
</Link>
<Icons.ArrowRightIcon size="small" isfill={true} color="#333333" />
</div>
<Text className="category-item-subheader" truncate={true}> {language.label} / {timezone.label} </Text>
<Text className="category-item-description">
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')}
</Text>
</div>
<div className="category-item-wrapper">
@ -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')}
</Link>
<Icons.ArrowRightIcon size="small" isfill={true} color="#333333" />
</div>
<Text className="category-item-description">
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')}
</Text>
</div>
</StyledComponent>

View File

@ -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')}
/>
}
</StyledComponent>

View File

@ -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}}</1> 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."
}

View File

@ -19,6 +19,7 @@
"Language": "Язык",
"TimeZone": "Часовой пояс",
"SaveButton": "Сохранить",
"CancelButton": "Отменить",
"SuccessfullySaveSettingsMessage": "Настройки успешно обновлены",
"NotFoundLanguage": "Если Вы не можете найти свой язык в списке доступных, Вы всегда можете написать нам по адресу <1>{{supportEmail}}</1>, чтобы принять участие в переводе и получить до 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."
}

View File

@ -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',
},
],

View File

@ -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(
<StyledSaveCancelButtons>
<div>
@ -46,13 +46,13 @@ class SaveCancelButtons extends React.Component{
isDisabled={false}
primary
onClick={onSaveClick}
label="Save"
label={saveButtonLabel}
/>
<Button
size="big"
isDisabled={false}
onClick={onCancelClick}
label="Cancel"
label={cancelButtonLabel}
/>
</div>
{showReminder && <Text className="unsaved-changes"> {reminderTest} </Text>}
@ -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