toolbbar tooltips
This commit is contained in:
parent
b382f93abb
commit
87992d5581
3 changed files with 53 additions and 51 deletions
|
|
@ -3934,8 +3934,11 @@
|
|||
"continuedWithoutSubscription": "Continue without subscribing",
|
||||
"trialPeriodExpired": "Your trial period has expired",
|
||||
"selectToDefine": "To define a word in this message, just select it!",
|
||||
"translation": "translation",
|
||||
"audio": "message audio",
|
||||
"translations": "translations",
|
||||
"messageAudio": "message audio",
|
||||
"definitions": "definitions",
|
||||
"subscribedToUnlockTools": "Subscribe to unlock language tools, including"
|
||||
"subscribedToUnlockTools": "Subscribe to unlock language tools, including",
|
||||
"more": "More",
|
||||
"translationTooltip": "Translate",
|
||||
"audioTooltip": "Play Audio"
|
||||
}
|
||||
|
|
@ -4550,54 +4550,33 @@
|
|||
"showDefinition": "Mostrar definición",
|
||||
"acceptedKeyVerification": "{sender} verificación de clave aceptada",
|
||||
"@acceptedKeyVerification": {
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
"sender": {}
|
||||
}
|
||||
},
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
"sender": {}
|
||||
}
|
||||
},
|
||||
"canceledKeyVerification": "{sender} canceló la verificación de claves",
|
||||
"@canceledKeyVerification": {
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
"sender": {}
|
||||
}
|
||||
},
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
"sender": {}
|
||||
}
|
||||
},
|
||||
"completedKeyVerification": "{sender} verificación de claves completada",
|
||||
"@canceledKeyVerification": {
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
"sender": {}
|
||||
}
|
||||
},
|
||||
"isReadyForKeyVerification": "{sender} está listo para la verificación de claves",
|
||||
"@canceledKeyVerification": {
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
"sender": {}
|
||||
}
|
||||
},
|
||||
"requestedKeyVerification": "{sender} solicitó verificación de claves",
|
||||
"@canceledKeyVerification": {
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
"sender": {}
|
||||
}
|
||||
},
|
||||
"startedKeyVerification": "{sender} ha iniciado la verificación de claves",
|
||||
"@canceledKeyVerification": {
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
"sender": {}
|
||||
}
|
||||
},
|
||||
"subscriptionPopupTitle": "Esta frase podría tener un error gramatical...",
|
||||
"subscriptionPopupDesc": "Suscríbase hoy mismo para desbloquear la traducción y la corrección gramatical.",
|
||||
"seeOptions": "Ver opciones",
|
||||
"continuedWithoutSubscription": "Continuar sin suscribirse",
|
||||
"trialPeriodExpired": "Su periodo de prueba ha expirado",
|
||||
"selectToDefine": "Para definir una palabra en este mensaje, ¡sólo tiene que seleccionarla!",
|
||||
"translation": "traducción",
|
||||
"audio": "mensaje de audio",
|
||||
"translations": "traducciónes",
|
||||
"messageAudio": "mensaje de audio",
|
||||
"definitions": "definiciones",
|
||||
"subscribedToUnlockTools": "Suscríbase para desbloquear herramientas lingüísticas, como"
|
||||
"subscribedToUnlockTools": "Suscríbase para desbloquear herramientas lingüísticas, como",
|
||||
"more": "Más",
|
||||
"translationTooltip": "Traducir",
|
||||
"audioTooltip": "Reproducir audio"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,9 +167,9 @@ class MessageToolbarState extends State<MessageToolbar> {
|
|||
String getModeTitle(MessageMode mode) {
|
||||
switch (mode) {
|
||||
case MessageMode.translation:
|
||||
return L10n.of(context)!.translation;
|
||||
return L10n.of(context)!.translations;
|
||||
case MessageMode.play:
|
||||
return L10n.of(context)!.audio;
|
||||
return L10n.of(context)!.messageAudio;
|
||||
case MessageMode.definition:
|
||||
return L10n.of(context)!.definitions;
|
||||
default:
|
||||
|
|
@ -178,6 +178,20 @@ class MessageToolbarState extends State<MessageToolbar> {
|
|||
}
|
||||
}
|
||||
|
||||
String getModeTooltip(MessageMode mode) {
|
||||
switch (mode) {
|
||||
case MessageMode.translation:
|
||||
return L10n.of(context)!.translationTooltip;
|
||||
case MessageMode.play:
|
||||
return L10n.of(context)!.audioTooltip;
|
||||
case MessageMode.definition:
|
||||
return L10n.of(context)!.define;
|
||||
default:
|
||||
return L10n.of(context)!
|
||||
.oopsSomethingWentWrong; // Title to indicate an error or unsupported mode
|
||||
}
|
||||
}
|
||||
|
||||
void updateMode(MessageMode newMode) {
|
||||
debugPrint("updating toolbar mode");
|
||||
final bool subscribed =
|
||||
|
|
@ -320,18 +334,24 @@ class MessageToolbarState extends State<MessageToolbar> {
|
|||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: MessageMode.values.map((mode) {
|
||||
return IconButton(
|
||||
icon: Icon(getIconData(mode)),
|
||||
color: currentMode == mode
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: null,
|
||||
onPressed: () => updateMode(mode),
|
||||
return Tooltip(
|
||||
message: getModeTooltip(mode),
|
||||
child: IconButton(
|
||||
icon: Icon(getIconData(mode)),
|
||||
color: currentMode == mode
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: null,
|
||||
onPressed: () => updateMode(mode),
|
||||
),
|
||||
);
|
||||
}).toList() +
|
||||
[
|
||||
IconButton(
|
||||
icon: Icon(Icons.adaptive.more_outlined),
|
||||
onPressed: showMore,
|
||||
Tooltip(
|
||||
message: L10n.of(context)!.more,
|
||||
child: IconButton(
|
||||
icon: Icon(Icons.adaptive.more_outlined),
|
||||
onPressed: showMore,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue