diff --git a/live-examples/js-examples/intl/intl-locale.html b/live-examples/js-examples/intl/intl-locale.html new file mode 100644 index 000000000..3a8835866 --- /dev/null +++ b/live-examples/js-examples/intl/intl-locale.html @@ -0,0 +1,13 @@ +
+const korean = new Intl.Locale('ko', {
+ script: 'Kore', region: 'KR', hourCycle: 'h24', calendar: 'gregory'
+});
+
+const japanese = new Intl.Locale('ja-Jpan-JP-u-ca-japanese-hc-h12');
+
+console.log(korean.baseName, japanese.baseName);
+// expected output: "ko-Kore-KR" "ja-Jpan-JP"
+
+console.log(korean.hourCycle, japanese.hourCycle);
+// expected output: "h24" "h12"
+
diff --git a/live-examples/js-examples/intl/meta.json b/live-examples/js-examples/intl/meta.json
index e5d85e0c0..68f881a10 100644
--- a/live-examples/js-examples/intl/meta.json
+++ b/live-examples/js-examples/intl/meta.json
@@ -60,6 +60,12 @@
"title": "JavaScript Demo: Intl.ListFormat",
"type": "js"
},
+ "intlLocale": {
+ "exampleCode": "./live-examples/js-examples/intl/intl-locale.html",
+ "fileName": "intl-locale.html",
+ "title": "JavaScript Demo: Intl.Locale",
+ "type": "js"
+ },
"intlLocalePrototypeMaximize": {
"exampleCode": "./live-examples/js-examples/intl/intl-locale-prototype-maximize.html",
"fileName": "intl-locale-prototype-maximize.html",
@@ -77,7 +83,7 @@
"fileName": "intl-locale-prototype-tostring.html",
"title": "JavaScript Demo: Intl.Locale.prototype.toString()",
"type": "js"
- },
+ },
"intlNumberFormatPrototypeFormat": {
"exampleCode": "./live-examples/js-examples/intl/intl-numberformat-prototype-format.html",
"fileName": "intl-numberformat-prototype-format.html",