fix(ui): use the guest stubs' "sign in" wording, and link it in Stats
CI / changes (pull_request) Successful in 3s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 21s
CI / ui (pull_request) Successful in 1m15s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m57s
CI / changes (pull_request) Successful in 3s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 21s
CI / ui (pull_request) Successful in 1m15s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m57s
The New Game hint said "Register" where the Stats and Profile guest stubs say "Sign in". Move the shared word into common.signInLink so the two screens cannot drift, and turn the Stats stub's opening word into the same link to the profile screen.
This commit is contained in:
@@ -41,6 +41,10 @@ export const en = {
|
||||
'common.you': 'You',
|
||||
'common.guest': 'Guest',
|
||||
'common.save': 'Save',
|
||||
// The opening word of a guest's invitation to sign in, rendered as a link to the profile
|
||||
// screen (New Game, Stats). Shared so the two screens cannot drift apart; each screen keeps
|
||||
// its own tail, which carries its leading space — Svelte trims literal edge whitespace.
|
||||
'common.signInLink': 'Sign in',
|
||||
|
||||
'login.title': 'Sign in',
|
||||
'login.guest': 'Play as guest',
|
||||
@@ -83,10 +87,8 @@ export const en = {
|
||||
'new.moveLimit': 'Move time: {n} h 00 min',
|
||||
'new.searchHint':
|
||||
'Finding an opponent can sometimes take a while. If you do not want to wait, close the app after starting the game and come back in a couple of minutes.',
|
||||
// The guest's invitation to register, shown under the single variant a guest is offered. It is
|
||||
// two keys because the first word is a link to the profile screen; the tail carries its own
|
||||
// leading space, since Svelte trims literal whitespace at the edges of markup.
|
||||
'new.guestVariantHintLink': 'Register',
|
||||
// The tail of the guest's invitation to sign in (common.signInLink opens it), shown under the
|
||||
// single variant a guest is offered.
|
||||
'new.guestVariantHint': ' to play the Russian or English Scrabble.',
|
||||
|
||||
// First-run coachmark hints (components/Coachmark.svelte). The leading emoji in each comment
|
||||
@@ -420,7 +422,8 @@ export const en = {
|
||||
'stats.winRate': 'Win rate',
|
||||
'stats.maxGame': 'Best game',
|
||||
'stats.maxWord': 'Best move',
|
||||
'stats.guestHint': 'Sign in to track your statistics.',
|
||||
// The tail of the guest's invitation to sign in (common.signInLink opens it).
|
||||
'stats.guestHint': ' to track your statistics.',
|
||||
|
||||
'game.exportGcg': 'Export game',
|
||||
'game.exportChoice': 'Export the finished game as:',
|
||||
|
||||
@@ -42,6 +42,7 @@ export const ru: Record<MessageKey, string> = {
|
||||
'common.you': 'Вы',
|
||||
'common.guest': 'Гость',
|
||||
'common.save': 'Сохранить',
|
||||
'common.signInLink': 'Войдите',
|
||||
|
||||
'login.title': 'Вход',
|
||||
'login.guest': 'Играть как гость',
|
||||
@@ -84,7 +85,6 @@ export const ru: Record<MessageKey, string> = {
|
||||
'new.moveLimit': 'Время на ход: {n} ч. 00 мин.',
|
||||
'new.searchHint':
|
||||
'Иногда поиск соперника может занять некоторое время. Если не захотите ждать после начала игры, можете вернуться в приложение через несколько минут.',
|
||||
'new.guestVariantHintLink': 'Зарегистрируйтесь',
|
||||
'new.guestVariantHint': ', чтобы играть в русский или английский вариант Скрэббл.',
|
||||
|
||||
// Подсказки первого запуска (components/Coachmark.svelte).
|
||||
@@ -417,7 +417,7 @@ export const ru: Record<MessageKey, string> = {
|
||||
'stats.winRate': 'Доля побед',
|
||||
'stats.maxGame': 'Лучшая игра',
|
||||
'stats.maxWord': 'Лучший ход',
|
||||
'stats.guestHint': 'Войдите, чтобы вести статистику.',
|
||||
'stats.guestHint': ', чтобы вести статистику.',
|
||||
|
||||
'game.exportGcg': 'Экспорт партии',
|
||||
'game.exportChoice': 'Экспортировать завершённую партию как:',
|
||||
|
||||
@@ -90,11 +90,11 @@ export function availableVariants(preferences: Variant[] | undefined): VariantOp
|
||||
return ALL_VARIANTS.filter((v) => effective.includes(v.id));
|
||||
}
|
||||
|
||||
// showRegisterHint reports whether New Game invites the player to register in order to unlock the
|
||||
// showRegisterHint reports whether New Game invites the player to sign in in order to unlock the
|
||||
// other games, given whether they are a guest (isGuest), how many variants they are offered
|
||||
// (offered) and whether the app is in offline mode (offline). It is the guest's case alone: a
|
||||
// guest is created with Erudit only, while registering widens the account to both Russian-alphabet
|
||||
// games. Offline it is suppressed — registration needs the network, so the link would be dead.
|
||||
// guest is created with Erudit only, while signing in widens the account to both Russian-alphabet
|
||||
// games. Offline it is suppressed — signing in needs the network, so the link would be dead.
|
||||
export function showRegisterHint(isGuest: boolean, offered: number, offline: boolean): boolean {
|
||||
return isGuest && !offline && offered === 1;
|
||||
}
|
||||
|
||||
@@ -396,11 +396,12 @@
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
<!-- A guest is offered Erudit alone; registering widens the account to both Russian games
|
||||
(and Settings then offers English), so point them at the profile screen. -->
|
||||
<!-- A guest is offered Erudit alone; signing in widens the account to both Russian games
|
||||
(and Settings then offers English), so point them at the profile screen — the same
|
||||
wording and link the Stats guest stub uses. -->
|
||||
{#if showRegisterHint(guest, variants.length, offlineMode.active)}
|
||||
<p class="guesthint">
|
||||
<button class="hintlink" onclick={() => navigate('/profile')}>{t('new.guestVariantHintLink')}</button>{t('new.guestVariantHint')}
|
||||
<button class="hintlink" onclick={() => navigate('/profile')}>{t('common.signInLink')}</button>{t('new.guestVariantHint')}
|
||||
</p>
|
||||
{/if}
|
||||
{#if variants.some((v) => supportsMultipleWordsToggle(v.id))}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import WordTiles from '../components/WordTiles.svelte';
|
||||
import { app, handleError } from '../lib/app.svelte';
|
||||
import { gateway } from '../lib/gateway';
|
||||
import { navigate } from '../lib/router.svelte';
|
||||
import { t, i18n, type MessageKey } from '../lib/i18n/index.svelte';
|
||||
import { gamesPlayed, hintSharePercent, winRate } from '../lib/stats';
|
||||
import { ALL_VARIANTS, variantNameKey } from '../lib/variants';
|
||||
@@ -56,7 +57,11 @@
|
||||
<Screen title={t('stats.title')} back="/">
|
||||
<div class="page">
|
||||
{#if app.profile?.isGuest}
|
||||
<p class="muted">{t('stats.guestHint')}</p>
|
||||
<!-- The opening word links to the profile screen, where a guest signs in (the same wording
|
||||
and link New Game shows a guest under its lone variant). -->
|
||||
<p class="muted">
|
||||
<button class="hintlink" onclick={() => navigate('/profile')}>{t('common.signInLink')}</button>{t('stats.guestHint')}
|
||||
</p>
|
||||
{:else if stats}
|
||||
<div class="grid">
|
||||
{#each cards as c (c.key)}
|
||||
@@ -89,6 +94,16 @@
|
||||
.muted {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
/* The inline link-styled button opening the guest stub (mirrors New Game's .hintlink). */
|
||||
.hintlink {
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
color: var(--accent);
|
||||
font: inherit;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
|
||||
Reference in New Issue
Block a user