mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-23 08:01:22 +00:00
Add translation to language selector
This commit is contained in:
parent
230cc25a3b
commit
340fe551d6
@ -6,6 +6,7 @@
|
||||
"backup_wallet": "backup wallet",
|
||||
"cancel": "cancel",
|
||||
"change": "change",
|
||||
"change_language": "change language",
|
||||
"choose": "choose",
|
||||
"close": "close",
|
||||
"continue": "continue",
|
||||
|
@ -608,7 +608,9 @@ export const Thread = ({
|
||||
>
|
||||
<MailIconImg src={ReturnSVG} />
|
||||
<ComposeP>
|
||||
{t('group:action.return_to_thread', { postProcess: 'capitalize' })}
|
||||
{t('group:action.return_to_thread', {
|
||||
postProcess: 'capitalize',
|
||||
})}
|
||||
</ComposeP>
|
||||
</ShowMessageReturnButton>
|
||||
{/* Conditionally render the scroll buttons */}
|
||||
@ -685,7 +687,7 @@ export const Thread = ({
|
||||
disabled={!hasFirstPage}
|
||||
variant="contained"
|
||||
>
|
||||
{t(core:page.first', { postProcess: 'capitalize' })}
|
||||
{t('core:page.first', { postProcess: 'capitalize' })}
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
@ -704,7 +706,7 @@ export const Thread = ({
|
||||
disabled={!hasPreviousPage}
|
||||
variant="contained"
|
||||
>
|
||||
{t(core:page.previous', { postProcess: 'capitalize' })}
|
||||
{t('core:page.previous', { postProcess: 'capitalize' })}
|
||||
</Button>
|
||||
<Button
|
||||
sx={{
|
||||
@ -740,7 +742,7 @@ export const Thread = ({
|
||||
disabled={!hasLastPage}
|
||||
variant="contained"
|
||||
>
|
||||
{t(core:page.last', { postProcess: 'capitalize' })}
|
||||
{t('core:page.last', { postProcess: 'capitalize' })}
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
@ -998,7 +1000,7 @@ export const Thread = ({
|
||||
disabled={!hasFirstPage}
|
||||
variant="contained"
|
||||
>
|
||||
{t(core:page.first', { postProcess: 'capitalize' })}
|
||||
{t('core:page.first', { postProcess: 'capitalize' })}
|
||||
</Button>
|
||||
<Button
|
||||
sx={{
|
||||
@ -1016,7 +1018,7 @@ export const Thread = ({
|
||||
disabled={!hasPreviousPage}
|
||||
variant="contained"
|
||||
>
|
||||
{t(core:page.previous', { postProcess: 'capitalize' })}
|
||||
{t('core:page.previous', { postProcess: 'capitalize' })}
|
||||
</Button>
|
||||
<Button
|
||||
sx={{
|
||||
@ -1052,7 +1054,7 @@ export const Thread = ({
|
||||
disabled={!hasLastPage}
|
||||
variant="contained"
|
||||
>
|
||||
{t(core:page.last', { postProcess: 'capitalize' })}
|
||||
{t('core:page.last', { postProcess: 'capitalize' })}
|
||||
</Button>
|
||||
</Box>
|
||||
<Spacer height="30px" />
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { supportedLanguages } from '../../../i18n';
|
||||
import { Tooltip } from '@mui/material';
|
||||
import { Tooltip, useTheme } from '@mui/material';
|
||||
|
||||
const LanguageSelector = () => {
|
||||
const { i18n } = useTranslation();
|
||||
const { i18n, t } = useTranslation(['core']);
|
||||
const [showSelect, setShowSelect] = useState(false);
|
||||
const theme = useTheme();
|
||||
|
||||
const handleChange = (e) => {
|
||||
const newLang = e.target.value;
|
||||
@ -28,19 +29,21 @@ const LanguageSelector = () => {
|
||||
}}
|
||||
>
|
||||
<Tooltip
|
||||
title="Pollo"
|
||||
// {
|
||||
// themeMode === 'dark'
|
||||
// ? t('core:theme.light', {
|
||||
// postProcess: 'capitalize',
|
||||
// })
|
||||
// : t('core:theme.light', {
|
||||
// postProcess: 'capitalize',
|
||||
// })
|
||||
// }
|
||||
title={t('core:action.change_language', {
|
||||
postProcess: 'capitalize',
|
||||
})}
|
||||
>
|
||||
{showSelect ? (
|
||||
<select
|
||||
style={{
|
||||
fontSize: '1rem',
|
||||
border: '2px',
|
||||
background: theme.palette.background.default,
|
||||
color: theme.palette.text.primary,
|
||||
cursor: 'pointer',
|
||||
position: 'relative',
|
||||
bottom: '7px',
|
||||
}}
|
||||
value={currentLang}
|
||||
onChange={handleChange}
|
||||
onBlur={() => setShowSelect(false)}
|
||||
@ -62,7 +65,7 @@ const LanguageSelector = () => {
|
||||
}}
|
||||
aria-label={`Current language: ${name}`}
|
||||
>
|
||||
{flag}
|
||||
{showSelect ? undefined : flag}
|
||||
</button>
|
||||
)}
|
||||
</Tooltip>
|
||||
|
Loading…
x
Reference in New Issue
Block a user