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:
parent
57e3a11e68
commit
64debb7f5b
1 changed files with 2 additions and 1 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue