MCPcopy Index your code
hub / github.com/angular/angular / makeParsedTranslation

Function makeParsedTranslation

packages/localize/src/utils/src/translations.ts:117–130  ·  view source on GitHub ↗
(
  messageParts: string[],
  placeholderNames: string[] = [],
)

Source from the content-addressed store, hash-verified

115 * @param placeholderNames The names of the placeholders to intersperse between the `messageParts`.
116 */
117export function makeParsedTranslation(
118 messageParts: string[],
119 placeholderNames: string[] = [],
120): ParsedTranslation {
121 let messageString = messageParts[0];
122 for (let i = 0; i < placeholderNames.length; i++) {
123 messageString += `{$${placeholderNames[i]}}${messageParts[i + 1]}`;
124 }
125 return {
126 text: messageString,
127 messageParts: makeTemplateObject(messageParts, messageParts),
128 placeholderNames,
129 };
130}
131
132/**
133 * Create the specialized array that is passed to tagged-string tag functions.

Callers 1

Calls 1

makeTemplateObjectFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…