File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -472,6 +472,30 @@ suite("Built-in functions", function () {
472472 "Variable type not supported: $arg, object"
473473 ) ;
474474 } ) ;
475+
476+ test ( "numbering system" , ( ) => {
477+ const res = new FluentResource ( "key = {$arg}\n" ) ;
478+ errors = [ ] ;
479+
480+ let ar = new FluentBundle ( "ar" , { useIsolating : false } ) ;
481+ ar . addResource ( res ) ;
482+ msg = ar . getMessage ( "key" ) ;
483+
484+ let fmt = ar . formatPattern ( msg . value , { arg : 10 } , errors ) ;
485+ assert . strictEqual ( fmt , "10" ) ;
486+
487+ const arg = new FluentNumber ( 10 , { numberingSystem : "arab" } ) ;
488+ fmt = ar . formatPattern ( msg . value , { arg } , errors ) ;
489+ assert . strictEqual ( fmt , "١٠" ) ;
490+
491+ ar = new FluentBundle ( "ar-u-nu-arab" , { useIsolating : false } ) ;
492+ ar . addResource ( res ) ;
493+ msg = ar . getMessage ( "key" ) ;
494+ fmt = ar . formatPattern ( msg . value , { arg : 10 } , errors ) ;
495+ assert . strictEqual ( fmt , "١٠" ) ;
496+
497+ assert . strictEqual ( errors . length , 0 ) ;
498+ } ) ;
475499 } ) ;
476500
477501 suite ( "DATETIME" , function ( ) {
You can’t perform that action at this time.
0 commit comments