MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / localizeDefault

Function localizeDefault

src/resolution/frameworks/angular-router.ts:118–125  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

116
117/** A `$localize` tagged template's default text: `` $localize`:kebab-case@@routes.about:about` `` is `about`. */
118export function localizeDefault(text: string): string | null {
119 const m = /^\$localize\s*`((?:[^`\\$]|\\.)*)`$/.exec(text.trim());
120 if (!m) return null;
121 const body = m[1]!;
122 // `:meaning|description@@id:text` — the metadata block is the leading `:…:`.
123 const meta = /^:[^:]*:/.exec(body);
124 return meta ? body.slice(meta[0].length) : body;
125}
126
127/**
128 * A string written statically: a literal, a `$localize` default, or `+`

Callers 2

staticStringFunction · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected