mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
feat: add i18n
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/ui/widgets/available_updates_card.dart';
|
||||
import 'package:revanced_manager/ui/widgets/installed_apps_card.dart';
|
||||
@ -33,26 +34,35 @@ class HomeView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 60),
|
||||
Text(
|
||||
"Dashboard",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 28,
|
||||
I18nText(
|
||||
'homeView.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 28,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 23),
|
||||
Text(
|
||||
"ReVanced Updates",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 18,
|
||||
I18nText(
|
||||
'homeView.updatesSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const LatestCommitCard(),
|
||||
const SizedBox(height: 14),
|
||||
Text(
|
||||
"Patched Applications",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 18,
|
||||
I18nText(
|
||||
'homeView.patchedSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/ui/views/app_selector/app_selector_view.dart';
|
||||
import 'package:revanced_manager/ui/widgets/app_selector_card.dart';
|
||||
@ -29,11 +30,14 @@ class PatcherView extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
"Patcher",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.w500,
|
||||
I18nText(
|
||||
'patcherView.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 23),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
|
||||
@ -23,17 +24,23 @@ class AppSelectorCard extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Select application",
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
I18nText(
|
||||
'appSelectorCard.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"No application selected",
|
||||
style: robotoTextStyle,
|
||||
I18nText(
|
||||
'appSelectorCard.widgetSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: robotoTextStyle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
@ -20,7 +21,7 @@ class ApplicationItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isSVG = asset.endsWith(".svg");
|
||||
final isSVG = asset.endsWith('.svg');
|
||||
return ListTile(
|
||||
horizontalTitleGap: 12.0,
|
||||
leading: isSVG
|
||||
@ -45,7 +46,10 @@ class ApplicationItem extends StatelessWidget {
|
||||
style: robotoTextStyle,
|
||||
),
|
||||
trailing: PatchTextButton(
|
||||
text: "Patch",
|
||||
text: FlutterI18n.translate(
|
||||
context,
|
||||
'applicationItem.patchButton',
|
||||
),
|
||||
onPressed: onPressed,
|
||||
),
|
||||
);
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/ui/widgets/application_item.dart';
|
||||
import 'package:revanced_manager/ui/widgets/patch_text_button.dart';
|
||||
@ -21,51 +22,60 @@ class AvailableUpdatesCard extends StatelessWidget {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Updates Available(2)",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
color: const Color(0xff7792BA),
|
||||
fontWeight: FontWeight.w500,
|
||||
I18nText(
|
||||
'availableUpdatesCard.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
color: const Color(0xff7792BA),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
PatchTextButton(
|
||||
text: "Patch all",
|
||||
text: FlutterI18n.translate(
|
||||
context,
|
||||
'availableUpdatesCard.patchButton',
|
||||
),
|
||||
onPressed: () {},
|
||||
backgroundColor: const Color(0xff7792BA),
|
||||
),
|
||||
],
|
||||
),
|
||||
ApplicationItem(
|
||||
asset: "assets/images/revanced.svg",
|
||||
name: "ReVanced",
|
||||
releaseDate: "2 days ago",
|
||||
asset: 'assets/images/revanced.svg',
|
||||
name: 'ReVanced',
|
||||
releaseDate: '2 days ago',
|
||||
onPressed: () {},
|
||||
),
|
||||
ApplicationItem(
|
||||
asset: "assets/images/reddit.png",
|
||||
name: "ReReddit",
|
||||
releaseDate: "Released 1 month ago",
|
||||
asset: 'assets/images/reddit.png',
|
||||
name: 'ReReddit',
|
||||
releaseDate: 'Released 1 month ago',
|
||||
onPressed: () {},
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"Changelog",
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
fontWeight: FontWeight.w700,
|
||||
I18nText(
|
||||
'availableUpdatesCard.changelogLabel',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"fix: we made the player even worse (you love)",
|
||||
'fix: we made the player even worse (you love)',
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"chore: guhhughghu",
|
||||
'chore: guhhughghu',
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/ui/widgets/application_item.dart';
|
||||
|
||||
@ -17,37 +18,43 @@ class InstalledAppsCard extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Total Installed(3)",
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
color: const Color(0xff7792BA),
|
||||
fontWeight: FontWeight.w500,
|
||||
I18nText(
|
||||
'installedAppsCard.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
color: const Color(0xff7792BA),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
ApplicationItem(
|
||||
asset: "assets/images/revanced.svg",
|
||||
name: "ReVanced",
|
||||
releaseDate: "2 days ago",
|
||||
asset: 'assets/images/revanced.svg',
|
||||
name: 'ReVanced',
|
||||
releaseDate: '2 days ago',
|
||||
onPressed: () {},
|
||||
),
|
||||
Text(
|
||||
"Changelog",
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
fontWeight: FontWeight.w700,
|
||||
I18nText(
|
||||
'installedAppsCard.changelogLabel',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"fix: we made the player even worse (you love)",
|
||||
'fix: we made the player even worse (you love)',
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"chore: guhhughghu",
|
||||
'chore: guhhughghu',
|
||||
style: GoogleFonts.roboto(
|
||||
color: const Color(0xff8691A0),
|
||||
),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/services/github_api.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
@ -13,14 +14,14 @@ class LatestCommitCard extends StatefulWidget {
|
||||
|
||||
class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
GithubAPI githubAPI = GithubAPI();
|
||||
String lastPatcherCommit = "Loading...";
|
||||
String lastManagerCommit = "Loading...";
|
||||
String lastPatcherCommit = 'Loading...';
|
||||
String lastManagerCommit = 'Loading...';
|
||||
|
||||
void latestCommit() async {
|
||||
// lastPatcherCommit =
|
||||
// await githubAPI.latestCommitTime("revanced", "revanced-patcher");
|
||||
// await githubAPI.latestCommitTime('revanced', 'revanced-patcher');
|
||||
// lastManagerCommit =
|
||||
// await githubAPI.latestCommitTime("revanced", "revanced-manager");
|
||||
// await githubAPI.latestCommitTime('revanced', 'revanced-manager');
|
||||
}
|
||||
|
||||
@override
|
||||
@ -47,28 +48,34 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"Patcher: ",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w700,
|
||||
I18nText(
|
||||
'latestCommitCard.patcherLabel',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"$lastPatcherCommit ago",
|
||||
'$lastPatcherCommit ago',
|
||||
style: robotoTextStyle,
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"Manager: ",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w700,
|
||||
I18nText(
|
||||
'latestCommitCard.managerLabel',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"$lastManagerCommit ago",
|
||||
'$lastManagerCommit ago',
|
||||
style: robotoTextStyle,
|
||||
)
|
||||
],
|
||||
@ -76,7 +83,10 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
],
|
||||
),
|
||||
PatchTextButton(
|
||||
text: "Update Manager",
|
||||
text: FlutterI18n.translate(
|
||||
context,
|
||||
'latestCommitCard.updateButton',
|
||||
),
|
||||
onPressed: () {},
|
||||
backgroundColor: const Color(0xff7792BA),
|
||||
),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
|
||||
@ -23,17 +24,23 @@ class PatchSelectorCard extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Select patches",
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
I18nText(
|
||||
'patchSelectorCard.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Select an application first.",
|
||||
style: robotoTextStyle,
|
||||
I18nText(
|
||||
'patchSelectorCard.widgetSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: robotoTextStyle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
Reference in New Issue
Block a user