From 0a3894e14dea48d79a60f11eb60161d4052de607 Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Tue, 22 Jul 2025 02:05:19 +0200 Subject: [PATCH] temporarily remove english translation the site would not build due to some weird issue I have yet to figure out. temporarily removing all english translations fixes it however. I am probably migrating the site away from gatsby anyway so a temp fix is fine --- gatsby-config.js | 28 +- package.json | 5 - src/components/items/back.js | 5 +- src/components/items/languageSelector.js | 42 - .../items/languageSelector.module.css | 24 - src/components/items/memberButton.js | 6 +- src/components/items/otherButton.js | 32 +- src/components/sections/about.js | 26 +- src/components/sections/boardMembers.js | 12 +- src/components/sections/contact.js | 16 +- src/components/sections/events.js | 27 +- src/components/sections/footer.js | 22 +- src/components/sections/header.js | 9 +- src/components/sections/office.js | 18 +- src/components/seo.js | 9 +- src/locales/en/404.json | 5 - src/locales/en/altText.json | 6 - src/locales/en/common.json | 6 - src/locales/en/index.json | 22 - src/locales/en/seo.json | 5 - src/pages/404.js | 28 +- src/pages/eventPost.js | 25 +- src/pages/index.js | 25 +- yarn.lock | 2757 ++++++++--------- 24 files changed, 1428 insertions(+), 1732 deletions(-) delete mode 100644 src/components/items/languageSelector.js delete mode 100644 src/components/items/languageSelector.module.css delete mode 100644 src/locales/en/404.json delete mode 100644 src/locales/en/altText.json delete mode 100644 src/locales/en/common.json delete mode 100644 src/locales/en/index.json delete mode 100644 src/locales/en/seo.json diff --git a/gatsby-config.js b/gatsby-config.js index 1ebc416..128ae82 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -21,33 +21,7 @@ module.exports = { path: `${__dirname}/src/images`, }, }, - { - resolve: `gatsby-source-filesystem`, - options: { - path: `${__dirname}/src/locales`, - name: `locale`, - }, - }, - { - resolve: `gatsby-plugin-react-i18next`, - options: { - localeJsonSourceName: `locale`, // name given to `gatsby-source-filesystem` plugin. - languages: [`en`, `no`], - defaultLanguage: `no`, - siteUrl: `https://uiogaming.no`, - // if you are using trailingSlash gatsby config include it here, as well (the default is 'always') - trailingSlash: "always", - // you can pass any i18next options - i18nextOptions: { - interpolation: { - escapeValue: false, // not needed for react as it escapes by default - }, - keySeparator: false, - nsSeparator: false, - }, - pages: [], - }, - }, + // Removed locale and i18n plugins `gatsby-transformer-sharp`, `gatsby-plugin-sharp`, { diff --git a/package.json b/package.json index 87ee611..54efc9d 100644 --- a/package.json +++ b/package.json @@ -11,21 +11,16 @@ "gatsby-plugin-image": "^3.14.0", "gatsby-plugin-manifest": "^5.14.0", "gatsby-plugin-react-helmet": "^6.14.0", - "gatsby-plugin-react-i18next": "^3.0.1", "gatsby-plugin-sharp": "^5.14.0", "gatsby-source-filesystem": "^5.14.0", "gatsby-source-sanity": "^7.9.1", "gatsby-transformer-sharp": "^5.14.0", - "i18next": "^23.16.4", - "i18next-browser-languagedetector": "^8.0.0", - "i18next-http-backend": "^2.6.2", "path": "^0.12.7", "path-browserify": "^1.0.1", "prop-types": "^15.8.1", "react": "^18.3.1", "react-dom": "^18.3.1", "react-helmet": "^6.1.0", - "react-i18next": "^15.1.1", "react-icons": "^5.3.0", "react-pannellum": "^0.2.16" }, diff --git a/src/components/items/back.js b/src/components/items/back.js index e7d8883..7929a45 100644 --- a/src/components/items/back.js +++ b/src/components/items/back.js @@ -4,18 +4,15 @@ import * as styles from "./back.module.css" import { graphql } from "gatsby" import { FaArrowLeft } from "react-icons/fa" -import { useTranslation } from "gatsby-plugin-react-i18next" const Back = () => { - const { t } = useTranslation() - return ( ) } diff --git a/src/components/items/languageSelector.js b/src/components/items/languageSelector.js deleted file mode 100644 index 556b4c1..0000000 --- a/src/components/items/languageSelector.js +++ /dev/null @@ -1,42 +0,0 @@ -import * as React from "react" -import * as styles from "./languageSelector.module.css" - -import { NO, GB } from "country-flag-icons/react/3x2" -import { useTranslation, useI18next } from "gatsby-plugin-react-i18next" - -const LanguageSelector = () => { - const { languages, changeLanguage } = useI18next() - const { t, i18n } = useTranslation() - - if (i18n.language === "no") { - return ( - { - e.preventDefault() - changeLanguage("en") - }} - > - - English - - ) - } else { - return ( - { - e.preventDefault() - changeLanguage("no") - }} - > - - Norsk - - ) - } -} - -export default LanguageSelector diff --git a/src/components/items/languageSelector.module.css b/src/components/items/languageSelector.module.css deleted file mode 100644 index d919919..0000000 --- a/src/components/items/languageSelector.module.css +++ /dev/null @@ -1,24 +0,0 @@ -.button { - display: flex; - gap: 0.25rem; - - position: fixed; - top: 0.5rem; - right: 0.5rem; - z-index: 0; - - background: pink; - color: black; - border: 1px solid black; - font-size: 1.1rem; - border-radius: 0.5rem; - padding-inline: 0.5em; -} -.button:hover { - background: #ff7b7b; - color: white; -} - -.flag { - width: 1.2rem; -} diff --git a/src/components/items/memberButton.js b/src/components/items/memberButton.js index 296f60f..0121637 100644 --- a/src/components/items/memberButton.js +++ b/src/components/items/memberButton.js @@ -1,11 +1,7 @@ import * as React from "react" import * as styles from "./memberButton.module.css" -import { useTranslation } from "gatsby-plugin-react-i18next" - const MemberButton = () => { - const { t } = useTranslation() - return ( { rel="noreferrer" className={styles.button} > - {t("join")} + Bli medlem ) } diff --git a/src/components/items/otherButton.js b/src/components/items/otherButton.js index 6ff1383..0a39da8 100644 --- a/src/components/items/otherButton.js +++ b/src/components/items/otherButton.js @@ -1,38 +1,32 @@ import * as React from "react" import * as styles from "./otherButton.module.css" -import { useTranslation } from "gatsby-plugin-react-i18next" -import { useState } from 'react'; +import { useState } from "react" const OtherButton = () => { - const [isOpen, setIsOpen] = useState(false); - const toggleDropdown = () => setIsOpen(!isOpen); - const { t, i18n } = useTranslation(); - - const statutesUrl = - i18n.language === "en" - ? "https://statutes.uiogaming.no" - : "https://vedtekter.uiogaming.no" + const [isOpen, setIsOpen] = useState(false) + const toggleDropdown = () => setIsOpen(!isOpen) const links = [ - { url: statutesUrl, label: t("footer.statutes") }, - { url: "https://klage.uiogaming.no", label: t("footer.complaints") }, - { url: "https://github.com/UiO-Gaming/dokumenter", label: t("documents") } + { url: "https://vedtekter.uiogaming.no", label: "Vedtekter" }, + { url: "https://klage.uiogaming.no", label: "Klage" }, + { url: "https://github.com/UiO-Gaming/dokumenter", label: "Dokumenter" }, ] return (
{isOpen && (
{links.map((link, index) => ( @@ -40,7 +34,7 @@ const OtherButton = () => {
)}
- ); -}; + ) +} -export default OtherButton; \ No newline at end of file +export default OtherButton diff --git a/src/components/sections/about.js b/src/components/sections/about.js index 449cbfc..4e8a378 100644 --- a/src/components/sections/about.js +++ b/src/components/sections/about.js @@ -3,7 +3,6 @@ import * as styles from "./about.module.css" import { graphql, useStaticQuery } from "gatsby" import { GatsbyImage } from "gatsby-plugin-image" -import { useTranslation } from "gatsby-plugin-react-i18next" import DiscordButton from "../items/discordButton" import MemberButton from "../items/memberButton" @@ -24,30 +23,35 @@ const About = () => { } `) - const { t } = useTranslation() - return (
-

- {t("photo")}: 장태민, Studentenes Fotoklubb -

+

Foto: 장태민, Studentenes Fotoklubb

-

{t("about.title")}

+

Hvem er vi?

-

{t("about.text")}

+

+ UiO Gaming er en forening med hovedfokus på å danne et + inkluderende fellesskap rundt videospill og e-sport. Hos oss er + det enkelt å skaffe seg venner, ettersom alle har felles + interesser. Vi arrangerer ukentlige spillkvelder og fysiske + sosiale arrangementer, som for eksempel brettspillkvelder og + sosiale sammenkomster. Vår hovedkanal er en aktiv Discord-server + hvor man kan møte nye folk med felles interesser og game med andre + studenter. +

-

{t("about.interested")}

+

Interessert?

- +
diff --git a/src/components/sections/boardMembers.js b/src/components/sections/boardMembers.js index 8984eb4..2eee3da 100644 --- a/src/components/sections/boardMembers.js +++ b/src/components/sections/boardMembers.js @@ -3,10 +3,8 @@ import * as styles from "./boardMembers.module.css" import { graphql, useStaticQuery } from "gatsby" import { GatsbyImage } from "gatsby-plugin-image" -import { useTranslation } from "gatsby-plugin-react-i18next" const BoardMembers = () => { - const { t, i18n } = useTranslation(); const data = useStaticQuery(graphql` query { allSanityAuthor( @@ -40,7 +38,7 @@ const BoardMembers = () => { return (
-

{t("boardMembers.title")}

+

Styret

{data.allSanityAuthor.edges.map(({ node: member }) => (
@@ -51,21 +49,21 @@ const BoardMembers = () => {

{member.name}

-

{member.role[i18n.language]}

+

{member.role.no}

-

{member.bio[i18n.language]}

+

{member.bio.no}

{member.contactInfo ? ( member.contactInfo ) : ( - {t("boardMembers.noContact")} + Ingen kontaktinfo )}

diff --git a/src/components/sections/contact.js b/src/components/sections/contact.js index 64c5394..c45053b 100644 --- a/src/components/sections/contact.js +++ b/src/components/sections/contact.js @@ -1,8 +1,6 @@ import * as React from "react" import * as styles from "./contact.module.css" -import { useTranslation } from "gatsby-plugin-react-i18next" - import { FaYoutube, FaTwitch, @@ -11,20 +9,18 @@ import { FaDiscord, FaAt, FaInstagram, - FaTiktok + FaTiktok, } from "react-icons/fa" const Contact = () => { - const { t } = useTranslation() - return (
-

{t("contact.title")}

+

Finn oss

@@ -37,7 +33,7 @@ const Contact = () => { Discord
-
+ -
+ -
+
{ } `) - const { t, i18n } = useTranslation() - const currentDate = new Date() const filteredEvents = data.allSanityEvent.edges .filter(({ node: event }) => { @@ -59,7 +57,7 @@ const Events = () => {

- {new Date(event.date).toLocaleString(i18n.language, { + {new Date(event.date).toLocaleString("no", { weekday: "long", month: "long", year: "numeric", @@ -77,9 +75,7 @@ const Events = () => { ) : ( <> {event.description.substring(0, 120)}...{" "} - - {t("events.readMore")} - + Les mer )}

@@ -87,31 +83,22 @@ const Events = () => { )) } else { - return ( -

- {t("events.noEvents")} -
-
- (っ˘̩╭╮˘̩)っ -

- ) + return

Ingen kommende arrangementer

} } return (
-

{t("events.title")}

+

Hva skjer?

{mapEvents(filteredEvents)}
-

- {t("photo")}: 장태민, Studentenes Fotoklubb -

+

Foto: 장태민, Studentenes Fotoklubb

diff --git a/src/components/sections/footer.js b/src/components/sections/footer.js index 284d19f..1f186d6 100644 --- a/src/components/sections/footer.js +++ b/src/components/sections/footer.js @@ -3,7 +3,6 @@ import * as styles from "./footer.module.css" import { graphql, useStaticQuery } from "gatsby" import { GatsbyImage } from "gatsby-plugin-image" -import { useTranslation } from "gatsby-plugin-react-i18next" const Footer = () => { const data = useStaticQuery(graphql` @@ -20,13 +19,6 @@ const Footer = () => { } `) - const { t, i18n } = useTranslation() - - const statutesUrl = - i18n.language === "en" - ? "https://statutes.uiogaming.no" - : "https://vedtekter.uiogaming.no" - return (