feat: confirm before leaving a game, and fix untranslated strings
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:
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import '../tema/dialogo_confirmacion.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -67,85 +68,88 @@ class _PantallaDebateState extends State<PantallaDebate> {
|
||||
|
||||
final tieneTemporizador = partida.config.tiempoDebateSegundos != null;
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(l10n.debateRound(partida.rondaActual)),
|
||||
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),
|
||||
if (tieneTemporizador) ...[
|
||||
TemporizadorFarolero(
|
||||
etiqueta: _tiempoAgotado ? l10n.timeUp : l10n.timeRemaining,
|
||||
tiempo: _formatearTiempo(_segundosRestantes),
|
||||
agotado: _tiempoAgotado,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
Expanded(
|
||||
child: TarjetaFaseFarolero(
|
||||
icono: Icons.forum,
|
||||
assetIconPath: 'assets/ui/generated/actions/action_rules_book.webp',
|
||||
titulo: l10n.playersInDebate,
|
||||
subtitulo: l10n.activePlayersInfo(
|
||||
partida.jugadoresActivos.length,
|
||||
partida.impostoresActivos.length,
|
||||
return GuardiaSalidaPartida(
|
||||
contexto: ContextoSalida.unDispositivo,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(l10n.debateRound(partida.rondaActual)),
|
||||
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),
|
||||
if (tieneTemporizador) ...[
|
||||
TemporizadorFarolero(
|
||||
etiqueta: _tiempoAgotado ? l10n.timeUp : l10n.timeRemaining,
|
||||
tiempo: _formatearTiempo(_segundosRestantes),
|
||||
agotado: _tiempoAgotado,
|
||||
),
|
||||
child: Expanded(
|
||||
child: ListView.separated(
|
||||
itemCount: partida.jugadores.length,
|
||||
separatorBuilder: (context, index) => const SizedBox(height: 8),
|
||||
itemBuilder: (context, index) {
|
||||
final jugador = partida.jugadores[index];
|
||||
return EstadoJugadorFarolero(
|
||||
nombre: '${index + 1}. ${jugador.nombre}',
|
||||
subtitulo: jugador.eliminado ? l10n.eliminated : null,
|
||||
icono: jugador.eliminado ? Icons.person_off : Icons.record_voice_over,
|
||||
assetIconPath: jugador.eliminado ? null : 'assets/ui/generated/actions/action_players_group.webp',
|
||||
destacado: !jugador.eliminado,
|
||||
completado: !jugador.eliminado,
|
||||
);
|
||||
},
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
Expanded(
|
||||
child: TarjetaFaseFarolero(
|
||||
icono: Icons.forum,
|
||||
assetIconPath: 'assets/ui/generated/actions/action_rules_book.webp',
|
||||
titulo: l10n.playersInDebate,
|
||||
subtitulo: l10n.activePlayersInfo(
|
||||
partida.jugadoresActivos.length,
|
||||
partida.impostoresActivos.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: BotonFarolero.oscuro(
|
||||
texto: l10n.notes,
|
||||
icono: Icons.edit_note,
|
||||
assetIconPath: 'assets/ui/generated/actions/action_notes_quill.webp',
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => const PantallaNotas()),
|
||||
child: Expanded(
|
||||
child: ListView.separated(
|
||||
itemCount: partida.jugadores.length,
|
||||
separatorBuilder: (context, index) => const SizedBox(height: 8),
|
||||
itemBuilder: (context, index) {
|
||||
final jugador = partida.jugadores[index];
|
||||
return EstadoJugadorFarolero(
|
||||
nombre: '${index + 1}. ${jugador.nombre}',
|
||||
subtitulo: jugador.eliminado ? l10n.eliminated : null,
|
||||
icono: jugador.eliminado ? Icons.person_off : Icons.record_voice_over,
|
||||
assetIconPath: jugador.eliminado ? null : 'assets/ui/generated/actions/action_players_group.webp',
|
||||
destacado: !jugador.eliminado,
|
||||
completado: !jugador.eliminado,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: BotonFarolero(
|
||||
texto: l10n.goToVoting,
|
||||
icono: Icons.how_to_vote,
|
||||
assetIconPath: 'assets/ui/generated/actions/action_vote_mask.webp',
|
||||
onPressed: _irAVotacion,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: BotonFarolero.oscuro(
|
||||
texto: l10n.notes,
|
||||
icono: Icons.edit_note,
|
||||
assetIconPath: 'assets/ui/generated/actions/action_notes_quill.webp',
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => const PantallaNotas()),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: BotonFarolero(
|
||||
texto: l10n.goToVoting,
|
||||
icono: Icons.how_to_vote,
|
||||
assetIconPath: 'assets/ui/generated/actions/action_vote_mask.webp',
|
||||
onPressed: _irAVotacion,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user