From 4596e11ab432da4745f53bdb316623a531634212 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 1 Sep 2020 10:48:05 +0200 Subject: [PATCH] PurchaseScreen: Make all strings translatable --- assets/langs/en.yaml | 8 +++++++- lib/screens/purchase_screen.dart | 15 +++++++-------- lib/widgets/purchase_widget.dart | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/assets/langs/en.yaml b/assets/langs/en.yaml index d5d495c4..f7784061 100644 --- a/assets/langs/en.yaml +++ b/assets/langs/en.yaml @@ -252,8 +252,14 @@ feature_timeline: purchase_screen: title: Pro Version - desc: 'GitJournal is completely free software/open source and is the result of significant development work. It has no venture capital or corporation backing and it never will. Your support directly sustains development and make GitJournal possible. + desc: 'GitJournal is completely free software/open source and is the result of significant development work. It has no venture capital or corporation backing and it never will. Your support directly sustains development. GitJournal operates on a "pay what you want model (with a minimum)".' restore: Restore Purchase + oneTime: + title: One Time Purchase + desc: Permanently enables all Pro features currently in GitJournal and new features added in the following 12 months. + monthly: + title: Monthly Subscription + desc: Enables all Pro Features. After 12 months or after paying {minYearlyPurchase}, you will get all the benefits of the 'One Time Purchase' diff --git a/lib/screens/purchase_screen.dart b/lib/screens/purchase_screen.dart index b1d1fdbe..9a87f093 100644 --- a/lib/screens/purchase_screen.dart +++ b/lib/screens/purchase_screen.dart @@ -110,8 +110,7 @@ class MonthlyRentalWidget extends StatelessWidget { return PurchaseCard( child: Column( children: [ - // TODO: Translate this - Text("Monthly Subscription", style: textTheme.headline5), + Text(tr('purchase_screen.monthly.title'), style: textTheme.headline5), const SizedBox(height: 32.0), PurchaseWidget( skus: _generateSkus(), @@ -120,8 +119,10 @@ class MonthlyRentalWidget extends StatelessWidget { isSubscription: true, ), const SizedBox(height: 32.0), - Text( - "Enables all Pro Features. After 12 months or after paying $minYearlyPurchase, you will get all the benefits of the 'One Time Purchase'"), + Text(tr( + "purchase_screen.monthly.desc", + namedArgs: {'minYearlyPurchase': minYearlyPurchase}, + )), ], mainAxisAlignment: MainAxisAlignment.start, ), @@ -152,18 +153,16 @@ class YearlyPurchaseWidget extends StatelessWidget { return PurchaseCard( child: Column( children: [ - Text("One Time Purchase", style: textTheme.headline5), + Text(tr('purchase_screen.oneTime.title'), style: textTheme.headline5), const SizedBox(height: 32.0), PurchaseWidget( skus: _generateSkus(), defaultSku: "sku_yearly_1", - timePeriod: "Year", isSubscription: false, minPurchaseOptionCallback: minPurchaseOptionCallback, ), const SizedBox(height: 32.0), - const Text( - "Permanently enable all Pro features currently in GitJournal and new features added in the following 12 months."), + Text(tr('purchase_screen.oneTime.desc')), ], mainAxisAlignment: MainAxisAlignment.start, ), diff --git a/lib/widgets/purchase_widget.dart b/lib/widgets/purchase_widget.dart index 1aefd250..e56688d5 100644 --- a/lib/widgets/purchase_widget.dart +++ b/lib/widgets/purchase_widget.dart @@ -60,7 +60,7 @@ class PurchaseWidget extends StatefulWidget { PurchaseWidget({ @required this.skus, @required this.defaultSku, - @required this.timePeriod, + this.timePeriod = "", @required this.isSubscription, this.minPurchaseOptionCallback, });