Skip to content

An open-source cross-platform alternative to AirDrop

fix: drop i18n from changelog content (#3757)

Tien Nam Do6f7f49820371
diff --git a/app/assets/i18n/en.json b/app/assets/i18n/en.json
index 5659785c..06e521b4 100644
--- a/app/assets/i18n/en.json
+++ b/app/assets/i18n/en.json
@@ -333,15 +333,7 @@
"restore": "Restore purchase"
},
"changelogPage": {
- "title": "Changelog",
- "categories": {
- "feature": "New features",
- "security": "Security",
- "performance": "Performance",
- "fix": "Bug fixes",
- "other": "Other"
- },
- "breaking": "Breaking change"
+ "title": "Changelog"
},
"whatsNewPage": {
"title": "What's new in {version}",
diff --git a/app/lib/gen/strings.g.dart b/app/lib/gen/strings.g.dart
index d09545bf..723d1cbd 100644
--- a/app/lib/gen/strings.g.dart
+++ b/app/lib/gen/strings.g.dart
@@ -4,7 +4,7 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 59
-/// Strings: 22432 (380 per locale)
+/// Strings: 22426 (380 per locale)
// coverage:ignore-file
// ignore_for_file: type=lint, unused_import
diff --git a/app/lib/gen/strings_en.g.dart b/app/lib/gen/strings_en.g.dart
index 3c89a1e1..efecd412 100644
--- a/app/lib/gen/strings_en.g.dart
+++ b/app/lib/gen/strings_en.g.dart
@@ -651,11 +651,6 @@ class Translations$changelogPage$en {
/// en: 'Changelog'
String get title => 'Changelog';
-
- late final Translations$changelogPage$categories$en categories = Translations$changelogPage$categories$en.internal(_root);
-
- /// en: 'Breaking change'
- String get breaking => 'Breaking change';
}
// Path: whatsNewPage
@@ -1453,30 +1448,6 @@ class Translations$progressPage$remainingTime$en {
'${_root.progressPage.remainingTime.hoursUnit(h: h)} ${_root.progressPage.remainingTime.minutesUnit(m: m)}';
}
-// Path: changelogPage.categories
-class Translations$changelogPage$categories$en {
- Translations$changelogPage$categories$en.internal(this._root);
-
- final Translations _root; // ignore: unused_field
-
- // Translations
-
- /// en: 'New features'
- String get feature => 'New features';
-
- /// en: 'Security'
- String get security => 'Security';
-
- /// en: 'Performance'
- String get performance => 'Performance';
-
- /// en: 'Bug fixes'
- String get fix => 'Bug fixes';
-
- /// en: 'Other'
- String get other => 'Other';
-}
-
// Path: whatsNewPage.changes
class Translations$whatsNewPage$changes$en {
Translations$whatsNewPage$changes$en.internal(this._root);
diff --git a/app/lib/widget/changelog_release.dart b/app/lib/widget/changelog_release.dart
index db599b51..8cdb296b 100644
--- a/app/lib/widget/changelog_release.dart
+++ b/app/lib/widget/changelog_release.dart
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:localsend_app/config/theme.dart';
-import 'package:localsend_app/gen/strings.g.dart';
import 'package:localsend_app/model/changelog.dart';
import 'package:localsend_app/util/system_date_time_formatter.dart';
import 'package:localsend_app/widget/device_bage.dart';
@@ -74,34 +73,36 @@ class ChangelogReleaseBody extends StatelessWidget {
},
);
final scopeBadgeColor = Color.lerp(colors.secondaryContainer, Colors.white, 0.3)!;
- return Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- if (release.notes.isNotEmpty) _ltr(Text(release.notes)),
- for (final (category, icon, label) in [
- (ChangelogCategory.feature, Icons.auto_awesome, t.changelogPage.categories.feature),
- (ChangelogCategory.security, Icons.shield_outlined, t.changelogPage.categories.security),
- (ChangelogCategory.performance, Icons.speed, t.changelogPage.categories.performance),
- (ChangelogCategory.fix, Icons.bug_report_outlined, t.changelogPage.categories.fix),
- (ChangelogCategory.other, Icons.more_horiz, t.changelogPage.categories.other),
- ])
- if (release.entries.any((entry) => entry.category == category)) ...[
- Padding(
- padding: const EdgeInsets.only(top: 14, bottom: 2),
- child: Row(
- children: [
- Icon(icon, size: 18, color: colors.primary),
- const SizedBox(width: 8),
- Text(label, style: theme.textTheme.titleSmall?.copyWith(color: colors.primary)),
- ],
+ // The changelog is only available in English, so it is laid out left-to-right in every locale.
+ return Directionality(
+ textDirection: TextDirection.ltr,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ if (release.notes.isNotEmpty) Text(release.notes),
+ for (final (category, icon, label) in [
+ (ChangelogCategory.feature, Icons.auto_awesome, 'New features'),
+ (ChangelogCategory.security, Icons.shield_outlined, 'Security'),
+ (ChangelogCategory.performance, Icons.speed, 'Performance'),
+ (ChangelogCategory.fix, Icons.bug_report_outlined, 'Bug fixes'),
+ (ChangelogCategory.other, Icons.more_horiz, 'Other'),
+ ])
+ if (release.entries.any((entry) => entry.category == category)) ...[
+ Padding(
+ padding: const EdgeInsets.only(top: 14, bottom: 2),
+ child: Row(
+ children: [
+ Icon(icon, size: 18, color: colors.primary),
+ const SizedBox(width: 8),
+ Text(label, style: theme.textTheme.titleSmall?.copyWith(color: colors.primary)),
+ ],
+ ),
),
- ),
- for (final entry in release.entries)
- if (entry.category == category)
- Padding(
- padding: const EdgeInsets.only(top: 6),
- child: _ltr(
- Row(
+ for (final entry in release.entries)
+ if (entry.category == category)
+ Padding(
+ padding: const EdgeInsets.only(top: 6),
+ child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('•'),
@@ -112,7 +113,7 @@ class ChangelogReleaseBody extends StatelessWidget {
children: [
for (final scope in entry.scopes)
_badge(_scopeLabels[scope.toLowerCase()] ?? scope, scopeBadgeColor, colors.onSecondaryContainer),
- if (entry.breaking) _badge(t.changelogPage.breaking, colors.warning.withValues(alpha: 0.15), colors.warning),
+ if (entry.breaking) _badge('Breaking change', colors.warning.withValues(alpha: 0.15), colors.warning),
..._spansWithInlineCode(entry.text, codeStyle),
],
),
@@ -121,16 +122,13 @@ class ChangelogReleaseBody extends StatelessWidget {
],
),
),
- ),
- ],
- ],
+ ],
+ ],
+ ),
);
}
}
-/// The changelog is only available in English, so its text is laid out left-to-right in every locale.
-Widget _ltr(Widget child) => Directionality(textDirection: TextDirection.ltr, child: child);
-
InlineSpan _badge(String label, Color backgroundColor, Color foregroundColor) {
return WidgetSpan(
alignment: PlaceholderAlignment.middle,