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

Function useLanguageMock

packages/app/src/utils/server-errors.test.ts:15–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13}
14
15function useLanguageMock() {
16 const dict: Record<string, string> = {
17 "error.chain.unknown": "Erro desconhecido",
18 "error.chain.configInvalid": "Arquivo de config em {{path}} invalido",
19 "error.chain.configInvalidWithMessage": "Arquivo de config em {{path}} invalido: {{message}}",
20 "error.chain.modelNotFound": "Modelo nao encontrado: {{provider}}/{{model}}",
21 "error.chain.didYouMean": "Voce quis dizer: {{suggestions}}",
22 "error.chain.checkConfig": "Revise provider/model no config",
23 }
24 return {
25 t(key: string, vars?: Record<string, string | number>) {
26 const text = dict[key]
27 if (!text) return key
28 return fill(text, vars)
29 },
30 }
31}
32
33const language = useLanguageMock()
34

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected