Make Russian website copy clearer and more natural
This commit is contained in:
1 parent
ad8e2d1438
commit
eb04ce3e48
9 files changed
+91
-92
No files matched your search
+15
-15
@@ -23,7 +23,7 @@ function levelText(value) { return `Опасностей рядом: ${level(val
|
||||
function playCue(value) {
|
||||
const attempt = game;
|
||||
playSound(level(value)).catch(() => {
|
||||
if (game === attempt && !simple()) $('status').textContent = 'Не удалось воспроизвести звук. Повторите попытку или включите упрощённый режим.';
|
||||
if (game === attempt && !simple()) $('status').textContent = 'Не удалось проиграть звук. Попробуйте ещё раз или включите упрощённый режим.';
|
||||
});
|
||||
}
|
||||
function renderMessage(message) {
|
||||
@@ -44,11 +44,11 @@ function describe(cell, view, showNotes = true, isMap = false) {
|
||||
if (cell.hazard) return `опасная клетка${rating}`;
|
||||
if (cell.opened || ended(view)) {
|
||||
const fact = simple() || ended(view) ? `, ${levelText(cell.value).slice(0, -1).toLowerCase()}` : '';
|
||||
return `${cell.opened ? 'проверено' : 'безопасная клетка'}${fact}${rating}${!isMap && cell.available ? ', прыжок доступен' : ''}`;
|
||||
return `${cell.opened ? 'проверено' : 'безопасная клетка'}${fact}${rating}${!isMap && cell.available ? ', можно прыгнуть' : ''}`;
|
||||
}
|
||||
if (cell.marked && showNotes) return `ваш флажок опасности${rating}`;
|
||||
if (hints.has(cell.id)) return `подсказка: опасность${rating}`;
|
||||
return `неизвестно${rating}${isMap ? '' : cell.available ? ', прыжок доступен' : ', не рядом с персонажем'}`;
|
||||
return `клетка не проверена${rating}${isMap ? '' : cell.available ? ', рядом с персонажем' : ', не рядом с персонажем'}`;
|
||||
}
|
||||
function cellValue(cell, view, showMarks) {
|
||||
if (cell.transition) return cell.entrance ? '↥' : '↗';
|
||||
@@ -161,7 +161,7 @@ function start(options = DEFAULTS) {
|
||||
stopTimers(); game = new Training(options); selected = START; startedAt = null; renderedHistory = 0;
|
||||
$('history').replaceChildren(); $('messages').replaceChildren();
|
||||
messages = [];
|
||||
recordMessage({text:'Лес затих. Сигнал появится после прыжка.'});
|
||||
recordMessage({text:'Лес затих. Прислушайтесь после прыжка.'});
|
||||
$('status').textContent = '';
|
||||
$('map-rating-status').textContent = '';
|
||||
updateClock(); render();
|
||||
@@ -193,19 +193,19 @@ function render() {
|
||||
$('growth-value').textContent = {12:'45–75%',15:'76–85%',18:'81–88%',22:'89–95%',25:'96–100%'}[view.options.growth];
|
||||
$('hint-chance').textContent = simple() ? `${Math.round(hintChance(view.options.lu) * 100)}%` : 'Выкл.';
|
||||
$('replay-sound').disabled = finished || simple() || !view.cells[view.position].value;
|
||||
$('sound-guide').textContent = simple() ? 'Число показывает опасности вокруг клетки, включая диагонали. 7 означает семь или больше.' : 'После прыжка прислушайтесь к шорохам и оцените клетку на карте.';
|
||||
$('sound-guide').textContent = simple() ? 'Число показывает, сколько опасностей рядом с клеткой, в том числе по диагонали. 7 означает семь или больше.' : 'После прыжка прислушайтесь к шорохам и запишите свою оценку на карте.';
|
||||
$('progress').textContent = `${view.opened} / ${view.safe}`;
|
||||
$('mark-count').textContent = view.marks; $('hazard-count').textContent = view.hazards;
|
||||
$('rating-count').textContent = view.ratings;
|
||||
$('attempt-state').textContent = {ready:'Готов к прыжку',playing:'На уступах',won:'Карта готова',lost:'Падение'}[view.status];
|
||||
$('scene-instructions').textContent = compact.matches ? 'Коснитесь клетки, затем выберите действие под полем.' : 'Клик по соседней клетке — прыжок. Правый клик или Shift+Enter — поставить или снять отметку.';
|
||||
$('scene-instructions').textContent = compact.matches ? 'Выберите клетку, затем нажмите нужную кнопку под полем.' : 'Нажмите на соседнюю клетку, чтобы прыгнуть. Правая кнопка мыши или Shift+Enter ставят или снимают флажок.';
|
||||
const cell = view.cells[selected], note = cell.marked ? 'Снять отметку' : 'Отметить опасной';
|
||||
const selectionState = finished ? 'попытка завершена' : cell.id === view.position ? 'вы здесь' :
|
||||
cell.transition ? (cell.entrance ? 'вход' : 'выход') : cell.marked ? 'есть отметка' :
|
||||
!cell.available ? 'вне досягаемости' : '';
|
||||
$('touch-actions').hidden = !compact.matches;
|
||||
$('selection').textContent = `Клетка ${coordinate(selected)}${selectionState ? ` — ${selectionState}` : ''}`;
|
||||
$('map-selection').textContent = `Выбрана ${coordinate(selected)} · ${describe(cell, view, true, true)}`;
|
||||
$('selection').textContent = `Клетка ${coordinate(selected)}${selectionState ? ` (${selectionState})` : ''}`;
|
||||
$('map-selection').textContent = `Клетка ${coordinate(selected)} · ${describe(cell, view, true, true)}`;
|
||||
$('mark').textContent = note; $('map-mark').textContent = note;
|
||||
$('jump').disabled = finished || !cell.available || cell.marked;
|
||||
for (const id of ['mark','map-mark']) $(id).disabled = finished || cell.opened || cell.transition;
|
||||
@@ -215,12 +215,12 @@ function render() {
|
||||
$('clear-marks').disabled = finished || (view.marks === 0 && view.ratings === 0);
|
||||
$('history-empty').hidden = view.history.length > 0;
|
||||
for (const entry of view.history.slice(renderedHistory)) {
|
||||
const text = entry.type === 'cleared' ? 'Все заметки очищены; открытые клетки сохранены.' : `${coordinate(entry.id)} · ${{opened:'Прыжок',revisited:'Повторный прыжок',fall:'Падение',marked:'Поставлена отметка',unmarked:'Снята отметка',rated:`Ваша оценка: ${entry.rating}`,unrated:'Оценка снята'}[entry.type]}${simple() && entry.value !== undefined ? ` · ${levelText(entry.value)}` : ''}`;
|
||||
const text = entry.type === 'cleared' ? 'Флажки и оценки убраны. Проверенные клетки остались открытыми.' : `${coordinate(entry.id)} · ${{opened:'Прыжок',revisited:'Повторный прыжок',fall:'Падение',marked:'Поставлена отметка',unmarked:'Снята отметка',rated:`Ваша оценка: ${entry.rating}`,unrated:'Оценка снята'}[entry.type]}${simple() && entry.value !== undefined ? ` · ${levelText(entry.value)}` : ''}`;
|
||||
addItem($('history'), text);
|
||||
}
|
||||
renderedHistory = view.history.length;
|
||||
$('result').hidden = !finished;
|
||||
if (finished) $('result').textContent = view.status === 'won' ? 'Карта готова! Условие победы выполнено. Поле раскрыто — можно изучить результат или начать новую игру.' : `Падение на ${coordinate(view.hit)}. Попытка завершена, поле раскрыто. Знак ≠ показывает ошибочную отметку. Попробуйте ещё раз.`;
|
||||
if (finished) $('result').textContent = view.status === 'won' ? 'Карта готова! Вы победили. Теперь видно всё поле. Можно посмотреть результат или начать новую игру.' : `Падение на ${coordinate(view.hit)}. Попытка закончилась. Теперь видно всё поле. Знак ≠ показывает ошибочную отметку. Попробуйте ещё раз.`;
|
||||
}
|
||||
function act(action) {
|
||||
const result = action === 'jump' ? game.jump(selected, simple() ? Math.random : () => 1) : game.mark(selected);
|
||||
@@ -233,8 +233,8 @@ function act(action) {
|
||||
if (result.hint !== null) {
|
||||
clearTimeout(hintTimers.get(result.hint));
|
||||
hints.add(result.hint);
|
||||
const hintText = `Подсказка: ${coordinate(result.hint)} — опасная клетка. Значок «!» виден 2 секунды; координата остаётся здесь.`;
|
||||
recordMessage({text:hintText, simpleOnly:true}); text += ` Подсказка: ${coordinate(result.hint)} — опасная клетка.`;
|
||||
const hintText = `Подсказка: ${coordinate(result.hint)} (опасная клетка). Значок «!» виден 2 секунды. Координаты останутся в сообщениях.`;
|
||||
recordMessage({text:hintText, simpleOnly:true}); text += ` Подсказка: ${coordinate(result.hint)} (опасная клетка).`;
|
||||
const attempt = game;
|
||||
const timer = setTimeout(() => { hintTimers.delete(result.hint); if (game === attempt) { hints.delete(result.hint); render(); } },2000);
|
||||
hintTimers.set(result.hint, timer);
|
||||
@@ -309,11 +309,11 @@ $('settings-form').addEventListener('submit', event => {
|
||||
const options = Object.fromEntries([...new FormData(event.currentTarget)].map(([key,value])=>[key,Number(value)]));
|
||||
$('settings-dialog').close(); start(options);
|
||||
});
|
||||
$('new-game').addEventListener('click', event => confirmAction('Начать заново?', 'Текущее поле, заметки и история будут сброшены. Условия тренировки сохранятся.', 'Начать новую игру', () => start(game.view().options), event.currentTarget));
|
||||
$('clear-marks').addEventListener('click', event => confirmAction('Очистить отметки?', 'Удалятся ваши флажки и оценки. Проверенные клетки, история и текущая попытка сохранятся.', 'Очистить отметки', () => { game.clearMarks(); $('status').textContent = 'Отметки очищены. Попытка продолжается.'; render(); }, event.currentTarget));
|
||||
$('new-game').addEventListener('click', event => confirmAction('Начать заново?', 'С новым полем вы начнёте без прежних заметок и истории. Настройки тренировки останутся прежними.', 'Начать новую игру', () => start(game.view().options), event.currentTarget));
|
||||
$('clear-marks').addEventListener('click', event => confirmAction('Очистить отметки?', 'Исчезнут только ваши флажки и оценки. Проверенные клетки и история останутся, а игру можно будет продолжить.', 'Очистить отметки', () => { game.clearMarks(); $('status').textContent = 'Флажки и оценки убраны. Можно продолжать.'; render(); }, event.currentTarget));
|
||||
$('simple-mode').addEventListener('change', () => {
|
||||
stopSound(); clearHints();
|
||||
$('status').textContent = simple() ? 'Упрощённый режим: уровни видны на проверенных клетках.' : 'Звуковой режим: оцените клетку по шорохам.';
|
||||
$('status').textContent = simple() ? 'В упрощённом режиме уровни видны на проверенных клетках.' : 'В звуковом режиме оцените клетку по шорохам.';
|
||||
$('messages').replaceChildren(); messages.forEach(renderMessage);
|
||||
$('history').replaceChildren(); renderedHistory = 0;
|
||||
render();
|
||||
|
||||
Reference in new issue
Block a user