SHA256
Локализовать интерфейс SHiNE на русский и английский
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { t } from '../../i18n/index.js';
|
||||
// Группы людей на карте связей: «Компании» (кто с кем знаком), «Интересы» (кто на что подписан)
|
||||
// и «Города» (кто где живёт).
|
||||
//
|
||||
@@ -162,7 +163,7 @@ function hubOf(members, weights, byId) {
|
||||
// «Илья С. и др.»: число людей подпись покажет отдельно («· 26»), как у названных компаний.
|
||||
function autoLabel(members, hubId, byId) {
|
||||
const hub = shortPersonName(byId.get(hubId) || { id: hubId });
|
||||
return members.length > 1 ? `${hub} и др.` : hub;
|
||||
return members.length > 1 ? t('screens.communities.text_013', { value1: hub }) : hub;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,7 +342,7 @@ export function buildCompanies({ people, weights, saved, subs = null }) {
|
||||
}
|
||||
if (rest.length) {
|
||||
rest.sort((a, b) => byName(byId.get(a) || { id: a }, byId.get(b) || { id: b }));
|
||||
list.push({ id: REST_GROUP, kind: 'rest', members: rest, name: '', autoLabel: 'Без компании', label: 'Без компании', shortLabel: 'Без компании', hubId: '' });
|
||||
list.push({ id: REST_GROUP, kind: 'rest', members: rest, name: '', autoLabel: t('screens.communities.text_005'), label: t('screens.communities.text_001'), shortLabel: t('screens.communities.text_006'), hubId: '' });
|
||||
}
|
||||
sortGroups(list);
|
||||
assignColors(list, new Map(savedGroups.map((group) => [group.id, group.color])), weights);
|
||||
@@ -425,7 +426,7 @@ export function buildInterestGroups({ people, subs }) {
|
||||
}
|
||||
if (remaining.size) {
|
||||
const members = [...remaining].sort((a, b) => byName(byId.get(a) || { id: a }, byId.get(b) || { id: b }));
|
||||
list.push({ id: REST_GROUP, kind: 'rest', members, name: '', autoLabel: 'Без общих подписок', label: 'Без общих подписок', shortLabel: 'Без подписок', hubId: '' });
|
||||
list.push({ id: REST_GROUP, kind: 'rest', members, name: '', autoLabel: t('screens.communities.text_007'), label: t('screens.communities.text_002'), shortLabel: t('screens.communities.text_008'), hubId: '' });
|
||||
}
|
||||
sortGroups(list);
|
||||
assignColors(list, new Map());
|
||||
@@ -463,12 +464,12 @@ export function buildCityGroups({ people, cities, cityKey, cityLabel }) {
|
||||
if (list.length > 14 && singles.length > 1) {
|
||||
list = list.filter((group) => group.members.length > 1);
|
||||
const members = singles.flatMap((group) => group.members);
|
||||
list.push({ id: 'city:*', kind: 'city', city: '', members, name: '', autoLabel: 'Другие города', label: 'Другие города', shortLabel: 'Другие города', hubId: '' });
|
||||
list.push({ id: 'city:*', kind: 'city', city: '', members, name: '', autoLabel: t('screens.communities.text_009'), label: t('screens.communities.text_003'), shortLabel: t('screens.communities.text_010'), hubId: '' });
|
||||
}
|
||||
for (const group of list) group.members.sort((a, b) => byName(byId.get(a) || { id: a }, byId.get(b) || { id: b }));
|
||||
if (unknown.length) {
|
||||
unknown.sort((a, b) => byName(byId.get(a) || { id: a }, byId.get(b) || { id: b }));
|
||||
list.push({ id: REST_GROUP, kind: 'rest', members: unknown, name: '', autoLabel: 'Город не указан', label: 'Город не указан', shortLabel: 'Не указан', hubId: '' });
|
||||
list.push({ id: REST_GROUP, kind: 'rest', members: unknown, name: '', autoLabel: t('screens.communities.text_011'), label: t('screens.communities.text_004'), shortLabel: t('screens.communities.text_012'), hubId: '' });
|
||||
}
|
||||
sortGroups(list);
|
||||
assignColors(list, new Map());
|
||||
|
||||
Reference in New Issue
Block a user