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 'package:flutter/material.dart';
|
||||
import 'package:farolero/tema/dialogo_confirmacion.dart';
|
||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||
import 'package:farolero/modelos/inicio_partida_multijugador.dart';
|
||||
import 'package:farolero/modelos/jugador.dart';
|
||||
@@ -17,6 +18,10 @@ class PantallaVotacionCliente extends StatefulWidget {
|
||||
final String? pistaImpostor;
|
||||
final Function(Map<String, String> votos) onVotos;
|
||||
|
||||
/// El host abre esta pantalla desde el gestor: allí el atrás solo
|
||||
/// debe cerrarla, no ofrecer abandonar la partida.
|
||||
final bool protegerSalida;
|
||||
|
||||
const PantallaVotacionCliente({
|
||||
super.key,
|
||||
required this.jugadores,
|
||||
@@ -24,6 +29,7 @@ class PantallaVotacionCliente extends StatefulWidget {
|
||||
this.partidaId,
|
||||
this.pistaImpostor,
|
||||
required this.onVotos,
|
||||
this.protegerSalida = true,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -63,7 +69,10 @@ class _PantallaVotacionClienteState extends State<PantallaVotacionCliente> {
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
|
||||
return Scaffold(
|
||||
return GuardiaSalidaPartida(
|
||||
contexto: ContextoSalida.cliente,
|
||||
activo: widget.protegerSalida,
|
||||
child: Scaffold(
|
||||
backgroundColor: TemaApp.colorFondo,
|
||||
appBar: AppBar(
|
||||
title: Text(l10n.voting),
|
||||
@@ -155,6 +164,7 @@ class _PantallaVotacionClienteState extends State<PantallaVotacionCliente> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user