MCPcopy Index your code
hub / github.com/angular/angular / $localize

Function $localize

packages/localize/src/localize/src/localize.ts:146–161  ·  view source on GitHub ↗
(
  messageParts: TemplateStringsArray,
  ...expressions: readonly any[]
)

Source from the content-addressed store, hash-verified

144 * @publicApi
145 */
146export const $localize: LocalizeFn = function (
147 messageParts: TemplateStringsArray,
148 ...expressions: readonly any[]
149) {
150 if ($localize.translate) {
151 // Don't use array expansion here to avoid the compiler adding `__read()` helper unnecessarily.
152 const translation = $localize.translate(messageParts, expressions);
153 messageParts = translation[0];
154 expressions = translation[1];
155 }
156 let message = stripBlock(messageParts[0], messageParts.raw[0]);
157 for (let i = 1; i < messageParts.length; i++) {
158 message += expressions[i - 1] + stripBlock(messageParts[i], messageParts.raw[i]);
159 }
160 return message;
161};
162
163const BLOCK_MARKER = ':';
164

Callers 15

localize_spec.tsFile · 0.90
duplicate.jsFile · 0.85
test.jsFile · 0.85
a.tsFile · 0.85
b.tsFile · 0.85
test.jsFile · 0.85
test-extra.jsFile · 0.85
translate_spec.tsFile · 0.85

Calls 2

stripBlockFunction · 0.85
translateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…