mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
PurchaseWidget: Mark the strings as translatable
Also show a dialog to a user so they don't keep trying to click again and again.
This commit is contained in:
@ -201,6 +201,8 @@ widgets:
|
||||
PurchaseButton:
|
||||
text: Purchase for {price}
|
||||
fail: Failed to Load
|
||||
failSend: Failed to send purchase request
|
||||
failPurchase: Failed to Purchase - {}
|
||||
FolderView:
|
||||
noteDeleted: Note Deleted
|
||||
undo: Undo
|
||||
|
@ -49,8 +49,7 @@ class PurchaseButton extends StatelessWidget {
|
||||
.buyNonConsumable(purchaseParam: purchaseParam);
|
||||
|
||||
if (!sentSuccess) {
|
||||
var err = "Failed to send purchase request";
|
||||
var dialog = PurchaseFailedDialog(err);
|
||||
var dialog = PurchaseFailedDialog(tr("widgets.PurchaseButton.failSend"));
|
||||
await showDialog(context: context, builder: (context) => dialog);
|
||||
}
|
||||
}
|
||||
@ -60,6 +59,13 @@ class PurchaseButton extends StatelessWidget {
|
||||
await _initPurchase(context);
|
||||
} catch (err, stackTrace) {
|
||||
logException(err, stackTrace);
|
||||
|
||||
var errStr = tr(
|
||||
"widgets.PurchaseButton.failPurchase",
|
||||
args: [err.toString()],
|
||||
);
|
||||
var dialog = PurchaseFailedDialog(errStr);
|
||||
await showDialog(context: context, builder: (context) => dialog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user