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