Skip to content

Commit

Permalink
chore: remove deprecated language updater
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed Aug 27, 2024
1 parent da936a3 commit e0e9d5e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
4 changes: 0 additions & 4 deletions lib/i18n/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ import { loadResources } from "./index";

const runsOnServerSide = typeof window === "undefined";

export const updateI18n = (lang) => {
i18n.language !== lang && i18n.changeLanguage(lang);
};

i18n
.use(initReactI18next) // passes i18n down to react-i18next
.use(LanguageDetector)
Expand Down
3 changes: 0 additions & 3 deletions pages/[locale]/[[...uriSegments]].js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import internalLinkShape, {
import siteInfoShape from "@/shapes/siteInfo";
import footerContentShape from "@/shapes/footerContent";
import rootPagesShape from "@/shapes/rootPages";
import { updateI18n } from "@/lib/i18n/client";
import { setEdcLog } from "@/lib/edc-log";
import { purgeNextjsStaticFiles } from "@/lib/purgeStaticFiles";
const glob = require("glob");
Expand Down Expand Up @@ -61,8 +60,6 @@ function logNextDir() {

const GOOGLE_APP_ID = process.env.NEXT_PUBLIC_GOOGLE_APP_ID;
export default function Page({ section, globalData, ...entryProps }) {
globalData.localeInfo.locale === "es" ? updateI18n("es") : updateI18n("en");

const sectionMap = {
events: EventPageTemplate,
galleryItems: GalleryPageTemplate,
Expand Down
2 changes: 0 additions & 2 deletions pages/_error.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useEffect, useState } from "react";
import PropTypes from "prop-types";
import { useGlobalData } from "@/lib/api/global";
import { updateI18n } from "@/lib/i18n/client";
import { GlobalDataProvider } from "@/contexts/GlobalData";
import ErrorPageTemplate from "@/components/templates/ErrorPage";
import { useTranslation } from "react-i18next";
Expand All @@ -11,7 +10,6 @@ export default function Error({ statusCode }) {
let globalData = {};
const [lang, setLang] = useState("en");
const [error, setError] = useState("page-not-found");
updateI18n(lang);
const { t } = useTranslation();
const errorData = {
title: t(`${error}-title`),
Expand Down

0 comments on commit e0e9d5e

Please sign in to comment.