diff --git a/lib/services/localization_service.dart b/lib/services/localization_service.dart index c2f7b62..78fc77f 100644 --- a/lib/services/localization_service.dart +++ b/lib/services/localization_service.dart @@ -99,10 +99,10 @@ class LocalizationService extends ChangeNotifier { String result = current is String ? current : key; - // Replace parameters if provided + // Replace parameters if provided - replace first occurrence only for each parameter if (params != null) { for (int i = 0; i < params.length; i++) { - result = result.replaceAll('{}', params[i]); + result = result.replaceFirst('{}', params[i]); } } diff --git a/lib/services/offline_areas/offline_area_downloader.dart b/lib/services/offline_areas/offline_area_downloader.dart index e4ba005..72a564f 100644 --- a/lib/services/offline_areas/offline_area_downloader.dart +++ b/lib/services/offline_areas/offline_area_downloader.dart @@ -156,7 +156,7 @@ class OfflineAreaDownloader { ); area.nodes = nodes; await OfflineAreaDownloader.saveNodes(nodes, directory); - debugPrint('Area ${area.id}: Downloaded ${nodes.length} nodes from modestly expanded bounds (zoom $nodeZoom vs tile minZoom $minZoom)'); + debugPrint('Area ${area.id}: Downloaded ${nodes.length} nodes from modestly expanded bounds (all profiles)'); } /// Calculate expanded bounds that cover the entire tile area at minimum zoom diff --git a/lib/widgets/download_area_dialog.dart b/lib/widgets/download_area_dialog.dart index 1c499c5..b4391ba 100644 --- a/lib/widgets/download_area_dialog.dart +++ b/lib/widgets/download_area_dialog.dart @@ -63,15 +63,13 @@ class _DownloadAreaDialogState extends State { final nTiles = computeTileList(bounds, minZoom, maxZoom).length; final totalMb = (nTiles * kTileEstimateKb) / 1024.0; - - // Debug logging to check calculation - debugPrint('[DownloadDialog] Tiles: $nTiles, EstimateKb: $kTileEstimateKb, Total MB: $totalMb'); + final roundedMb = (totalMb * 10).round() / 10; // Round to nearest tenth setState(() { _minZoom = minZoom; _maxPossibleZoom = maxPossibleZoom; _tileCount = nTiles; - _mbEstimate = totalMb; + _mbEstimate = roundedMb; }); } @@ -257,8 +255,8 @@ class _DownloadAreaDialogState extends State { OfflineAreaService().downloadArea( id: id, bounds: bounds, - minZoom: _minZoom ?? 12, - maxZoom: maxZoom, + minZoom: _minZoom ?? 1, + maxZoom: _zoom.toInt(), directory: dir, onProgress: (progress) {}, onComplete: (status) {},