use Intl.DateTimeFormat and Intl.NumberFormat instead of toLocaleString (#9444)

This commit is contained in:
tamaina 2023-01-01 17:11:33 +09:00 committed by GitHub
parent 0222165bd9
commit c3a36698e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 42 additions and 18 deletions

View file

@ -19,7 +19,7 @@
<script lang="ts" setup>
import XWindow from '@/components/MkWindow.vue';
import { lang } from '@/config';
import { versatileLang } from '@/scripts/intl-const';
const props = defineProps<{
url: string;
@ -35,11 +35,9 @@ let player = $ref({
height: null,
});
const requestLang = (lang ?? 'ja-JP').replace('ja-KS', 'ja-JP');
const ytFetch = (): void => {
fetching = true;
window.fetch(`/url?url=${encodeURIComponent(requestUrl.href)}&lang=${requestLang}`).then(res => {
window.fetch(`/url?url=${encodeURIComponent(requestUrl.href)}&lang=${versatileLang}`).then(res => {
res.json().then(info => {
if (info.url == null) return;
title = info.title;