Skip to content

Commit c0013eb

Browse files
committed
feat: Added a link to the translation platform in the app settings.
1 parent 35f8452 commit c0013eb

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

lib/i18n/en/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@
151151
},
152152
"about": {
153153
"title": "About",
154+
"translate": {
155+
"title": "Help translating the app",
156+
"subtitle": "Open the app translation page. If you speak another language and you want to help translating $appName, you're in the right place !"
157+
},
154158
"github": {
155159
"title": "Report bugs or suggest new features",
156160
"subtitle": "Open the Github page of the app to report bugs or to suggest new features."

lib/i18n/fr/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@
151151
},
152152
"about": {
153153
"title": "À propos",
154+
"translate": {
155+
"title": "Aider à traduire l'application",
156+
"subtitle": "Ouvrir la page de traduction de l'application. Si vous parlez une autre langue et que vous souhaitez aider à traduire $appName, c'est ici !"
157+
},
154158
"github": {
155159
"title": "Signaler un bug ou suggérer des fonctionnalités",
156160
"subtitle": "Ouvrir la page Github de l'application pour signaler un bug ou suggérer des fonctionnalités."
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:open_authenticator/app.dart';
3+
import 'package:open_authenticator/i18n/translations.g.dart';
4+
import 'package:url_launcher/url_launcher.dart';
5+
6+
/// Takes the user to the app translation page.
7+
class TranslateSettingsEntryWidget extends StatelessWidget {
8+
/// Creates a new translate settings entry widget instance.
9+
const TranslateSettingsEntryWidget({
10+
super.key,
11+
});
12+
13+
@override
14+
Widget build(BuildContext context) => ListTile(
15+
leading: const Icon(Icons.translate),
16+
title: Text(translations.settings.about.translate.title),
17+
subtitle: Text(translations.settings.about.translate.subtitle(appName: App.appName)),
18+
onTap: () async {
19+
Uri uri = Uri.parse(App.appTranslationUrl);
20+
if (await canLaunchUrl(uri)) {
21+
launchUrl(uri);
22+
}
23+
},
24+
);
25+
}

0 commit comments

Comments
 (0)