managarten/apps-archived/memoro/apps/mobile/utils/languageDisplay.ts
Till-JS 61d181fbc2 chore: archive inactive projects to apps-archived/
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>
2025-11-29 07:03:59 +01:00

25 lines
966 B
TypeScript

import { TFunction } from 'react-i18next';
/**
* Formats language name for display showing frontend language name first, followed by native name
* @param languageCode - The language code (e.g., 'de', 'en', 'fr')
* @param nativeName - The native name of the language (e.g., 'Deutsch', 'English', 'Français')
* @param t - Translation function from useTranslation hook
* @returns Formatted language string (e.g., "German (Deutsch)" when interface is English)
*/
export function formatLanguageDisplay(
languageCode: string,
nativeName: string,
t: TFunction
): string {
// Get the translated language name in the current frontend language
const translatedName = t(`language.languages.${languageCode}`, nativeName);
// If the translated name is the same as native name, just return the native name
if (translatedName === nativeName) {
return nativeName;
}
// Return format: "TranslatedName (NativeName)"
return `${translatedName} (${nativeName})`;
}