From a01e1f42c3c2511405fc6e64d5a0c84f84f3583d Mon Sep 17 00:00:00 2001 From: vjrj <vjrj@comunes.org> Date: Tue, 15 Aug 2023 19:22:42 +0200 Subject: [PATCH] Qr Manager translated --- lib/ui/qr_manager_mobile.dart | 9 +++++---- lib/ui/qr_manager_web.dart | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ui/qr_manager_mobile.dart b/lib/ui/qr_manager_mobile.dart index 05f5ef79..16101636 100644 --- a/lib/ui/qr_manager_mobile.dart +++ b/lib/ui/qr_manager_mobile.dart @@ -1,5 +1,6 @@ // Import only for Android import 'package:barcode_scan2/barcode_scan2.dart'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -17,11 +18,11 @@ class QrManager { static Future<String?> _mobileQrScan() async { final ScanResult result = await BarcodeScanner.scan( - options: const ScanOptions( + options: ScanOptions( strings: <String, String>{ - 'cancel': 'CANCEL', - 'flash_on': 'FLASH ON', - 'flash_off': 'FLASH OFF', + 'cancel': tr('qr_scanner_cancel'), + 'flash_on': tr('qr_scanner_flash_on'), + 'flash_off': tr('qr_scanner_flash_off'), }, restrictFormat: <BarcodeFormat>[BarcodeFormat.qr], // useCamera: -1, diff --git a/lib/ui/qr_manager_web.dart b/lib/ui/qr_manager_web.dart index 025c3f03..5be67b48 100644 --- a/lib/ui/qr_manager_web.dart +++ b/lib/ui/qr_manager_web.dart @@ -37,7 +37,7 @@ class QrManager { insetPadding: const EdgeInsets.all(5), shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(10.0))), - title: const Text('Scan QR Code'), + title: Text(tr('qr_scanner_title')), content: SizedBox(height: height, width: width, child: sc), ); }); -- GitLab