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

@ -45,11 +45,12 @@
<script lang="ts" setup>
import { defineAsyncComponent, onMounted, onUnmounted } from 'vue';
import { url as local, lang } from '@/config';
import { url as local } from '@/config';
import { i18n } from '@/i18n';
import * as os from '@/os';
import { deviceKind } from '@/scripts/device-kind';
import MkButton from '@/components/MkButton.vue';
import { versatileLang } from '@/scripts/intl-const';
const props = withDefaults(defineProps<{
url: string;
@ -95,11 +96,9 @@ if (requestUrl.hostname === 'music.youtube.com' && requestUrl.pathname.match('^/
requestUrl.hostname = 'www.youtube.com';
}
const requestLang = (lang ?? 'ja-JP').replace('ja-KS', 'ja-JP');
requestUrl.hash = '';
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) {
unknownUrl = true;