Ignore:
Timestamp:
01/30/26 01:40:27 (8 months ago)
Author:
Stefan-Saveski <stefansaveski19@…>
Branches:
master
Children:
ba52069
Parents:
298f9b3
Message:

Added dual language feature.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/app/students/semesters/page.tsx

    r298f9b3 r50f2fb4  
    1414import { useEffect, useState } from 'react';
    1515import { getAccessToken } from '@/lib/auth';
     16import { useTranslation } from 'react-i18next';
    1617
    1718type Semester = {
     
    5455
    5556const StatusBadge = ({ status }: { status: string }) => {
     57  const { t } = useTranslation();
    5658  const baseClasses = "px-2 py-1 rounded-full text-xs font-medium";
    57  
    58   if (status === "валиден") {
     59  if (status === t('valid')) {
    5960    return (
    6061      <span className={`${baseClasses} bg-green-100 text-green-800 flex items-center gap-1`}>
    6162        <FontAwesomeIcon icon={faCheckCircle} className="w-3 h-3" />
    62         {status}
     63        {t('valid')}
    6364      </span>
    6465    );
    6566  }
    66  
    6767  return (
    6868    <span className={`${baseClasses} bg-gray-100 text-gray-800`}>
    69       {status}
     69      {t(status) || status}
    7070    </span>
    7171  );
     
    7373
    7474const YesNoBadge = ({ value }: { value: string }) => {
    75   if (value === "Да") {
     75  const { t } = useTranslation();
     76  if (value === t('yes')) {
    7677    return (
    7778      <span className="inline-flex items-center justify-center w-6 h-6 bg-green-100 text-green-600 rounded-full">
     
    7980      </span>
    8081    );
    81   } else if (value === "Не") {
     82  } else if (value === t('no')) {
    8283    return (
    8384      <span className="inline-flex items-center justify-center w-6 h-6 bg-red-100 text-red-600 rounded-full">
     
    112113  const [isLoading, setIsLoading] = useState(true);
    113114  const [errorMessage, setErrorMessage] = useState<string | null>(null);
     115  const { t } = useTranslation();
    114116
    115117  useEffect(() => {
     
    162164      <div className="min-h-screen pb-8">
    163165        <div className="bg-white rounded-xl shadow-sm border border-gray-100 p-6">
    164           Loading...
     166          {t('loading')}
    165167        </div>
    166168      </div>
     
    187189          </div>
    188190          <div>
    189             <h1 className="text-3xl font-bold mb-2">Семестри</h1>
     191            <h1 className="text-3xl font-bold mb-2">{t('semesters')}</h1>
    190192            <p className="text-lg opacity-90">
    191               Преглед на сите запишани семестри и нивниот статус
     193              {t('semesters_overview')}
    192194            </p>
    193195          </div>
     
    198200      <div className="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
    199201        <div className="bg-primary text-white px-6 py-4">
    200           <h2 className="text-xl font-bold">Листа на семестри</h2>
     202          <h2 className="text-xl font-bold">{t('semesters_list')}</h2>
    201203        </div>
    202204       
     
    206208              <tr>
    207209                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">#</th>
    208                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Семестар</th>
    209                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Насока</th>
    210                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Квота</th>
    211                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Забелешка</th>
    212                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Студ.Ком.</th>
    213                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Сума</th>
    214                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Платено</th>
    215                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">УКИМ</th>
    216                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Креирано на</th>
    217                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Датум промена</th>
    218                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ц.Кр</th>
    219                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Тип</th>
    220                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Док.</th>
    221                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Док1.</th>
    222                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Вериф.</th>
    223                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Таксени</th>
    224                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Потписи</th>
    225                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Статус</th>
    226                 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Зав.</th>
     210                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('semester')}</th>
     211                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('direction')}</th>
     212                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('quota')}</th>
     213                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('note')}</th>
     214                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('student_com')}</th>
     215                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('sum')}</th>
     216                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('paid')}</th>
     217                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('ukim')}</th>
     218                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('created_on')}</th>
     219                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('date_changed')}</th>
     220                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('credits')}</th>
     221                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('type')}</th>
     222                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('doc')}</th>
     223                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('doc1')}</th>
     224                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('verified')}</th>
     225                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('taxes')}</th>
     226                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('signatures')}</th>
     227                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('status')}</th>
     228                <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('completed')}</th>
    227229              </tr>
    228230            </thead>
     
    335337            </div>
    336338            <div>
    337               <h3 className="text-lg font-bold text-gray-900">Завршени семестри</h3>
     339              <h3 className="text-lg font-bold text-gray-900">{t('completed_semesters')}</h3>
    338340              <p className="text-2xl font-bold text-green-600">
    339341                {semesters.filter(s => s.completed !== "Не").length}
     
    349351            </div>
    350352            <div>
    351               <h3 className="text-lg font-bold text-gray-900">Верифицирани</h3>
     353              <h3 className="text-lg font-bold text-gray-900">{t('verified_semesters')}</h3>
    352354              <p className="text-2xl font-bold text-blue-600">
    353355                {semesters.filter(s => s.verified === "Да").length}
     
    363365            </div>
    364366            <div>
    365               <h3 className="text-lg font-bold text-gray-900">Вкупно семестри</h3>
     367              <h3 className="text-lg font-bold text-gray-900">{t('total_semesters')}</h3>
    366368              <p className="text-2xl font-bold text-primary">
    367369                {semesters.length}
Note: See TracChangeset for help on using the changeset viewer.