Skip to content

Commit faa8b1f

Browse files
committed
Localization should work now
1 parent 2aef129 commit faa8b1f

40 files changed

Lines changed: 267 additions & 160 deletions

File tree

components/contact-popup/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Box, Button, Text, HStack, useColorModeValue } from "@chakra-ui/react"
22
import { useState } from "react"
3-
import { useTranslation } from "next-i18next"
3+
import { useTranslations } from "next-intl"
44

55
const ContactMailPopup = () => {
66
const [isVisible, setIsVisible] = useState(true)
7-
const { t } = useTranslation("about")
7+
const t = useTranslations("about")
88

99
const bg = useColorModeValue("white", "gray.800")
1010
const borderColor = useColorModeValue("gray.200", "gray.700")

components/course-card/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react"
22
import { Box, Flex, Text, useColorModeValue, HStack, Link, VStack, Divider, Tag } from "@chakra-ui/react"
33
import { motion } from "framer-motion"
44
import { ArrowRight, ArrowUpRight } from "lucide-react"
5-
import { useTranslation } from "next-i18next"
5+
import { useTranslations } from "next-intl"
66
import { CourseDegree } from "@/types/api"
77
import { getYearColor } from "@/utils/degree"
88

@@ -13,7 +13,7 @@ interface CourseCardProps {
1313
const MotionBox = motion(Box)
1414

1515
const CourseCard: React.FC<CourseCardProps> = ({ data }) => {
16-
const { t } = useTranslation("degree")
16+
const t = useTranslations("degree")
1717
const { course, year, semester } = data
1818

1919
const isDark = useColorModeValue(false, true)

components/degree-group-card/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react"
22
import { Box, Text, HStack, VStack, Stack, useColorModeValue } from "@chakra-ui/react"
33
import { motion } from "framer-motion"
44
import { ArrowRight, ArrowUpRight } from "lucide-react"
5-
import { useTranslation } from "next-i18next"
5+
import { useTranslations } from "next-intl"
66
import { Degree, Group } from "@/types/api"
77

88
interface DegreeGroupCardProps {
@@ -13,7 +13,7 @@ interface DegreeGroupCardProps {
1313
const MotionBox = motion(Box)
1414

1515
const DegreeGroupCard: React.FC<DegreeGroupCardProps> = ({ degree, group }) => {
16-
const { t } = useTranslation("degree")
16+
const t = useTranslations("degree")
1717

1818
const border = useColorModeValue("gray.200", "gray.700")
1919
const titleColor = useColorModeValue("white", "white")

components/empty-state/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Box, Text, VStack, useColorModeValue } from "@chakra-ui/react"
22
import { Inbox } from "lucide-react"
3-
import { useTranslation } from "next-i18next"
3+
import { useTranslations } from "next-intl"
44

55
interface EmptyStateProps {
66
label?: string
77
}
88

99
const EmptyState: React.FC<EmptyStateProps> = ({ label }) => {
10-
const { t } = useTranslation("common")
10+
const t = useTranslations("common")
1111
const textColor = useColorModeValue("gray.600", "gray.400")
1212
const borderColor = useColorModeValue("gray.200", "gray.700")
1313
const bg = useColorModeValue("gray.50", "gray.800")

components/footer/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Box, Flex, Text, Link, Stack, Divider, IconButton, useColorModeValue, Tooltip } from "@chakra-ui/react"
22
import { Facebook, Instagram, Github, Mail, Send, MessageCircle } from "lucide-react"
3-
import { useTranslation } from "next-i18next"
3+
import { useTranslations } from "next-intl"
44

55
const Footer = () => {
6-
const { t } = useTranslation("common")
6+
const t = useTranslations("common")
77

88
const bg = useColorModeValue("white", "gray.900")
99
const border = useColorModeValue("gray.200", "gray.700")

components/header/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Grid, GridItem, Tooltip, useDisclosure } from "@chakra-ui/react"
22
import { Box, HStack, IconButton, useColorMode, useColorModeValue, Link as ChakraLink } from "@chakra-ui/react"
33
import { HamburgerIcon, MoonIcon, SunIcon } from "@chakra-ui/icons"
44
import Link from "next/link"
5-
import { useTranslation } from "next-i18next"
5+
import { useTranslations } from "next-intl"
66
import LanguageSwitcher from "../language-switcher"
77
import Sidebar from "./partials/sidebar"
88
import { useRouter } from "next/router"
@@ -19,7 +19,7 @@ interface HeaderProps {
1919

2020
const Header = ({ enableHideOnScrollUp }: HeaderProps) => {
2121
const router = useRouter()
22-
const { t } = useTranslation("common")
22+
const t = useTranslations("common")
2323
const { isOpen, onOpen, onClose } = useDisclosure()
2424
const { colorMode, toggleColorMode } = useColorMode()
2525
const { pathname } = useRouter()

components/header/partials/sidebar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import SearchBar from "@/components/search-bar"
1919
import { useRouter } from "next/router"
2020
import { ArrowLeft } from "lucide-react"
2121
import LanguageSwitcher from "@/components/language-switcher"
22-
import { useTranslation } from "next-i18next"
22+
import { useTranslations } from "next-intl"
2323

2424
interface SidebarProps {
2525
isOpen: boolean
@@ -29,7 +29,7 @@ interface SidebarProps {
2929

3030
const Sidebar = ({ isOpen, onClose, navItems }: SidebarProps) => {
3131
const router = useRouter()
32-
const { t } = useTranslation("common")
32+
const t = useTranslations("common")
3333

3434
const bg = useColorModeValue("white", "gray.900")
3535
const textColor = useColorModeValue("gray.700", "whiteAlpha.900")

components/info-cards/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Box, Flex, Heading, Text, Tag, IconButton, useColorModeValue, Image, SimpleGrid, Stack, LinkBox, LinkOverlay } from "@chakra-ui/react"
22
import { ArrowUpRight } from "lucide-react"
3-
import { useTranslation } from "next-i18next"
3+
import { useTranslations } from "next-intl"
44

55
const ResourceCards = () => {
6-
const { t } = useTranslation("common")
6+
const t = useTranslations("common")
77
const cardBg = useColorModeValue("gray.50", "gray.700")
88
const tagBg = useColorModeValue("white", "gray.700")
99
const tagBorder = useColorModeValue("gray.300", "gray.600")

components/privacy/popup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Box, VStack, Text, HStack, Button, Link, useColorModeValue, Fade } from "@chakra-ui/react"
22
import { usePrivacyStore } from "@/store/privacy"
33
import { useEffect } from "react"
4-
import { useTranslation } from "next-i18next"
4+
import { useTranslations } from "next-intl"
55

66
const PrivacyPopup: React.FC = () => {
77
const { initialized, showPopup, init, accept, decline } = usePrivacyStore()
8-
const { t } = useTranslation("common")
8+
const t = useTranslations("common")
99

1010
const bg = useColorModeValue("white", "gray.800")
1111
const textColor = useColorModeValue("gray.700", "gray.200")

components/search-bar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState, useEffect, useRef } from "react"
22
import { InputGroup, InputLeftElement, Input, VStack, Text, useColorModeValue, InputRightElement, Button, Fade, StackProps } from "@chakra-ui/react"
33
import { Search } from "lucide-react"
44
import { useRouter } from "next/router"
5-
import { useTranslation } from "next-i18next"
5+
import { useTranslations } from "next-intl"
66

77
interface SearchBarProps extends StackProps {
88
enableLabel?: boolean
@@ -13,7 +13,7 @@ interface SearchBarProps extends StackProps {
1313

1414
const SearchBar = ({ enableLabel = true, sidebarMode = false, onSearch, focusOnOpen = false, ...props }: SearchBarProps) => {
1515
const router = useRouter()
16-
const { t } = useTranslation("common")
16+
const t = useTranslations("common")
1717
const inputRef = useRef<HTMLInputElement>(null)
1818

1919
const [query, setQuery] = useState("")

0 commit comments

Comments
 (0)