--- /dev/null
+// Load the names of regions in the current browser locale
+const regions = new Intl.DisplayNames(undefined, { type: "region" })
+
+// Returns the country name by its code in the browser's locale
+export function getCountryName(cc: string) {
+ return regions.of(cc)
+}
import { ref, onMounted } from "vue"
import type { Mirror } from "@/types/Mirror"
import { fetchMirrors } from "@/api/mirrors"
+ import { getCountryName } from "@/utils/i18n"
// Import UI components
import Box from "@/components/Box.vue"
<Box v-for="mirror in mirrors" :key="mirror.hostname"
:title="mirror.hostname" :subtitle="mirror.owner">
<div class="level">
+ <!-- Show the country -->
+ <div class="level-item">
+ {{ getCountryName(mirror.country_code) }}
+ </div>
+
<!-- Show tags of which protocols are supported -->
<div class="level-item">
<Tags>