mirror of
https://github.com/Lapikud/lapikud.github.io.git
synced 2026-08-08 16:29:14 +00:00
84 lines
2.4 KiB
JavaScript
84 lines
2.4 KiB
JavaScript
// ADD PAGES HERE TO REGISTER ROUTES
|
|
// examples: '/page', '/page/:id'
|
|
|
|
import Home from './Home.svelte'
|
|
import Student from './Student.svelte'
|
|
import Mentors from './Mentors.svelte'
|
|
import Helpdesk from './Helpdesk.svelte'
|
|
import OurWork from './OurWork.svelte'
|
|
import AboutUs from './AboutUs.svelte'
|
|
import Contact from './Contact.svelte'
|
|
import Managment from './Managment.svelte'
|
|
import Striim from './Striim.svelte'
|
|
import Calendar from './Calendar.svelte'
|
|
|
|
// Route mapping for language switching
|
|
export const routeMap = {
|
|
// Home
|
|
'/': { est: '/', en: '/' },
|
|
|
|
// Student/Tudengile
|
|
'/tudengile': { est: '/tudengile', en: '/student' },
|
|
'/student': { est: '/tudengile', en: '/student' },
|
|
|
|
// Mentors/Mentorid
|
|
'/mentorid': { est: '/mentorid', en: '/mentors' },
|
|
'/mentors': { est: '/mentorid', en: '/mentors' },
|
|
|
|
// Helpdesk
|
|
'/helpdesk': { est: '/helpdesk', en: '/helpdesk' },
|
|
|
|
// OurWork/Ettevõttele
|
|
'/ettevottele': { est: '/ettevottele', en: '/ourwork' },
|
|
'/ourwork': { est: '/ettevottele', en: '/ourwork' },
|
|
|
|
// AboutUs/Lapikutest
|
|
'/lapikutest': { est: '/lapikutest', en: '/aboutus' },
|
|
'/aboutus': { est: '/lapikutest', en: '/aboutus' },
|
|
|
|
// Contact/Kontakt
|
|
'/kontakt': { est: '/kontakt', en: '/contact' },
|
|
'/contact': { est: '/kontakt', en: '/contact' },
|
|
|
|
// Juhatus/Managment
|
|
'/juhatus': { est: '/juhatus', en: '/management' },
|
|
'/management': { est: '/juhatus', en: '/management' },
|
|
};
|
|
|
|
// Detect language from route
|
|
export function getLanguageFromRoute(path) {
|
|
const estRoutes = ['/tudengile', '/mentorid', '/ettevottele', '/lapikutest', '/kontakt'];
|
|
const enRoutes = ['/student', '/mentors', '/ourwork', '/aboutus', '/contact'];
|
|
|
|
if (estRoutes.includes(path)) return 'est';
|
|
if (enRoutes.includes(path)) return 'en';
|
|
|
|
// Default to Estonian
|
|
return 'est';
|
|
}
|
|
|
|
// Get translated route
|
|
export function getTranslatedRoute(currentPath, targetLang) {
|
|
const mapping = routeMap[currentPath];
|
|
if (!mapping) return currentPath;
|
|
return mapping[targetLang] || currentPath;
|
|
}
|
|
|
|
export const routes = {
|
|
'/': Home,
|
|
'/tudengile': Student,
|
|
'/student': Student,
|
|
'/mentorid': Mentors,
|
|
'/mentors': Mentors,
|
|
'/helpdesk': Helpdesk,
|
|
'/ettevottele': OurWork,
|
|
'/ourwork': OurWork,
|
|
'/lapikutest': AboutUs,
|
|
'/aboutus': AboutUs,
|
|
'/kontakt': Contact,
|
|
'/contact': Contact,
|
|
'/juhatus': Managment,
|
|
'/management': Managment,
|
|
'/striim': Striim,
|
|
'/kalender': Calendar,
|
|
} |