( messageParts: string[], placeholderNames: string[] = [], )
| 115 | * @param placeholderNames The names of the placeholders to intersperse between the `messageParts`. |
| 116 | */ |
| 117 | export 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. |
no test coverage detected
searching dependent graphs…