mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
[Bug]: Fixed localisation for subpath (#4057)
* Fixed localisation for subpath * Fixed notification typo on localisation
This commit is contained in:
parent
9860cf639e
commit
3ae99adc57
3 changed files with 25 additions and 26 deletions
|
|
@ -91,7 +91,7 @@ export const NotificationCenter = () => {
|
|||
</p>
|
||||
<p className="empty-subtitle text-muted">
|
||||
{`${t('header.notificationCenter.youDontHaveany', `You don't have any`)} ${
|
||||
!isRead && t('header.notificationCenter.un', 'un')
|
||||
!isRead ? t('header.notificationCenter.un', 'un') : ''
|
||||
}${t('header.notificationCenter.read', 'read')} ${t(
|
||||
`header.notificationCenter.notifications`,
|
||||
'notifications'
|
||||
|
|
@ -108,10 +108,12 @@ export const NotificationCenter = () => {
|
|||
</div>
|
||||
<div className="card-footer text-center margin-auto">
|
||||
<a href="#" className="text-muted text-decoration-none" onClick={() => setIsRead(!isRead)}>
|
||||
{`${t('header.notificationCenter.view', 'View')} ${isRead && t('header.notificationCenter.un', 'un')}${t(
|
||||
'header.notificationCenter.read',
|
||||
'read'
|
||||
)} ${t(`header.notificationCenter.notifications`, 'notifications').toLowerCase()}`}
|
||||
{`${t('header.notificationCenter.view', 'View')} ${
|
||||
isRead ? t('header.notificationCenter.un', 'un') : ''
|
||||
}${t('header.notificationCenter.read', 'read')} ${t(
|
||||
`header.notificationCenter.notifications`,
|
||||
'notifications'
|
||||
).toLowerCase()}`}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
// eslint-disable-next-line import/no-unresolved
|
||||
import i18n from 'i18next';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
|
||||
import Backend from 'i18next-http-backend';
|
||||
|
||||
i18n
|
||||
.use(Backend)
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
load: 'languageOnly',
|
||||
fallbackLng: 'en',
|
||||
backend: {
|
||||
loadPath: `/assets/translations/{{lng}}.json`,
|
||||
},
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
|
|
@ -5,7 +5,11 @@ import { Integrations } from '@sentry/tracing';
|
|||
import { createBrowserHistory } from 'history';
|
||||
import { appService } from '@/_services';
|
||||
import { App } from './App';
|
||||
import './i18n';
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import i18n from 'i18next';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
import Backend from 'i18next-http-backend';
|
||||
|
||||
const AppWithProfiler = Sentry.withProfiler(App);
|
||||
|
||||
|
|
@ -14,6 +18,19 @@ appService
|
|||
.then((config) => {
|
||||
window.public_config = config;
|
||||
|
||||
const path = config?.SUB_PATH || '/';
|
||||
i18n
|
||||
.use(Backend)
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
load: 'languageOnly',
|
||||
fallbackLng: 'en',
|
||||
backend: {
|
||||
loadPath: `${path}assets/translations/{{lng}}.json`,
|
||||
},
|
||||
});
|
||||
|
||||
if (window.public_config.APM_VENDOR === 'sentry') {
|
||||
const history = createBrowserHistory();
|
||||
const tooljetServerUrl = window.public_config.TOOLJET_SERVER_URL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue