diff --git a/CHANGELOG.md b/CHANGELOG.md index 304cc0ebe673528e1a97f59084c3e7a3cc1f6538..eaa756835aa1b7266a531da8948ef8cc4cc2caec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - Enhance: プラグインを削除ã—ãŸéš›ã«ã¯ã€ä½¿ç”¨ã•ã‚Œã¦ã„ãŸã‚¢ã‚¯ã‚»ã‚¹ãƒˆãƒ¼ã‚¯ãƒ³ã‚‚åŒæ™‚ã«å‰Šé™¤ã•ã‚Œã‚‹ã‚ˆã†ã«ãªã‚Šã¾ã—㟠- Fix: 投稿フォームã§ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼å¤‰æ›´ãŒãƒ—レビューã«åæ˜ ã•ã‚Œãªã„å•é¡Œã‚’ä¿®æ£ - Fix: ユーザーページ㮠ノート > ファイル付ã タブã«ãƒªãƒ—ライãŒè¡¨ç¤ºã•ã‚Œã¦ã—ã¾ã† +- Fix: 一部ã®è¨€èªžã§Misskey WebãŒã‚¯ãƒ©ãƒƒã‚·ãƒ¥ã™ã‚‹å•é¡Œã‚’ä¿®æ£ ### Server - Enhance: Redisã¸ã®TLã®ã‚ャッシュをオフã«ã§ãるよã†ã« diff --git a/packages/frontend/src/scripts/intl-const.ts b/packages/frontend/src/scripts/intl-const.ts index 8012a677ef8b03f14211748f2b11782fe2632fa5..ea16c9c2aec275fd111b3c4f4324d82638dde333 100644 --- a/packages/frontend/src/scripts/intl-const.ts +++ b/packages/frontend/src/scripts/intl-const.ts @@ -6,12 +6,41 @@ import { lang } from '@/config.js'; export const versatileLang = (lang ?? 'ja-JP').replace('ja-KS', 'ja-JP'); -export const dateTimeFormat = new Intl.DateTimeFormat(versatileLang, { - year: 'numeric', - month: 'numeric', - day: 'numeric', - hour: 'numeric', - minute: 'numeric', - second: 'numeric', -}); -export const numberFormat = new Intl.NumberFormat(versatileLang); + +let _dateTimeFormat: Intl.DateTimeFormat; +try { + _dateTimeFormat = new Intl.DateTimeFormat(versatileLang, { + year: 'numeric', + month: 'numeric', + day: 'numeric', + hour: 'numeric', + minute: 'numeric', + second: 'numeric', + }); +} catch (err) { + console.warn(err); + if (_DEV_) console.log('[Intl] Fallback to en-US'); + + // Fallback to en-US + _dateTimeFormat = new Intl.DateTimeFormat('en-US', { + year: 'numeric', + month: 'numeric', + day: 'numeric', + hour: 'numeric', + minute: 'numeric', + second: 'numeric', + }); +} +export const dateTimeFormat = _dateTimeFormat; + +let _numberFormat: Intl.NumberFormat; +try { + _numberFormat = new Intl.NumberFormat(versatileLang); +} catch (err) { + console.warn(err); + if (_DEV_) console.log('[Intl] Fallback to en-US'); + + // Fallback to en-US + _numberFormat = new Intl.NumberFormat('en-US'); +} +export const numberFormat = _numberFormat;