| |
| |
| |
| |
|
|
| import { getCurrentLanguage } from './i18n-lite'; |
| import homeContentEn from '../../content/home.en.html'; |
| import homeContentZh from '../../content/home.zh.html'; |
|
|
| interface ContentMap { |
| en: string; |
| zh: string; |
| } |
|
|
| const homeContent: ContentMap = { |
| en: homeContentEn, |
| zh: homeContentZh |
| }; |
|
|
| |
| |
| |
| export function getHomeContent(): string { |
| const lang = getCurrentLanguage(); |
| return homeContent[lang] || homeContent.en; |
| } |
|
|
| |
| |
| |
| |
| export function loadHomeContent(containerId: string): void { |
| const container = document.getElementById(containerId); |
| if (!container) { |
| console.error(`Container element with id "${containerId}" not found`); |
| return; |
| } |
| |
| const content = getHomeContent(); |
| container.innerHTML = content; |
| } |
|
|