You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* 1. Let msgdir be the directionality of the whole message, one of « 'LTR', 'RTL', 'unknown' ». These correspond to the message having left-to-right directionality, right-to-left directionality, and to the message's directionality not being known. */
420
+
bool isLtr = !locale.isRightToLeft();
421
+
422
+
// 2i Let fmt be the formatted string representation of the resolved value of exp.
423
+
// (Passed as argument)
424
+
425
+
// 2ii Let dir be the directionality of fmt, one of « 'LTR', 'RTL', 'unknown' », with the same meanings as for msgdir
426
+
// (Passed as argument)
427
+
428
+
// 2iii. If dir is 'LTR'
429
+
switch (dir) {
430
+
case UBIDI_LTR:
431
+
if (isLtr) {
432
+
// 2iii(a). If msgdir is 'LTR' in the formatted output, let fmt be itself
433
+
return fmt;
434
+
}
435
+
// 2iii(b) Else, in the formatted output, prefix fmt with U+2066 LEFT-TO-RIGHT ISOLATE and postfix it with U+2069 POP DIRECTIONAL ISOLATE.
436
+
fmt.insert(0, LRI_CHAR);
437
+
fmt.insert(fmt.length(), PDI_CHAR);
438
+
break;
439
+
// 2iv. Else, if dir is 'RTL':
440
+
case UBIDI_RTL:
441
+
// 2iv(a). In the formatted output, prefix fmt with U+2067 RIGHT-TO-LEFT ISOLATE and postfix it with U+2069 POP DIRECTIONAL ISOLATE.
442
+
fmt.insert(0, RLI_CHAR);
443
+
fmt.insert(fmt.length(), PDI_CHAR);
444
+
break;
445
+
// 2v. Else:
446
+
default:
447
+
// 2v(a). In the formatted output, prefix fmt with U+2068 FIRST STRONG ISOLATE and postfix it with U+2069 POP DIRECTIONAL ISOLATE.
448
+
fmt.insert(0, FSI_CHAR);
449
+
fmt.insert(fmt.length(), PDI_CHAR);
450
+
break;
451
+
}
452
+
return fmt;
453
+
}
454
+
418
455
// Formats each text and expression part of a pattern, appending the results to `result`
0 commit comments