diff --git a/src/settings/components/utils.ts b/src/settings/components/utils.ts index 625c78cf..9fedd133 100644 --- a/src/settings/components/utils.ts +++ b/src/settings/components/utils.ts @@ -185,6 +185,13 @@ export const localeList = ( }), value: 'pt' }, + { + id: 'pl', + name: 'polski', + localName: t('locale.polish', 'Polish'), + label: 'Polish - polski', + value: 'pl' + }, { id: 'pt_BR', name: 'português (Brasil)', @@ -420,13 +427,6 @@ export const localeList = ( // label: 'Norwegian - norsk', // value: 'no' // }, -// { -// id: 'pl', -// name: 'polski', -// localName: t('locale.polish', 'Polish'), -// label: 'Polish - polski', -// value: 'pl' -// }, // { // id: 'pt_PT', diff --git a/src/store/integrations/composer.tsx b/src/store/integrations/composer.tsx index a323c68f..42bbde53 100644 --- a/src/store/integrations/composer.tsx +++ b/src/store/integrations/composer.tsx @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ -import React, { FC, useCallback, useEffect, useState } from 'react'; +import React, { FC, useCallback, useMemo } from 'react'; import { Container } from '@zextras/carbonio-design-system'; // TinyMCE so the global var exists // eslint-disable-next-line no-unused-vars @@ -43,6 +43,7 @@ import 'tinymce/plugins/directionality'; import 'tinymce/plugins/autoresize'; import { Editor } from '@tinymce/tinymce-react'; +import { useUserSettings } from '../account'; type ComposerProps = { /** The callback invoked when an edit is performed into the editor. `([text, html]) => {}` */ @@ -74,6 +75,15 @@ const Composer: FC = ({ }, [onEditorChange] ); + const { prefs } = useUserSettings(); + const defaultStyle = useMemo( + () => ({ + font: prefs?.zimbraPrefHtmlEditorDefaultFontFamily, + fontSize: prefs?.zimbraPrefHtmlEditorDefaultFontSize, + color: prefs?.zimbraPrefHtmlEditorDefaultFontColor + }), + [prefs] + ); return ( = ({ branding: false, resize: true, inline, + fontsize_formats: + '8pt 9pt 10pt 11pt 12pt 13pt 14pt 16pt 18pt 24pt 30pt 36pt 48pt 60pt 72pt 96pt', object_resizing: 'img', style_formats: [ { @@ -165,6 +177,7 @@ const Composer: FC = ({ contextmenu: inline ? '' : '', toolbar_mode: 'wrap', forced_root_block: false, + content_style: `body { color: ${defaultStyle?.color}; font-size: ${defaultStyle?.fontSize}; font-family: ${defaultStyle?.font}; }`, visualblocks_default_state: true, end_container_on_empty_block: true }} diff --git a/translations/en.json b/translations/en.json index 96ec3d0e..09c9ed58 100644 --- a/translations/en.json +++ b/translations/en.json @@ -130,6 +130,7 @@ "label_spanish": "Spanish - {{value}}", "label_thai": "Thai - {{value}}", "label_turkish": "Turkish - {{value}}", + "polish": "Polish", "portuguese": "Portuguese", "portuguese_brazil": "Portuguese (Brazil)", "romanian": "Romanian",