Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions i18next-scanner.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = {
'app-staking',
'app-storage',
'app-sudo',
'app-tech-comm',
'app-toolbox',
'app-transfer',
'app-treasury',
Expand Down
2 changes: 1 addition & 1 deletion packages/app-tech-comm/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function TechCommApp ({ basePath, className, t }: Props): React.ReactElement<Pro
},
{
name: 'proposals',
text: t('Proposals ({{count}})', { replace: { count: proposals?.length || 0 } })
text: t('Proposals ({{count}})', { replace: { count: (proposals && proposals.length) || 0 } })
}
]}
/>
Expand Down
20 changes: 19 additions & 1 deletion packages/apps/public/locales/en/app-tech-comm.json
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
{}
{
"Tech. committee": "Tech. committee",
"Proposals ({{count}})": "Proposals ({{count}})",
"No members found": "No members found",
"members": "members",
"proposals": "proposals",
"total": "total",
"Submit proposal": "Submit proposal",
"No committee proposals": "No committee proposals",
"threshold": "threshold",
"Aye": "Aye",
"Nay": "Nay",
"Propose a committee motion": "Propose a committee motion",
"The minimum number of committee votes required to approve this motion": "The minimum number of committee votes required to approve this motion",
"Positive number between 1 and {{memberCount}}": "Positive number between 1 and {{memberCount}}",
"proposal": "proposal",
"Vote on proposal": "Vote on proposal",
"Vote": "Vote"
}
5 changes: 4 additions & 1 deletion packages/apps/public/locales/en/apps.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"Waiting for authorization from the extension. Please open the installed extension and approve or reject access.": "Waiting for authorization from the extension. Please open the installed extension and approve or reject access.",
"You are not connected to a node. Ensure that your node is running and that the Websocket endpoint is reachable.": "You are not connected to a node. Ensure that your node is running and that the Websocket endpoint is reachable.",
"With the Firefox browser connecting to insecure WebSockets ({{wsUrl}}) will fail due to the browser not allowing localhost access from a secure site.": "With the Firefox browser connecting to insecure WebSockets ({{wsUrl}}) will fail due to the browser not allowing localhost access from a secure site.",
"You are connecting from a secure location to an insecure WebSocket ({{wsUrl}}). Due to browser mixed-content security policies this connection type is not allowed. Change the RPC service to a secure 'wss' endpoint.": "You are connecting from a secure location to an insecure WebSocket ({{wsUrl}}). Due to browser mixed-content security policies this connection type is not allowed. Change the RPC service to a secure 'wss' endpoint."
"You are connecting from a secure location to an insecure WebSocket ({{wsUrl}}). Due to browser mixed-content security policies this connection type is not allowed. Change the RPC service to a secure 'wss' endpoint.": "You are connecting from a secure location to an insecure WebSocket ({{wsUrl}}). Due to browser mixed-content security policies this connection type is not allowed. Change the RPC service to a secure 'wss' endpoint.",
"version {{version}}": "version {{version}}",
"GitHub": "GitHub",
"Wiki": "Wiki"
}
5 changes: 4 additions & 1 deletion packages/apps/public/locales/en/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -775,5 +775,8 @@
"The unapplied slashed era to cancel.": "",
"the era to cancel for": "",
"no unapplied slashes found": "",
"Revert": ""
"Revert": "",
"version {{version}}": "",
"GitHub": "",
"Wiki": ""
}
60 changes: 29 additions & 31 deletions packages/apps/src/SideBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// of the Apache-2.0 license. See the LICENSE file for details.

import { RuntimeVersion } from '@polkadot/types/interfaces';
import { I18nProps } from '@polkadot/react-components/types';
import { SIDEBAR_MENU_THRESHOLD } from '../constants';

import './SideBar.css';
Expand All @@ -17,12 +16,12 @@ import { useCall, useApi } from '@polkadot/react-hooks';
import { classes } from '@polkadot/react-components/util';
import { BestNumber, Chain } from '@polkadot/react-query';

import translate from '../translate';
import { useTranslation } from '../translate';
import Item from './Item';
import NodeInfo from './NodeInfo';
import NetworkModal from '../modals/Network';

interface Props extends I18nProps {
interface Props {
className?: string;
collapse: () => void;
handleResize: () => void;
Expand All @@ -32,6 +31,7 @@ interface Props extends I18nProps {
}

function SideBar ({ className, collapse, handleResize, isCollapsed, toggleMenu, menuOpen }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { api } = useApi();
const runtimeVersion = useCall<RuntimeVersion>(api.rpc.state.subscribeRuntimeVersion, []);
const [modals, setModals] = useState<Record<string, boolean>>(
Expand Down Expand Up @@ -85,7 +85,7 @@ function SideBar ({ className, collapse, handleResize, isCollapsed, toggleMenu,
<div className='info'>
<Chain className='chain' />
{runtimeVersion && (
<div className='runtimeVersion'>版本 {runtimeVersion.specVersion.toNumber()}</div>
<div className='runtimeVersion'>{t('version {{version}}', { replace: { version: runtimeVersion.specVersion.toNumber() } })}</div>
)}
<BestNumber label='#' />
</div>
Expand Down Expand Up @@ -119,7 +119,7 @@ function SideBar ({ className, collapse, handleResize, isCollapsed, toggleMenu,
rel='noopener noreferrer'
target='_blank'
>
<Icon name='github' /><span className='text'>GitHub</span>
<Icon name='github' /><span className='text'>{t('GitHub')}</span>
</a>
</Menu.Item>
<Menu.Item className='apps--SideBar-Item'>
Expand All @@ -129,7 +129,7 @@ function SideBar ({ className, collapse, handleResize, isCollapsed, toggleMenu,
rel='noopener noreferrer'
target='_blank'
>
<Icon name='book' /><span className='text'>Wiki</span>
<Icon name='book' /><span className='text'>{t('Wiki')}</span>
</a>
</Menu.Item>
<Menu.Divider hidden />
Expand Down Expand Up @@ -162,31 +162,29 @@ function SideBar ({ className, collapse, handleResize, isCollapsed, toggleMenu,
);
}

export default translate(
styled(SideBar)`
.toggleImg {
cursor: pointer;
height: 2.75rem;
left: 0.9rem;
opacity: 0;
position: absolute;
top: 0px;
transition: opacity 0.2s ease-in, top 0.2s ease-in;
width: 2.75rem;
export default styled(SideBar)`
.toggleImg {
cursor: pointer;
height: 2.75rem;
left: 0.9rem;
opacity: 0;
position: absolute;
top: 0px;
transition: opacity 0.2s ease-in, top 0.2s ease-in;
width: 2.75rem;

&.delayed {
transition-delay: 0.4s;
}

&.open {
opacity: 1;
top: 0.9rem;
}
&.delayed {
transition-delay: 0.4s;
}

${media.DESKTOP`
opacity: 0 !important;
top: -2.9rem !important;
`}
&.open {
opacity: 1;
top: 0.9rem;
}
`
);

${media.DESKTOP`
opacity: 0 !important;
top: -2.9rem !important;
`}
}
`;