Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add i18next and config for i18n of UI #2254

Merged
merged 17 commits into from
Dec 8, 2022
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
136 changes: 122 additions & 14 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-saga": "^1.0.2",
"webpack-merge": "^4.2.1"
"webpack-merge": "^4.2.1",
"i18next": "^22.0.6",
"i18next-browser-languagedetector": "^7.0.1",
"react-i18next": "^12.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be an update to the lock file in this directory.

},
"devDependencies": {
"@types/classnames": "^2.2.10",
Expand Down
21 changes: 21 additions & 0 deletions web/src/components/core/input-base/MqInputBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,24 @@ export const MqInputBase = withStyles((theme: Theme) =>
}
})
)(InputBase)

export const MqInputNoIcon = withStyles((theme: Theme) =>
createStyles({
input: {
borderRadius: theme.spacing(4),
position: 'relative',
backgroundColor: 'transparent',
border: `2px solid ${theme.palette.common.white}`,
fontSize: 16,
padding: `${theme.spacing(1)}px ${theme.spacing(5)}px ${theme.spacing(1)}px ${theme.spacing(
1
)}px`,
transition: theme.transitions.create(['border-color', 'box-shadow']),
'&:focus': {
borderColor: theme.palette.primary.main,
boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 3px`,
borderRadius: theme.spacing(4)
}
}
})
)(InputBase)
13 changes: 11 additions & 2 deletions web/src/components/datasets/DatasetDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const DatasetDetailPage: FunctionComponent<IProps> = props => {
const { classes, fetchDatasetVersions, resetDatasetVersions, versions, versionsLoading } = props
const { root } = classes
const history = useHistory()
const i18next = require('i18next')

useEffect(() => {
fetchDatasetVersions(props.dataset.namespace, props.dataset.name)
Expand Down Expand Up @@ -125,8 +126,16 @@ const DatasetDetailPage: FunctionComponent<IProps> = props => {
<Box display={'flex'} justifyContent={'space-between'} mb={2}>
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
<Tabs value={tab} onChange={handleChange} textColor='primary' indicatorColor='primary'>
<Tab label='LATEST SCHEMA' {...a11yProps(0)} disableRipple={true} />
<Tab label='VERSION HISTORY' {...a11yProps(1)} disableRipple={true} />
<Tab
label={i18next.t('datasets.latest_tab')}
{...a11yProps(0)}
disableRipple={true}
/>
<Tab
label={i18next.t('datasets.history_tab')}
{...a11yProps(1)}
disableRipple={true}
/>
</Tabs>
</Box>
<IconButton onClick={() => history.push('/datasets')}>
Expand Down
Loading