fix. multiple call of translate for the same phrase

This commit is contained in:
grummbeer 2023-03-11 12:14:47 +01:00
parent 02e7e462cf
commit 293dea94c9

View File

@ -593,7 +593,7 @@ class WindowActionPanelState extends State<WindowActionPanel>
Offstage( Offstage(
offstage: !widget.showMinimize || Platform.isMacOS, offstage: !widget.showMinimize || Platform.isMacOS,
child: ActionIcon( child: ActionIcon(
message: translate('Minimize'), message: 'Minimize',
icon: IconFont.min, icon: IconFont.min,
onTap: () { onTap: () {
if (widget.isMainWindow) { if (widget.isMainWindow) {
@ -608,7 +608,7 @@ class WindowActionPanelState extends State<WindowActionPanel>
offstage: !widget.showMaximize || Platform.isMacOS, offstage: !widget.showMaximize || Platform.isMacOS,
child: Obx(() => ActionIcon( child: Obx(() => ActionIcon(
message: message:
widget.isMaximized.value ? translate("Restore") : translate("Maximize"), widget.isMaximized.value ? 'Restore' : 'Maximize',
icon: widget.isMaximized.value icon: widget.isMaximized.value
? IconFont.restore ? IconFont.restore
: IconFont.max, : IconFont.max,
@ -618,7 +618,7 @@ class WindowActionPanelState extends State<WindowActionPanel>
Offstage( Offstage(
offstage: !widget.showClose || Platform.isMacOS, offstage: !widget.showClose || Platform.isMacOS,
child: ActionIcon( child: ActionIcon(
message: translate('Close'), message: 'Close',
icon: IconFont.close, icon: IconFont.close,
onTap: () async { onTap: () async {
final res = await widget.onClose?.call() ?? true; final res = await widget.onClose?.call() ?? true;
@ -1076,7 +1076,7 @@ class AddButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ActionIcon( return ActionIcon(
message: translate('New Connection'), message: 'New Connection',
icon: IconFont.add, icon: IconFont.add,
onTap: () => rustDeskWinManager.call( onTap: () => rustDeskWinManager.call(
WindowType.Main, kWindowMainWindowOnTop, ""), WindowType.Main, kWindowMainWindowOnTop, ""),