Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
340
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
27
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TransFem.org
Sharkey
Commits
c37616de
Unverified
Commit
c37616de
authored
1 year ago
by
かっこかり
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(frontend): Intlが対応していない言語の場合はフォールバックする (#12163)
* (fix) Intlが対応していない言語の場合はフォールバックする * Update Changelog
parent
e5ff8d84
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
packages/frontend/src/scripts/intl-const.ts
+38
-9
38 additions, 9 deletions
packages/frontend/src/scripts/intl-const.ts
with
39 additions
and
9 deletions
CHANGELOG.md
+
1
−
0
View file @
c37616de
...
...
@@ -26,6 +26,7 @@
-
Enhance: プラグインを削除した際には、使用されていたアクセストークンも同時に削除されるようになりました
-
Fix: 投稿フォームでのユーザー変更がプレビューに反映されない問題を修正
-
Fix: ユーザーページの ノート > ファイル付き タブにリプライが表示されてしまう
-
Fix: 一部の言語でMisskey Webがクラッシュする問題を修正
### Server
-
Enhance: RedisへのTLのキャッシュをオフにできるように
...
...
This diff is collapsed.
Click to expand it.
packages/frontend/src/scripts/intl-const.ts
+
38
−
9
View file @
c37616de
...
...
@@ -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
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment