| 308 | const SINGLE_BRACE_RE = /(?<!\{)\{([a-zA-Z_][a-zA-Z0-9_]*)\}(?!\})/g; |
| 309 | |
| 310 | function findSingleBracePlaceholders(obj, path = "") { |
| 311 | const issues = []; |
| 312 | if (obj && typeof obj === "object" && !Array.isArray(obj)) { |
| 313 | for (const [k, v] of Object.entries(obj)) { |
| 314 | issues.push(...findSingleBracePlaceholders(v, path ? `${path}.${k}` : k)); |
| 315 | } |
| 316 | } else if (typeof obj === "string") { |
| 317 | SINGLE_BRACE_RE.lastIndex = 0; |
| 318 | const names = []; |
| 319 | let m; |
| 320 | while ((m = SINGLE_BRACE_RE.exec(obj))) names.push(m[1]); |
| 321 | if (names.length > 0) issues.push({ key: path, value: obj, names }); |
| 322 | } |
| 323 | return issues; |
| 324 | } |
| 325 | |
| 326 | for (const locale of LOCALES) { |
| 327 | const main = JSON.parse( |