fix: analytics.js using old i18n impl (#5132)

* fix i18n

* fix: lint
This commit is contained in:
Calum H.
2026-01-16 09:07:40 +00:00
committed by GitHub
parent 1ea96df00e
commit c9bfc4e9b6

View File

@@ -1,3 +1,4 @@
import { injectI18n } from '@modrinth/ui'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { computed, ref, watch } from 'vue' import { computed, ref, watch } from 'vue'
@@ -7,8 +8,7 @@ import { computed, ref, watch } from 'vue'
const { unix } = dayjs const { unix } = dayjs
export function useCountryNames(style = 'long') { export function useCountryNames(style = 'long') {
const { $i18n } = useNuxtApp() const { locale } = injectI18n()
const locale = $i18n.locale
const displayNames = computed( const displayNames = computed(
() => new Intl.DisplayNames([locale.value], { type: 'region', style }), () => new Intl.DisplayNames([locale.value], { type: 'region', style }),
) )