The shared-point note lists its groups in the reader's language

ApproxPinNote built pins.sharedPoint's {names} with join(', '), so the Arabic sentence carried English commas between the group names: the case gospel measured. It now uses formatList, which joins by the locale's own grammar (ar 'A وB وC', zh 'A、B和C', en 'A, B, and C').
This commit is contained in:
Doxa Maps 2026-09-29 13:22:48 +00:00
parent 57e3a11e68
commit 64debb7f5b

View file

@ -10,6 +10,7 @@
<script setup>
import { computed } from 'vue'
import { useOptionalT } from '@map/composables/useOptionalT.js'
import { formatList } from '@map/i18n/index.js'
const props = defineProps({
/** Names of the OTHER groups on this pin's coordinate; empty = not shared. */
@ -27,7 +28,7 @@ const APPROX_FALLBACK = {
// passed in, so a bare host renders the same English it rendered before.
const t = useOptionalT('', { fallback: (key) => APPROX_FALLBACK[key] })
const second = computed(() => props.shared.length
? t('pins.sharedPoint', { names: props.shared.join(', '), n: props.shared.length + 1 })
? t('pins.sharedPoint', { names: formatList(props.shared), n: props.shared.length + 1 })
: '')
</script>