feat(i18n): Add expand and collapse translations for code blocks
This commit is contained in:
parent
c6f036cba5
commit
46c7d35bb8
@ -930,7 +930,9 @@
|
||||
},
|
||||
"code_block": {
|
||||
"enable_wrap": "Wrap",
|
||||
"disable_wrap": "Unwrap"
|
||||
"disable_wrap": "Unwrap",
|
||||
"expand": "Expand",
|
||||
"collapse": "Collapse"
|
||||
},
|
||||
"backup": {
|
||||
"title": "Data Backup",
|
||||
|
||||
@ -930,7 +930,9 @@
|
||||
},
|
||||
"code_block": {
|
||||
"enable_wrap": "改行",
|
||||
"disable_wrap": "改行解除"
|
||||
"disable_wrap": "改行解除",
|
||||
"expand": "展開する",
|
||||
"collapse": "折りたたむ"
|
||||
},
|
||||
"backup": {
|
||||
"title": "データバックアップ",
|
||||
|
||||
@ -930,7 +930,9 @@
|
||||
},
|
||||
"code_block": {
|
||||
"enable_wrap": "Перенос строки",
|
||||
"disable_wrap": "Отменить перенос строки"
|
||||
"disable_wrap": "Отменить перенос строки",
|
||||
"expand": "Развернуть",
|
||||
"collapse": "Свернуть"
|
||||
},
|
||||
"backup": {
|
||||
"title": "Резервное копирование данных",
|
||||
|
||||
@ -930,7 +930,9 @@
|
||||
},
|
||||
"code_block": {
|
||||
"enable_wrap": "换行",
|
||||
"disable_wrap": "取消换行"
|
||||
"disable_wrap": "取消换行",
|
||||
"expand": "展开",
|
||||
"collapse": "收起"
|
||||
},
|
||||
"backup": {
|
||||
"title": "数据备份",
|
||||
|
||||
@ -930,7 +930,9 @@
|
||||
},
|
||||
"code_block": {
|
||||
"enable_wrap": "換行",
|
||||
"disable_wrap": "取消換行"
|
||||
"disable_wrap": "取消換行",
|
||||
"expand": "展開",
|
||||
"collapse": "收起"
|
||||
},
|
||||
"backup": {
|
||||
"title": "資料備份",
|
||||
|
||||
@ -156,11 +156,12 @@ const ExpandButton: React.FC<{
|
||||
onClick: () => void
|
||||
showButton: boolean
|
||||
}> = ({ isExpanded, onClick, showButton }) => {
|
||||
const { t } = useTranslation()
|
||||
if (!showButton) return null
|
||||
|
||||
return (
|
||||
<ExpandButtonWrapper onClick={onClick}>
|
||||
<div className="button-text">{isExpanded ? '收起' : '展开'}</div>
|
||||
<div className="button-text">{isExpanded ? t('code_block.collapse') : t('code_block.expand')}</div>
|
||||
</ExpandButtonWrapper>
|
||||
)
|
||||
}
|
||||
@ -317,6 +318,9 @@ const ExpandButtonWrapper = styled.div`
|
||||
z-index: 1;
|
||||
transition: color 0.2s;
|
||||
font-size: 12px;
|
||||
font-family:
|
||||
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
|
||||
sans-serif;
|
||||
}
|
||||
|
||||
&:hover .button-text {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user