阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js 嵌入ICU 数据的有界集

      Node.js 嵌入ICU 数据的有界集

      This option makes the resulting binary link against the ICU library statically, and includes a subset of ICU data (typically only the English locale) within the node executable.

      Functionalities that only require the ICU library itself, such as String.prototype.normalize() and the WHATWG URL parser, are fully supported under small-icu. Features that require ICU locale data in addition, such as Intl.DateTimeFormat, generally only work with the English locale:

      const january = new Date(9e8);
      const english = new Intl.DateTimeFormat('en', { month: 'long' });
      const spanish = new Intl.DateTimeFormat('es', { month: 'long' });
      
      console.log(english.format(january));
      // Prints "January"
      console.log(spanish.format(january));
      // Prints "M01" on small-icu
      // Should print "enero"
      

      This mode provides a good balance between features and binary size, and it is the default behavior if no –with-intl flag is passed. The official binaries are also built in this mode.


      更多内容请参考:Node.js 国际化支持,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录