( messageParts: string[], placeholderNames: string[] = [], )
| 119 | * @param placeholderNames The names of the placeholders to intersperse between the `messageParts`. |
| 120 | */ |
| 121 | export 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. |
no test coverage detected