()
| 47 | } |
| 48 | |
| 49 | export function useI18n() { |
| 50 | const context = useContext(I18nContext); |
| 51 | if (!context) { |
| 52 | throw new Error("useI18n must be used within I18nProvider"); |
| 53 | } |
| 54 | return context; |
| 55 | } |
| 56 | |
| 57 | export function translate(language: SupportedLanguage, zh: string, en: string) { |
| 58 | return language === "en" ? en : zh; |
no outgoing calls
no test coverage detected