MCPcopy Create free account
hub / github.com/totaljs/framework / view_find_localization

Function view_find_localization

internal.js:2489–2522  ·  view source on GitHub ↗
(content, index)

Source from the content-addressed store, hash-verified

2487}
2488
2489function view_find_localization(content, index) {
2490
2491 index = content.indexOf('@(', index);
2492 if (index === -1)
2493 return null;
2494
2495 var length = content.length;
2496 var count = 0;
2497 var beg = content[index - 1];
2498 var esc = '';
2499
2500 for (var i = index + 2; i < length; i++) {
2501 var c = content[i];
2502
2503 if (c === '(') {
2504 count++;
2505 continue;
2506 }
2507
2508 if (c !== ')')
2509 continue;
2510 else if (count) {
2511 count--;
2512 continue;
2513 }
2514
2515 var end = content.substring(i + 1, i + 2);
2516 if (beg === end && beg === '"' || beg === '\'' || beg === '`')
2517 esc = beg;
2518 return { beg: index, end: i, command: content.substring(index + 2, i).trim(), escape: esc };
2519 }
2520
2521 return null;
2522}
2523
2524function removeComments(html) {
2525 var tagBeg = '<!--';

Callers 1

view_parse_localizationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected