Merge pull request #77 from trails-cool/fix-i18n-entry-client
Fix i18n: init before hydration in entry.client
This commit is contained in:
commit
59ef2a4b5e
4 changed files with 6 additions and 6 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { initI18n } from "@trails-cool/i18n";
|
||||||
import * as Sentry from "@sentry/react";
|
import * as Sentry from "@sentry/react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { startTransition, StrictMode } from "react";
|
import { startTransition, StrictMode } from "react";
|
||||||
|
|
@ -27,6 +28,8 @@ Sentry.init({
|
||||||
enabled: import.meta.env.PROD && sentryEnvironment !== "ci",
|
enabled: import.meta.env.PROD && sentryEnvironment !== "ci",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
initI18n();
|
||||||
|
|
||||||
startTransition(() => {
|
startTransition(() => {
|
||||||
hydrateRoot(
|
hydrateRoot(
|
||||||
document,
|
document,
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,9 @@ import type { LinksFunction } from "react-router";
|
||||||
import type { Route } from "./+types/root";
|
import type { Route } from "./+types/root";
|
||||||
import * as Sentry from "@sentry/react";
|
import * as Sentry from "@sentry/react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { initI18n } from "@trails-cool/i18n";
|
|
||||||
import { getSessionUser } from "~/lib/auth.server";
|
import { getSessionUser } from "~/lib/auth.server";
|
||||||
import stylesheet from "@trails-cool/ui/styles.css?url";
|
import stylesheet from "@trails-cool/ui/styles.css?url";
|
||||||
|
|
||||||
initI18n();
|
|
||||||
|
|
||||||
export const links: LinksFunction = () => [{ rel: "stylesheet", href: stylesheet }];
|
export const links: LinksFunction = () => [{ rel: "stylesheet", href: stylesheet }];
|
||||||
|
|
||||||
export function Layout({ children }: { children: React.ReactNode }) {
|
export function Layout({ children }: { children: React.ReactNode }) {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { initI18n } from "@trails-cool/i18n";
|
||||||
import * as Sentry from "@sentry/react";
|
import * as Sentry from "@sentry/react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { startTransition, StrictMode } from "react";
|
import { startTransition, StrictMode } from "react";
|
||||||
|
|
@ -27,6 +28,8 @@ Sentry.init({
|
||||||
enabled: import.meta.env.PROD && sentryEnvironment !== "ci",
|
enabled: import.meta.env.PROD && sentryEnvironment !== "ci",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
initI18n();
|
||||||
|
|
||||||
startTransition(() => {
|
startTransition(() => {
|
||||||
hydrateRoot(
|
hydrateRoot(
|
||||||
document,
|
document,
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,8 @@ import type { LinksFunction } from "react-router";
|
||||||
import type { Route } from "./+types/root";
|
import type { Route } from "./+types/root";
|
||||||
import * as Sentry from "@sentry/react";
|
import * as Sentry from "@sentry/react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { initI18n } from "@trails-cool/i18n";
|
|
||||||
import stylesheet from "@trails-cool/ui/styles.css?url";
|
import stylesheet from "@trails-cool/ui/styles.css?url";
|
||||||
|
|
||||||
initI18n();
|
|
||||||
|
|
||||||
export const links: LinksFunction = () => [{ rel: "stylesheet", href: stylesheet }];
|
export const links: LinksFunction = () => [{ rel: "stylesheet", href: stylesheet }];
|
||||||
|
|
||||||
export function Layout({ children }: { children: React.ReactNode }) {
|
export function Layout({ children }: { children: React.ReactNode }) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue