Pay-then-profile join desk with live card, S3 upload fallback, hydration-safe drafts; document on test9 README. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
654 B
TypeScript
21 lines
654 B
TypeScript
import { SOCIAL_PHRASES_EN } from "./phrases";
|
|
import type { SocialLocale } from "./i18n";
|
|
|
|
let activeLocale: SocialLocale = "zh";
|
|
|
|
/** Sync from SocialExperience / useSocialI18n so nested helpers can translate without hooks. */
|
|
export function setSocialTxLocale(locale: SocialLocale) {
|
|
activeLocale = locale;
|
|
}
|
|
|
|
export function getSocialTxLocale(): SocialLocale {
|
|
return activeLocale;
|
|
}
|
|
|
|
/** Translate a Chinese UI string when active locale is English. */
|
|
export function socialTx(zh: string, en?: string): string {
|
|
if (activeLocale === "zh") return zh;
|
|
if (en) return en;
|
|
return SOCIAL_PHRASES_EN[zh] || SOCIAL_PHRASES_EN[zh.trim()] || zh;
|
|
}
|