MCPcopy Create free account
hub / github.com/angular/angular / makeParsedTranslation

Function makeParsedTranslation

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

Source from the content-addressed store, hash-verified

119 * @param placeholderNames The names of the placeholders to intersperse between the `messageParts`.
120 */
121export function makeParsedTranslation(
122 messageParts: string[],
123 placeholderNames: string[] = [],
124): ParsedTranslation {
125 let messageString = messageParts[0];
126 for (let i = 0; i < placeholderNames.length; i++) {
127 messageString += `{$${placeholderNames[i]}}${messageParts[i + 1]}`;
128 }
129 return {
130 text: messageString,
131 messageParts: makeTemplateObject(messageParts, messageParts),
132 placeholderNames,
133 };
134}
135
136/**
137 * 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