mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
i18n: plural forms and contexts the catalogs could only work around
The last translation review left four kinds of problem it could only
reword around in the catalogs. They are fixed in the code now, and the
catalogs go back to natural wording.
- Counts shown with plain t() are tn() plurals: the wildlife count, the
Data Library "Showing {shown} of {total}", the News time window (which
offers 1 h) and the GhostMaps event age (which offers 1 day). The
English keys stay; the catalogs get real forms, as in "Última 1 h" and
"Últimas 24 h", or "1 Tag" and "7 Tage".
- The bridge radar range and ring spacing are tn() plurals too. The
spacing is fractional at the short ranges, and Intl.PluralRules gives
0.75 and 1.5 their own form: ru "0,75 МОР. МИЛИ", "12 МОР. МИЛЬ".
- Street level no longer passes "the view centre" or "this spot" as
{place}: each case has a message of its own, so a preposition no
longer meets a phrase in the wrong case. The progress line had the
same leak and showed the English phrase.
- Latest, FOCUS, CONFIRMED and "{label} · COURSE {heading}°" are split
with a context where one key served two places: the News heading, the
orbital site status, the Wildlife chip and a ship's course.
"CURRENTLY OVER" ended in a preposition that a country name in the
nominative cannot follow in uk, de, it and pt. It reads "under the
satellite" there now, as ru already did.
I18N.md gains the two rules behind these fixes.
This commit is contained in:
1 parent
42540ad85e
commit
209b135ff1
37 files changed
+1124
-196
No files matched your search
@@ -118,9 +118,11 @@ const ringFractions = computed(() =>
|
||||
? radar.value.ringsNm.map((ring) => ring / radar.value.rangeNm)
|
||||
: [],
|
||||
);
|
||||
// The spacing is a fraction at the shorter ranges (0.75, 1.5 NM), which
|
||||
// Intl.PluralRules gives a form of its own: ru «0,75 МОР. МИЛИ».
|
||||
const ringLabel = computed(() =>
|
||||
radar.value?.ringsNm.length
|
||||
? t('RINGS {spacing} NM', {
|
||||
? tn(radar.value.ringsNm[0], 'RINGS {spacing} NM', 'RINGS {spacing} NM', {
|
||||
spacing: formatNumber(radar.value.ringsNm[0]),
|
||||
})
|
||||
: '',
|
||||
|
||||
@@ -163,6 +163,20 @@ test('filters narrow the list as the viewer types and picks', async (t_) => {
|
||||
assert.deepEqual(shownIds(), ['nasa-eonet-events']);
|
||||
});
|
||||
|
||||
test('the shown count agrees with its number (he)', async (t_) => {
|
||||
const { owner } = mount(t_);
|
||||
setLocale('he');
|
||||
owner.open();
|
||||
await settle();
|
||||
const status = () => $('.data-library-status').textContent.trim();
|
||||
assert.match(status(), /^מוצגים\s+\S*3\S*\s+מתוך/);
|
||||
const search = $('#data-library input[type="search"]');
|
||||
search.value = 'eonet';
|
||||
search.dispatchEvent(new Event('input'));
|
||||
await settle();
|
||||
assert.match(status(), /^מוצג\s+\S*1\S*\s+מתוך/);
|
||||
});
|
||||
|
||||
test('Add becomes Remove on the same focused button; Zoom closes first', async (t_) => {
|
||||
const { owner, library } = mount(t_);
|
||||
owner.open();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { computed, nextTick, useTemplateRef, watch } from 'vue';
|
||||
import { t, tn } from '../../../i18n/index.js';
|
||||
import { formatNumber, t, tn } from '../../../i18n/index.js';
|
||||
import UiButton from '../../kit/UiButton.vue';
|
||||
import UiSelect from '../../kit/UiSelect.js';
|
||||
import {
|
||||
@@ -53,12 +53,18 @@ watch(
|
||||
|
||||
const tiles = computed(() => libraryStatTiles(props.view.summary));
|
||||
const themes = computed(() => libraryThemeOptions());
|
||||
// The words for the shown entries agree with their count: he «מוצג 1».
|
||||
const status = computed(() =>
|
||||
props.view.ready
|
||||
? t('Showing {shown} of {total}', {
|
||||
shown: props.view.shown.length,
|
||||
total: props.view.total,
|
||||
})
|
||||
? tn(
|
||||
props.view.shown.length,
|
||||
'Showing {shown} of {total}',
|
||||
'Showing {shown} of {total}',
|
||||
{
|
||||
shown: formatNumber(props.view.shown.length),
|
||||
total: formatNumber(props.view.total),
|
||||
},
|
||||
)
|
||||
: t('Checking what this instance serves…'),
|
||||
);
|
||||
const resetText = computed(() => {
|
||||
|
||||
Reference in new issue
Block a user