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