psy_vk / js /rus /rus.js
DmitrMakeev's picture
Create rus.js
d02116f verified
raw
history blame
3.21 kB
// Добавление русского языка
editor.I18n.addMessages({
ru: {
styleManager: {
sectors: {
'general': 'Общие',
'dimension': 'Размер',
'typography': 'Типографика',
'decorations': 'Оформление',
'extra': 'Ещё больше',
'flex': 'Flex',
},
properties: {
'background-repeat': 'Повторение',
'background-position': 'Позиция',
'width': 'Ширина',
'height': 'Высота',
'max-width': 'Макс. ширина',
'min-height': 'Мин. высота',
'margin': 'Отступ',
'padding': 'Внутр.отступ',
'font-family': 'Шрифт',
'font-size': 'Размер шрифта',
'font-weight': 'Толщина шрифта',
'color': 'Цвет текста',
'text-align': 'Вырав. текста',
'text-decoration': 'Оформ. текста',
'text-shadow': 'Текст. тень',
'opacity': 'Прозрачность',
'border-radius': 'Радиус скруг.',
'border': 'Граница',
'box-shadow': 'Тень блока',
'background': 'Фон',
}
},
blockManager: {
labels: {
'responsive-image': 'Адаптивное изображение',
'centered-text': 'Центрированный текст',
}
},
panels: {
buttons: {
'open-code': 'Открыть код',
'gjs-open-import-webpage': 'Импортировать',
}
},
commands: {
'gjs-open-import-webpage': {
title: 'Импортировать шаблон',
label: '<div style="margin-bottom: 10px; font-size: 13px;">Вставьте здесь ваш HTML/CSS и нажмите Импортировать</div>',
}
}
}
});
// Установка русского языка по умолчанию
editor.I18n.setLocale('ru');
// Удаление ненужных блоков
const unwantedBlocks = ['video', 'link', 'image'];
unwantedBlocks.forEach(blockId => {
editor.BlockManager.remove(blockId);
});
// Добавление блока адаптивной картинки
editor.BlockManager.add('responsive-image', {
label: editor.I18n.t('blockManager.labels.responsive-image'),
content: {
type: 'image',
style: {
display: 'block',
margin: 'auto',
maxWidth: '100%',
height: 'auto',
objectFit: 'cover'
},
attributes: {
alt: 'Responsive Image'
}
},
attributes: {
class: 'fa fa-image'
}
});
// Добавление блока центрированного текста
editor.BlockManager.add('centered-text', {
label: editor.I18n.t('blockManager.labels.centered-text'),
content: {
type: 'text',
style: {
textAlign: 'center'
},
content: 'Centered Text'
},
attributes: {
class: 'fa fa-align-center'
}
});