Update license notice localization

This keeps the main info text in one block, otherwise translating these
can get tricky
This commit is contained in:
Roland Geider
2025-10-06 21:00:48 +02:00
parent 949ad02ab6
commit a76ca9ae36
2 changed files with 10 additions and 26 deletions

View File

@@ -769,14 +769,8 @@
"@imageDetailsImageType": {
"description": "Label for image type selector"
},
"imageDetailsLicenseNoticePrefix": "By submitting this image, you agree to release it under the ",
"@imageDetailsLicenseNoticePrefix": {
"description": "First part of license notice text"
},
"imageDetailsLicenseNoticeSuffix": " The image must be either your own work or the author must have released it under a license compatible with CC BY-SA 4.0.",
"@imageDetailsLicenseNoticeSuffix": {
"description": "Second part of license notice text"
},
"imageDetailsLicenseNotice": "By submitting this image, you agree to release it under the CC-BY-SA-4. The image must be either your own work or the author must have released it under a license compatible with it.",
"imageDetailsLicenseNoticeLinkToLicense": "See license text.",
"add": "add",
"@add": {
"description": "Add button text"

View File

@@ -15,35 +15,28 @@ class LicenseInfoWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final i18n = AppLocalizations.of(context);
final colorScheme = Theme.of(context).colorScheme;
return Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: colorScheme.surfaceVariant,
color: colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(4),
border: Border.all(color: colorScheme.outline),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.info_outline,
size: 20,
color: colorScheme.onSurfaceVariant,
),
Icon(Icons.info_outline, size: 20, color: colorScheme.onSurfaceVariant),
const SizedBox(width: 8),
Expanded(
child: RichText(
text: TextSpan(
style: TextStyle(
fontSize: 12,
color: colorScheme.onSurfaceVariant,
),
style: TextStyle(fontSize: 12, color: colorScheme.onSurfaceVariant),
children: [
TextSpan(
text: AppLocalizations.of(context).imageDetailsLicenseNoticePrefix,
),
TextSpan(text: i18n.imageDetailsLicenseNotice),
WidgetSpan(
child: GestureDetector(
onTap: () async {
@@ -53,7 +46,7 @@ class LicenseInfoWidget extends StatelessWidget {
}
},
child: Text(
'CC BY-SA 4.0',
i18n.imageDetailsLicenseNoticeLinkToLicense,
style: TextStyle(
fontSize: 12,
color: colorScheme.primary,
@@ -63,9 +56,6 @@ class LicenseInfoWidget extends StatelessWidget {
),
),
),
TextSpan(
text: AppLocalizations.of(context).imageDetailsLicenseNoticeSuffix,
),
],
),
),
@@ -74,4 +64,4 @@ class LicenseInfoWidget extends StatelessWidget {
),
);
}
}
}