MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / formatLanguage

Function formatLanguage

src/shared/language.ts:36–43  ·  view source on GitHub ↗
(vscodeLocale: string)

Source from the content-addressed store, hash-verified

34 */
35
36export function formatLanguage(vscodeLocale: string): Language {
37 if (!vscodeLocale) {
38 return "en"
39 }
40
41 const formattedLocale = vscodeLocale.replace(/-(\w+)$/, (_, region) => `-${region.toUpperCase()}`)
42 return isLanguage(formattedLocale) ? formattedLocale : "en"
43}

Callers 6

activateFunction · 0.90
getEnvironmentDetailsFunction · 0.90
getStateMethod · 0.90
generatePromptFunction · 0.90
language.spec.tsFile · 0.90

Calls 2

isLanguageFunction · 0.90
replaceMethod · 0.65

Tested by

no test coverage detected