Skip to content

Commit 394dd30

Browse files
authored
Merge branch 'Translation/Crowdin' into l10n/Crowdin_sync
2 parents 7ff4531 + 88d4bdc commit 394dd30

22 files changed

Lines changed: 2436 additions & 3214 deletions

l10n/app_en.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,5 +931,6 @@
931931
"settings_translateWithCrowdin": "Translate Piwigo NG",
932932
"settings_acknowledgements": "Acknowledgements",
933933
"settings_privacy": "Privacy Policy",
934+
"settings_unknownVersion": "Unknown version",
934935
"settings_privacyUrl": "&lang=en_EN"
935936
}

l10n/app_es.arb

Lines changed: 761 additions & 772 deletions
Large diffs are not rendered by default.

l10n/app_lt.arb

Lines changed: 764 additions & 772 deletions
Large diffs are not rendered by default.

l10n/app_sk.arb

Lines changed: 761 additions & 772 deletions
Large diffs are not rendered by default.

lib/api/images.dart

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,19 +212,23 @@ Future<XFile?> downloadImage(String dirPath, ImageModel image) async {
212212

213213
Future<int> deleteImages(
214214
List<ImageModel> imageList,
215-
AlbumModel album,
215+
AlbumModel? album,
216216
DeleteAlbumModes mode,
217217
) async {
218218
int nbSuccess = 0;
219219
for (ImageModel image in imageList) {
220220
bool response = false;
221-
switch (mode) {
222-
case DeleteAlbumModes.noDelete:
223-
response = await removeImage(image, album.id);
224-
break;
225-
default:
226-
response = await deleteImage(image);
227-
break;
221+
if (album == null) {
222+
response = await deleteImage(image);
223+
} else {
224+
switch (mode) {
225+
case DeleteAlbumModes.noDelete:
226+
response = await removeImage(image, album.id);
227+
break;
228+
default:
229+
response = await deleteImage(image);
230+
break;
231+
}
228232
}
229233
if (response == true) {
230234
nbSuccess++;

lib/api/upload.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import '../services/chunked_uploader.dart';
2323
import '../services/notification_service.dart';
2424

2525
Future<void> _showUploadNotification({bool success = true}) async {
26+
if (!Preferences.getUploadNotification) return;
2627
final android = AndroidNotificationDetails(
2728
'piwigo-ng-upload',
2829
'Piwigo NG Upload',
@@ -124,12 +125,7 @@ Future<List<Map<String, dynamic>>> uploadPhotos(
124125
debugPrint("$e");
125126
}
126127
}
127-
if (Preferences.getUploadNotification) {
128-
if (result.isEmpty) {
129-
_showUploadNotification(success: false);
130-
}
131-
_showUploadNotification(success: true);
132-
}
128+
_showUploadNotification(success: result.isNotEmpty);
133129
if (result.isEmpty) return [];
134130
uploadCompletedList = result.map<int>((e) => e['id']).toList();
135131
try {

lib/app.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class App extends StatelessWidget {
4545
Locale('en'),
4646
Locale('de'),
4747
Locale('fr'),
48+
Locale('es'),
49+
Locale('lt'),
50+
Locale('sk'),
4851
Locale('zh'),
4952
],
5053
locale: localNotifier.locale,

lib/components/appbars/root_search_app_bar.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:piwigo_ng/utils/localizations.dart';
23

34
import '../../views/settings/settings_view_page.dart';
45
import '../fields/app_field.dart';
@@ -99,7 +100,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
99100
vertical: 16,
100101
),
101102
title: Text(
102-
'Albums', // Todo: Use translations
103+
appStrings.tabBar_albums,
103104
textScaleFactor: 1,
104105
style: Theme.of(context).appBarTheme.titleTextStyle,
105106
),

lib/components/appbars/settings_app_bar.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:piwigo_ng/utils/localizations.dart';
23

34
class SettingsAppBar extends StatefulWidget {
45
const SettingsAppBar({
@@ -32,8 +33,7 @@ class _SettingsAppBarState extends State<SettingsAppBar> {
3233
}
3334

3435
// In case 0%-100% of the expanded height is viewed
35-
double scrollDelta =
36-
(_expandedHeight - widget.scrollController.offset) / _expandedHeight;
36+
double scrollDelta = (_expandedHeight - widget.scrollController.offset) / _expandedHeight;
3737
double scrollPercent = (scrollDelta * 2 - 1);
3838
return (1 - scrollPercent) * delta * basePadding + basePadding;
3939
}
@@ -44,9 +44,8 @@ class _SettingsAppBarState extends State<SettingsAppBar> {
4444
@override
4545
Widget build(BuildContext context) {
4646
return SliverAppBar(
47-
leading: IconButton(
47+
leading: BackButton(
4848
onPressed: () => Navigator.of(context).pop(),
49-
icon: const Icon(Icons.arrow_back),
5049
),
5150
pinned: true,
5251
expandedHeight: _expandedHeight,
@@ -56,7 +55,7 @@ class _SettingsAppBarState extends State<SettingsAppBar> {
5655
vertical: 16,
5756
),
5857
title: Text(
59-
'Settings', // Todo: Use translations
58+
appStrings.tabBar_preferences,
6059
textScaleFactor: 1,
6160
style: Theme.of(context).appBarTheme.titleTextStyle,
6261
),

lib/components/buttons/app_text_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AppTextButton extends StatelessWidget {
3030
TextStyle(
3131
color: Theme.of(context).primaryColor,
3232
fontWeight: FontWeight.w500,
33-
), // Todo: Text button text style
33+
),
3434
),
3535
),
3636
);

0 commit comments

Comments
 (0)