feat: confirm before leaving a game, and fix untranslated strings
Build & Deploy Farolero / Análisis de código (push) Successful in 13s
Build & Deploy Farolero / Build APK + AAB release (push) Successful in 1m22s

Exit confirmation
- A dialog in the app's own style now guards every in-game screen. The safe
  action is the prominent one, so a stray tap keeps you in the game.
- Eleven screens covered, against both the system back gesture and the close
  buttons. The message adapts: a single-device game is lost, a host ends it
  for everyone, a client can rejoin.
- The two screens the host also opens from the manager take a flag so that
  back there just closes them instead of offering to quit.

Translations
- 21 keys were still holding the English text in Arabic, Basque, Hindi,
  Japanese, Korean, Dutch, Polish, Russian, Turkish and both Chinese
  variants: 231 strings, covering the whole multi-device flow, permissions
  and the mode picker. Nothing failed, the app just showed English.
- The permissions dialog was hardcoded in Spanish; it is localized now.
- Portuguese used Spanish gerunds where pt-PT takes "a + infinitive".

Checked what looked untranslated but is not: Animals and Notes are correct
Catalan, Configuration and Vibration correct French, Version correct German.
Those are whitelisted in the new test rather than silently rewritten.

l10n_cobertura_test guards all of it: no missing or orphan keys, no empty
values, no English left outside the whitelist, and placeholders preserved.
This commit is contained in:
2026-07-25 23:59:57 +02:00
parent d98ca66793
commit 56f07364c2
50 changed files with 2313 additions and 853 deletions
+61 -57
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import '../tema/dialogo_confirmacion.dart';
import 'package:farolero/l10n/generated/app_localizations.dart';
import 'package:provider/provider.dart';
import '../estado/estado_juego.dart';
@@ -25,64 +26,67 @@ class _PantallaVerPalabraState extends State<PantallaVerPalabra> {
final todosHanVisto = partida.jugadores.every((j) => _hanVisto.contains(j.id));
return Scaffold(
appBar: AppBar(
title: Text(l10n.seeYourWord),
automaticallyImplyLeading: false,
),
body: FondoFarolero(
intenso: true,
child: SafeArea(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
children: [
const ArteGameplayFarolero.fase(height: 110),
const SizedBox(height: 10),
TarjetaFaseFarolero(
icono: Icons.visibility,
assetIconPath: 'assets/ui/generated/actions/action_reveal_word.webp',
titulo: l10n.roundNumber(partida.rondaActual),
subtitulo: l10n.eachPlayerMustSee,
),
const SizedBox(height: 16),
Expanded(
child: ListView.separated(
itemCount: partida.jugadores.length,
separatorBuilder: (context, index) => const SizedBox(height: 10),
itemBuilder: (context, index) {
final jugador = partida.jugadores[index];
final haVisto = _hanVisto.contains(jugador.id);
return EstadoJugadorFarolero(
nombre: '${index + 1}. ${jugador.nombre}',
subtitulo: haVisto ? l10n.alreadySeen : l10n.tapToSee,
icono: haVisto ? Icons.check_circle : Icons.visibility,
assetIconPath: haVisto ? null : 'assets/ui/generated/actions/action_reveal_word.webp',
destacado: haVisto,
completado: haVisto,
onTap: haVisto ? null : () => _mostrarPalabra(context, jugador.id),
);
},
return GuardiaSalidaPartida(
contexto: ContextoSalida.unDispositivo,
child: Scaffold(
appBar: AppBar(
title: Text(l10n.seeYourWord),
automaticallyImplyLeading: false,
),
body: FondoFarolero(
intenso: true,
child: SafeArea(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
children: [
const ArteGameplayFarolero.fase(height: 110),
const SizedBox(height: 10),
TarjetaFaseFarolero(
icono: Icons.visibility,
assetIconPath: 'assets/ui/generated/actions/action_reveal_word.webp',
titulo: l10n.roundNumber(partida.rondaActual),
subtitulo: l10n.eachPlayerMustSee,
),
),
const SizedBox(height: 16),
BotonFarolero(
texto: todosHanVisto
? l10n.allSeenStartDebate
: l10n.playersRemaining(partida.jugadores.length - _hanVisto.length),
icono: Icons.forum,
assetIconPath: 'assets/ui/generated/actions/action_rules_book.webp',
onPressed: todosHanVisto
? () {
estado.iniciarDebate();
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (_) => const PantallaDebate()),
);
}
: null,
),
],
const SizedBox(height: 16),
Expanded(
child: ListView.separated(
itemCount: partida.jugadores.length,
separatorBuilder: (context, index) => const SizedBox(height: 10),
itemBuilder: (context, index) {
final jugador = partida.jugadores[index];
final haVisto = _hanVisto.contains(jugador.id);
return EstadoJugadorFarolero(
nombre: '${index + 1}. ${jugador.nombre}',
subtitulo: haVisto ? l10n.alreadySeen : l10n.tapToSee,
icono: haVisto ? Icons.check_circle : Icons.visibility,
assetIconPath: haVisto ? null : 'assets/ui/generated/actions/action_reveal_word.webp',
destacado: haVisto,
completado: haVisto,
onTap: haVisto ? null : () => _mostrarPalabra(context, jugador.id),
);
},
),
),
const SizedBox(height: 16),
BotonFarolero(
texto: todosHanVisto
? l10n.allSeenStartDebate
: l10n.playersRemaining(partida.jugadores.length - _hanVisto.length),
icono: Icons.forum,
assetIconPath: 'assets/ui/generated/actions/action_rules_book.webp',
onPressed: todosHanVisto
? () {
estado.iniciarDebate();
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (_) => const PantallaDebate()),
);
}
: null,
),
],
),
),
),
),