mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 04:41:09 +02:00
Move inactive projects out of active workspace: - bauntown (community website) - maerchenzauber (AI story generation) - memoro (voice memo app) - news (news aggregation) - nutriphi (nutrition tracking) - reader (reading app) - uload (URL shortener) - wisekeep (AI wisdom extraction) Update CLAUDE.md documentation: - Add presi to active projects - Document archived projects section - Update workspace configuration Archived apps can be re-activated by moving back to apps/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
61 lines
2 KiB
TypeScript
61 lines
2 KiB
TypeScript
import { AZURE_SUPPORTED_LANGUAGES } from '~/features/audioRecordingV2';
|
|
|
|
/**
|
|
* Maps language codes to readable language names
|
|
* @param languageCode - The language code (e.g., "de-DE", "en-US", "de")
|
|
* @returns The readable language name (e.g., "Deutsch", "English")
|
|
*/
|
|
export function getLanguageDisplayName(languageCode: string): string {
|
|
if (!languageCode || languageCode === 'unknown') {
|
|
return 'unknown';
|
|
}
|
|
|
|
// Check for exact match first (e.g., "de-DE")
|
|
const exactMatch = Object.entries(AZURE_SUPPORTED_LANGUAGES).find(
|
|
([_, value]) => value.locale === languageCode
|
|
);
|
|
if (exactMatch) {
|
|
return exactMatch[1].nativeName;
|
|
}
|
|
|
|
// Check for partial match (e.g., "de" matches "de-DE")
|
|
const partialMatch = Object.entries(AZURE_SUPPORTED_LANGUAGES).find(
|
|
([key, value]) => languageCode.startsWith(key) || value.locale.startsWith(languageCode)
|
|
);
|
|
if (partialMatch) {
|
|
return partialMatch[1].nativeName;
|
|
}
|
|
|
|
// Fallback: return the language code as-is
|
|
return languageCode;
|
|
}
|
|
|
|
/**
|
|
* Maps language codes to readable language names with emoji
|
|
* @param languageCode - The language code (e.g., "de-DE", "en-US", "de")
|
|
* @returns The readable language name with emoji (e.g., "🇩🇪 Deutsch", "🇺🇸 English")
|
|
*/
|
|
export function getLanguageDisplayNameWithEmoji(languageCode: string): string {
|
|
if (!languageCode || languageCode === 'unknown') {
|
|
return 'unknown';
|
|
}
|
|
|
|
// Check for exact match first (e.g., "de-DE")
|
|
const exactMatch = Object.entries(AZURE_SUPPORTED_LANGUAGES).find(
|
|
([_, value]) => value.locale === languageCode
|
|
);
|
|
if (exactMatch) {
|
|
return `${exactMatch[1].emoji} ${exactMatch[1].nativeName}`;
|
|
}
|
|
|
|
// Check for partial match (e.g., "de" matches "de-DE")
|
|
const partialMatch = Object.entries(AZURE_SUPPORTED_LANGUAGES).find(
|
|
([key, value]) => languageCode.startsWith(key) || value.locale.startsWith(languageCode)
|
|
);
|
|
if (partialMatch) {
|
|
return `${partialMatch[1].emoji} ${partialMatch[1].nativeName}`;
|
|
}
|
|
|
|
// Fallback: return the language code as-is
|
|
return languageCode;
|
|
}
|