fix(i18n): enforce complete localized coverage
This commit is contained in:
@@ -64,7 +64,7 @@ class _RemoteSessionDialogState extends State<RemoteSessionDialog> with MountedS
|
||||
} catch (e) {
|
||||
setStateIfMounted(() {
|
||||
_isStarting = false;
|
||||
_errorMessage = e.toString();
|
||||
_errorMessage = t.companionRemote.errors.serverStartFailed(error: e.toString().replaceFirst('Exception: ', ''));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -113,15 +113,7 @@ class _RemoteSessionDialogState extends State<RemoteSessionDialog> with MountedS
|
||||
if (_errorMessage != null) {
|
||||
return AlertDialog(
|
||||
title: Text(t.common.error),
|
||||
content: Column(
|
||||
mainAxisSize: .min,
|
||||
crossAxisAlignment: .start,
|
||||
children: [
|
||||
Text(t.companionRemote.session.failedToCreate),
|
||||
const SizedBox(height: 8),
|
||||
Text(_errorMessage!, style: const TextStyle(fontFamily: 'monospace')),
|
||||
],
|
||||
),
|
||||
content: Text(_errorMessage!, style: const TextStyle(fontFamily: 'monospace')),
|
||||
actions: [
|
||||
FocusableButton(
|
||||
autofocus: true,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../i18n/strings.g.dart';
|
||||
import '../focus/dpad_navigator.dart';
|
||||
import '../focus/focus_theme.dart';
|
||||
import '../focus/focusable_text_field.dart';
|
||||
@@ -124,6 +125,7 @@ class _TvColorPickerState extends State<TvColorPicker> with ControllerDisposerMi
|
||||
const SizedBox(height: 16),
|
||||
_ColorChannelRow(
|
||||
label: 'H',
|
||||
semanticLabel: Translations.of(context).accessibility.hue,
|
||||
value: _hue,
|
||||
min: 0,
|
||||
max: 360,
|
||||
@@ -139,6 +141,7 @@ class _TvColorPickerState extends State<TvColorPicker> with ControllerDisposerMi
|
||||
const SizedBox(height: 8),
|
||||
_ColorChannelRow(
|
||||
label: 'S',
|
||||
semanticLabel: Translations.of(context).accessibility.saturation,
|
||||
value: _saturation,
|
||||
min: 0,
|
||||
max: 100,
|
||||
@@ -153,6 +156,7 @@ class _TvColorPickerState extends State<TvColorPicker> with ControllerDisposerMi
|
||||
const SizedBox(height: 8),
|
||||
_ColorChannelRow(
|
||||
label: 'V',
|
||||
semanticLabel: Translations.of(context).accessibility.brightness,
|
||||
value: _value,
|
||||
min: 0,
|
||||
max: 100,
|
||||
@@ -168,7 +172,11 @@ class _TvColorPickerState extends State<TvColorPicker> with ControllerDisposerMi
|
||||
FocusableTextField(
|
||||
controller: _hexController,
|
||||
focusNode: _hexFocusNode,
|
||||
decoration: const InputDecoration(prefixText: '#', labelText: 'Hex', border: OutlineInputBorder()),
|
||||
decoration: InputDecoration(
|
||||
prefixText: '#',
|
||||
labelText: Translations.of(context).accessibility.hexColor,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
maxLength: 6,
|
||||
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(r'[0-9a-fA-F]'))],
|
||||
onChanged: _onHexChanged,
|
||||
@@ -184,6 +192,7 @@ class _TvColorPickerState extends State<TvColorPicker> with ControllerDisposerMi
|
||||
/// UP/DOWN are ignored so focus traverses normally between rows.
|
||||
class _ColorChannelRow extends StatefulWidget {
|
||||
final String label;
|
||||
final String semanticLabel;
|
||||
final int value;
|
||||
final int min;
|
||||
final int max;
|
||||
@@ -197,6 +206,7 @@ class _ColorChannelRow extends StatefulWidget {
|
||||
|
||||
const _ColorChannelRow({
|
||||
required this.label,
|
||||
required this.semanticLabel,
|
||||
required this.value,
|
||||
required this.min,
|
||||
required this.max,
|
||||
@@ -317,7 +327,7 @@ class _ColorChannelRowState extends State<_ColorChannelRow> with KeyRepeatHelper
|
||||
_ChannelButton(
|
||||
icon: Symbols.remove_rounded,
|
||||
onPressed: canDecrement ? _decrement : null,
|
||||
semanticLabel: 'Decrease ${widget.label}',
|
||||
semanticLabel: Translations.of(context).accessibility.decreaseValue(label: widget.semanticLabel),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
@@ -329,7 +339,7 @@ class _ColorChannelRowState extends State<_ColorChannelRow> with KeyRepeatHelper
|
||||
_ChannelButton(
|
||||
icon: Symbols.add_rounded,
|
||||
onPressed: canIncrement ? _increment : null,
|
||||
semanticLabel: 'Increase ${widget.label}',
|
||||
semanticLabel: Translations.of(context).accessibility.increaseValue(label: widget.semanticLabel),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../i18n/strings.g.dart';
|
||||
import '../focus/dpad_navigator.dart';
|
||||
import '../focus/focus_theme.dart';
|
||||
import '../focus/input_mode_tracker.dart';
|
||||
@@ -155,7 +156,7 @@ class _TvNumberSpinnerState extends State<TvNumberSpinner> with KeyRepeatHelper<
|
||||
onPressed: canDecrement ? _decrement : null,
|
||||
onLongPressStart: canDecrement ? () => startRepeat(_decrement) : null,
|
||||
onLongPressEnd: stopRepeat,
|
||||
semanticLabel: 'Decrease',
|
||||
semanticLabel: Translations.of(context).accessibility.decrease,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Container(
|
||||
@@ -172,7 +173,7 @@ class _TvNumberSpinnerState extends State<TvNumberSpinner> with KeyRepeatHelper<
|
||||
onPressed: canIncrement ? _increment : null,
|
||||
onLongPressStart: canIncrement ? () => startRepeat(_increment) : null,
|
||||
onLongPressEnd: stopRepeat,
|
||||
semanticLabel: 'Increase',
|
||||
semanticLabel: Translations.of(context).accessibility.increase,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user