init commit

This commit is contained in:
rxliuli
2025-11-04 05:03:50 +08:00
commit bce557cc2d
1396 changed files with 172991 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
/* istanbul ignore file */
//TODO rdar://93379311 (Solution for sharing context between app + shared components)
import { getContext, setContext } from 'svelte';
import type { Locale } from '@amp/web-app-components/src/types';
const CONTEXT_NAME = 'shared:locale';
// WARNING these signatures can change after rdar://93379311
export function setLocale(context: Map<string, unknown>, locale: Locale) {
context.set(CONTEXT_NAME, locale);
}
// WARNING these signatures can change after rdar://93379311
export function getLocale(): Locale {
return getContext(CONTEXT_NAME) as Locale | undefined;
}