I18n: Migrate to I18next (#55845)

* Switch from lingui from i18next

* Change lingui messages to i18next messages

* Change lingui messages to i18next messages (grafana-ui)

* Init i18n for tests
This commit is contained in:
Josh Hunt
2022-10-06 16:34:04 +01:00
committed by GitHub
parent c1d6df4eb7
commit 5361efc225
58 changed files with 2557 additions and 4364 deletions
+35 -38
View File
@@ -16,7 +16,6 @@ import { AppChrome } from './core/components/AppChrome/AppChrome';
import { AppNotificationList } from './core/components/AppNotifications/AppNotificationList';
import { NavBar } from './core/components/NavBar/NavBar';
import { GrafanaContext } from './core/context/GrafanaContext';
import { I18nProvider } from './core/internationalization';
import { GrafanaRoute } from './core/navigation/GrafanaRoute';
import { RouteDescriptor } from './core/navigation/types';
import { contextSrv } from './core/services/context_srv';
@@ -115,44 +114,42 @@ export class AppWrapper extends React.Component<AppWrapperProps, AppWrapperState
return (
<React.StrictMode>
<Provider store={store}>
<I18nProvider>
<ErrorBoundaryAlert style="page">
<GrafanaContext.Provider value={app.context}>
<ThemeProvider value={config.theme2}>
<KBarProvider
actions={[]}
options={{ enableHistory: true, callbacks: { onSelectAction: commandPaletteActionSelected } }}
>
<ModalsProvider>
<GlobalStyles />
{this.commandPaletteEnabled() && <CommandPalette />}
<div className="grafana-app">
<Router history={locationService.getHistory()}>
{this.renderNavBar()}
<AppChrome>
{pageBanners.map((Banner, index) => (
<Banner key={index.toString()} />
))}
<ErrorBoundaryAlert style="page">
<GrafanaContext.Provider value={app.context}>
<ThemeProvider value={config.theme2}>
<KBarProvider
actions={[]}
options={{ enableHistory: true, callbacks: { onSelectAction: commandPaletteActionSelected } }}
>
<ModalsProvider>
<GlobalStyles />
{this.commandPaletteEnabled() && <CommandPalette />}
<div className="grafana-app">
<Router history={locationService.getHistory()}>
{this.renderNavBar()}
<AppChrome>
{pageBanners.map((Banner, index) => (
<Banner key={index.toString()} />
))}
<AngularRoot />
<AppNotificationList />
{this.searchBarEnabled() && <SearchWrapper />}
{ready && this.renderRoutes()}
{bodyRenderHooks.map((Hook, index) => (
<Hook key={index.toString()} />
))}
</AppChrome>
</Router>
</div>
<LiveConnectionWarning />
<ModalRoot />
<PortalContainer />
</ModalsProvider>
</KBarProvider>
</ThemeProvider>
</GrafanaContext.Provider>
</ErrorBoundaryAlert>
</I18nProvider>
<AngularRoot />
<AppNotificationList />
{this.searchBarEnabled() && <SearchWrapper />}
{ready && this.renderRoutes()}
{bodyRenderHooks.map((Hook, index) => (
<Hook key={index.toString()} />
))}
</AppChrome>
</Router>
</div>
<LiveConnectionWarning />
<ModalRoot />
<PortalContainer />
</ModalsProvider>
</KBarProvider>
</ThemeProvider>
</GrafanaContext.Provider>
</ErrorBoundaryAlert>
</Provider>
</React.StrictMode>
);