fix(i18n): normalize translations and fallbacks
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../l10n/gen/app_localizations.dart';
|
||||
import '../tema/pluriwave_tokens.dart';
|
||||
import '../tema/pluriwave_theme.dart';
|
||||
|
||||
@@ -62,7 +63,7 @@ class PluriIcon extends StatelessWidget {
|
||||
: icon;
|
||||
|
||||
return Semantics(
|
||||
label: semanticLabel ?? _fallbackLabel(glyph),
|
||||
label: semanticLabel ?? _fallbackLabel(AppLocalizations.of(context), glyph),
|
||||
image: true,
|
||||
child: ExcludeSemantics(child: child),
|
||||
);
|
||||
@@ -108,14 +109,14 @@ class PluriIcon extends StatelessWidget {
|
||||
};
|
||||
}
|
||||
|
||||
String _fallbackLabel(PluriIconGlyph glyph) {
|
||||
String _fallbackLabel(AppLocalizations l10n, PluriIconGlyph glyph) {
|
||||
return switch (glyph) {
|
||||
PluriIconGlyph.home => 'Inicio',
|
||||
PluriIconGlyph.search => 'Buscar',
|
||||
PluriIconGlyph.favorites => 'Favoritos',
|
||||
PluriIconGlyph.alarm => 'Alarmas',
|
||||
PluriIconGlyph.player => 'Reproductor',
|
||||
PluriIconGlyph.settings => 'Ajustes',
|
||||
PluriIconGlyph.home => l10n.navHome,
|
||||
PluriIconGlyph.search => l10n.navSearch,
|
||||
PluriIconGlyph.favorites => l10n.navFavorites,
|
||||
PluriIconGlyph.alarm => l10n.navAlarms,
|
||||
PluriIconGlyph.player => l10n.playerIconLabel,
|
||||
PluriIconGlyph.settings => l10n.navSettings,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user