fix(context): add expo-font dependency and fix TypeScript issues

- Add expo-font package for font loading
- Fix various TypeScript type issues in components
- Update i18n utilities

Note: Some TypeScript errors remain and will be addressed in follow-up.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-12-05 15:30:31 +01:00
parent dbf5745c0e
commit 86a6ff23c7
11 changed files with 7919 additions and 5285 deletions

View file

@ -2,7 +2,7 @@ export function debounce<T extends (...args: any[]) => any>(
func: T,
wait: number,
options?: { leading?: boolean; trailing?: boolean }
): (...args: Parameters<T>) => void {
): ((...args: Parameters<T>) => void) & { cancel: () => void } {
let timeout: NodeJS.Timeout | null = null;
let result: any;

View file

@ -26,7 +26,8 @@ const resources = {
// Get device language, fallback to English if not supported
function getDeviceLanguage(): SupportedLanguage {
try {
const locale = Localization.locale;
const locales = Localization.getLocales();
const locale = locales[0]?.languageTag;
if (!locale) return 'en';
const languageCode = locale.split('-')[0] as SupportedLanguage;
@ -91,11 +92,13 @@ export const isLanguageSupported = (code: string): code is SupportedLanguage =>
// Helper function to get device locale info
export const getDeviceLocaleInfo = () => {
const locales = Localization.getLocales();
const calendars = Localization.getCalendars();
return {
locale: Localization.locale,
locales: Localization.locales,
timezone: Localization.timezone,
isRTL: Localization.isRTL,
region: Localization.region,
locale: locales[0]?.languageTag,
locales: locales.map((l) => l.languageTag),
timezone: calendars[0]?.timeZone,
isRTL: locales[0]?.textDirection === 'rtl',
region: locales[0]?.regionCode,
};
};