MCPcopy Index your code
hub / github.com/anomalyco/opencode / getLocale

Function getLocale

packages/app/src/entry.tsx:16–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14const DEFAULT_SERVER_URL_KEY = "opencode.settings.dat:defaultServerUrl"
15
16const getLocale = () => {
17 if (typeof navigator !== "object") return "en" as const
18 const languages = navigator.languages?.length ? navigator.languages : [navigator.language]
19 for (const language of languages) {
20 if (!language) continue
21 if (language.toLowerCase().startsWith("zh")) return "zh" as const
22 }
23 return "en" as const
24}
25
26const getRootNotFoundError = () => {
27 const key = "error.dev.rootNotFound" as const

Callers 1

getRootNotFoundErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected