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());
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { t } from '../../i18n/index.js';
|
||||
// Карта связей на canvas: точки-люди, нити-связи, перетаскивание, масштаб и панорама.
|
||||
//
|
||||
// Почему canvas, а не DOM: прежний движок держал на каждого человека DOM-узел с PNG-«стеклом»,
|
||||
@@ -47,7 +48,7 @@ const AURA_PERIOD_MS = 4200; // медленное «дыхание» аур
|
||||
const AURA_FRAME_MS = 50; // для одной только ауры хватает ~20 кадров в секунду
|
||||
const EDGE_WIDTH = { family: 2.4, close_friend: 2.4, friend: 1.6, contact: 1.1 };
|
||||
const GROUP_ORDER = ['family', 'close_friend', 'friend', 'contact'];
|
||||
const GROUP_CAPTION = { 0: 'Близкие', 1: 'Друзья', 2: 'Контакты' };
|
||||
const GROUP_CAPTION = { get 0() { return t('screens.graph_canvas.text_002'); }, get 1() { return t('screens.graph_canvas.text_003'); }, get 2() { return t('screens.graph_canvas.text_004'); } };
|
||||
const ISLAND_MODES = new Set(['companies', 'interests', 'cities']);
|
||||
const HULL_PAD = 40; // подложка острова: от центра крайней точки до края
|
||||
const MAX_LABEL_CHARS = 18;
|
||||
@@ -551,7 +552,7 @@ export function computeLayout({ focusId, nodes, edges, fixed = new Map(), mode =
|
||||
const radii = ringRadii(second.length, Math.max(outer, 100) + 96);
|
||||
fillRings(second, radii, pos, stretch, prefs, focusId, 100);
|
||||
if (guides?.kind === 'rings') {
|
||||
guides.items.push({ key: 'fof', caption: 'Друзья друзей', count: second.length, from: radii[0], to: radii[radii.length - 1] });
|
||||
guides.items.push({ key: 'fof', caption: t('screens.graph_canvas.text_001'), count: second.length, from: radii[0], to: radii[radii.length - 1] });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user