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:farolero/modelos/inicio_partida_multijugador.dart';
|
||||
@@ -117,110 +118,113 @@ class _PantallaDebateClienteState extends State<PantallaDebateCliente> {
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: TemaApp.colorFondo,
|
||||
appBar: AppBar(
|
||||
title: Text(l10n.debate),
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
actions: [
|
||||
IconButton(
|
||||
tooltip: l10n.seeYourWord,
|
||||
icon: IconoFarolero(Icons.visibility),
|
||||
onPressed: widget.jugadoresControlados.isEmpty
|
||||
? null
|
||||
: () => mostrarRevisionPalabraOnline(
|
||||
context: context,
|
||||
jugadoresControlados: widget.jugadoresControlados,
|
||||
pistaImpostor: widget.pistaImpostor,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: l10n.notesTitle,
|
||||
icon: IconoFarolero(Icons.edit_note),
|
||||
onPressed: _puedeAbrirNotas
|
||||
? () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => PantallaNotasOnline(
|
||||
partidaId: widget.partidaId!,
|
||||
jugadores: widget.jugadores,
|
||||
autoresControlados: widget.jugadoresControlados,
|
||||
),
|
||||
return GuardiaSalidaPartida(
|
||||
contexto: ContextoSalida.cliente,
|
||||
child: Scaffold(
|
||||
backgroundColor: TemaApp.colorFondo,
|
||||
appBar: AppBar(
|
||||
title: Text(l10n.debate),
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
actions: [
|
||||
IconButton(
|
||||
tooltip: l10n.seeYourWord,
|
||||
icon: IconoFarolero(Icons.visibility),
|
||||
onPressed: widget.jugadoresControlados.isEmpty
|
||||
? null
|
||||
: () => mostrarRevisionPalabraOnline(
|
||||
context: context,
|
||||
jugadoresControlados: widget.jugadoresControlados,
|
||||
pistaImpostor: widget.pistaImpostor,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
body: FondoFarolero(
|
||||
intenso: true,
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
children: [
|
||||
const ArteGameplayFarolero.fase(height: 124),
|
||||
const SizedBox(height: 12),
|
||||
TarjetaFaseFarolero(
|
||||
icono: Icons.forum,
|
||||
assetIconPath: 'assets/ui/generated/actions/action_rules_book.webp',
|
||||
titulo: l10n.debate,
|
||||
subtitulo: l10n.debateInstructions,
|
||||
child: Column(
|
||||
children: [
|
||||
if (widget.tiempoDebateSegundos != null) ...[
|
||||
TemporizadorFarolero(
|
||||
etiqueta: _segundosRestantes == 0
|
||||
? l10n.timeUp
|
||||
: l10n.timeRemaining,
|
||||
tiempo: _formatearTiempo(_segundosRestantes),
|
||||
agotado: _segundosRestantes == 0,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
] else ...[
|
||||
Text(
|
||||
l10n.debatePhaseActive,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
if (widget.primerTurnoNombre != null) ...[
|
||||
EstadoJugadorFarolero(
|
||||
nombre: l10n.firstTurnInstruction(
|
||||
widget.primerTurnoNombre!,
|
||||
),
|
||||
IconButton(
|
||||
tooltip: l10n.notesTitle,
|
||||
icon: IconoFarolero(Icons.edit_note),
|
||||
onPressed: _puedeAbrirNotas
|
||||
? () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => PantallaNotasOnline(
|
||||
partidaId: widget.partidaId!,
|
||||
jugadores: widget.jugadores,
|
||||
autoresControlados: widget.jugadoresControlados,
|
||||
),
|
||||
destacado: true,
|
||||
completado: true,
|
||||
icono: Icons.record_voice_over,
|
||||
assetIconPath: 'assets/ui/generated/actions/action_players_group.webp',
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
body: FondoFarolero(
|
||||
intenso: true,
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
children: [
|
||||
const ArteGameplayFarolero.fase(height: 124),
|
||||
const SizedBox(height: 12),
|
||||
TarjetaFaseFarolero(
|
||||
icono: Icons.forum,
|
||||
assetIconPath: 'assets/ui/generated/actions/action_rules_book.webp',
|
||||
titulo: l10n.debate,
|
||||
subtitulo: l10n.debateInstructions,
|
||||
child: Column(
|
||||
children: [
|
||||
if (widget.tiempoDebateSegundos != null) ...[
|
||||
TemporizadorFarolero(
|
||||
etiqueta: _segundosRestantes == 0
|
||||
? l10n.timeUp
|
||||
: l10n.timeRemaining,
|
||||
tiempo: _formatearTiempo(_segundosRestantes),
|
||||
agotado: _segundosRestantes == 0,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
] else ...[
|
||||
Text(
|
||||
l10n.debatePhaseActive,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
if (widget.primerTurnoNombre != null) ...[
|
||||
EstadoJugadorFarolero(
|
||||
nombre: l10n.firstTurnInstruction(
|
||||
widget.primerTurnoNombre!,
|
||||
),
|
||||
destacado: true,
|
||||
completado: true,
|
||||
icono: Icons.record_voice_over,
|
||||
assetIconPath: 'assets/ui/generated/actions/action_players_group.webp',
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
],
|
||||
BotonFarolero.secundario(
|
||||
texto: _votacionSolicitada
|
||||
? l10n.votacionSolicitada
|
||||
: l10n.solicitarVotacion,
|
||||
icono: _votacionSolicitada
|
||||
? Icons.hourglass_empty
|
||||
: Icons.how_to_vote,
|
||||
assetIconPath: _votacionSolicitada
|
||||
? null
|
||||
: 'assets/ui/generated/actions/action_vote_mask.webp',
|
||||
onPressed: _votacionSolicitada
|
||||
? null
|
||||
: () {
|
||||
setState(() => _votacionSolicitada = true);
|
||||
widget.onSolicitarVotacion();
|
||||
},
|
||||
),
|
||||
],
|
||||
BotonFarolero.secundario(
|
||||
texto: _votacionSolicitada
|
||||
? l10n.votacionSolicitada
|
||||
: l10n.solicitarVotacion,
|
||||
icono: _votacionSolicitada
|
||||
? Icons.hourglass_empty
|
||||
: Icons.how_to_vote,
|
||||
assetIconPath: _votacionSolicitada
|
||||
? null
|
||||
: 'assets/ui/generated/actions/action_vote_mask.webp',
|
||||
onPressed: _votacionSolicitada
|
||||
? null
|
||||
: () {
|
||||
setState(() => _votacionSolicitada = true);
|
||||
widget.onSolicitarVotacion();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user