You've already forked AstralRinth
58c1e225c8
* Translate and sort server filters * Set team_members to unknown[] * Additional fixes after merge * Additional translations * Replace "IP" with "server address" * Prioritize English and user language
29 lines
674 B
Vue
29 lines
674 B
Vue
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
|
|
import { defineMessage, useVIntl } from '../../../composables'
|
|
import { SERVER_REGIONS } from '../../../utils'
|
|
import { TagItem } from '../../base'
|
|
|
|
const { region } = defineProps<{
|
|
region: string
|
|
}>()
|
|
|
|
const { formatMessage } = useVIntl()
|
|
|
|
const tooltip = defineMessage({
|
|
id: 'project.server.region.tooltip',
|
|
defaultMessage: 'Server hosted in {regionName}',
|
|
})
|
|
|
|
const regionName = computed(() => {
|
|
const name = SERVER_REGIONS[region]
|
|
if (name) return formatMessage(name)
|
|
|
|
return region
|
|
})
|
|
</script>
|
|
<template>
|
|
<TagItem v-tooltip="formatMessage(tooltip, { regionName })">{{ regionName }}</TagItem>
|
|
</template>
|