mirror of
https://github.com/mleem97/gregWiki.git
synced 2026-04-11 03:29:19 +02:00
Merge Docusaurus site: all content under docs/, align with gregFramework split layout
- Move markdown and wiki-import tree into docs/; keep app shell at repo root - Point docusaurus docs path to docs/; edit links to mleem97/gregWiki - Sync and i18n scripts use gregWiki root and ../.wiki under gregFramework - Sidebars: workspace layout from root docs ids; plugins under mods/extensions - Fix redirects, module catalog URLs, release note paths, and wiki-import category keys - Update repo inventory for split repos; Dockerfile for single-repo context Made-with: Cursor
This commit is contained in:
33
src/i18n/homepage/index.ts
Normal file
33
src/i18n/homepage/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { de } from './de';
|
||||
import { en } from './en';
|
||||
import { es } from './es';
|
||||
import { fr } from './fr';
|
||||
import { ja } from './ja';
|
||||
import { ru } from './ru';
|
||||
import type { HomepageContent, LocaleKey } from './types';
|
||||
|
||||
const homepageByLocale: Record<LocaleKey, HomepageContent> = {
|
||||
en,
|
||||
de,
|
||||
fr,
|
||||
es,
|
||||
ru,
|
||||
ja,
|
||||
};
|
||||
|
||||
export type { HomepageContent, LocaleKey } from './types';
|
||||
|
||||
export function getHomepageContent(locale: string): HomepageContent {
|
||||
const normalizedLocale = (locale || 'en').toLowerCase();
|
||||
const languageOnly = normalizedLocale.split('-')[0] as LocaleKey;
|
||||
|
||||
if (normalizedLocale in homepageByLocale) {
|
||||
return homepageByLocale[normalizedLocale as LocaleKey];
|
||||
}
|
||||
|
||||
if (languageOnly in homepageByLocale) {
|
||||
return homepageByLocale[languageOnly];
|
||||
}
|
||||
|
||||
return homepageByLocale.en;
|
||||
}
|
||||
Reference in New Issue
Block a user