mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 18:38:36 +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:
|
PurchaseButton:
|
||||||
text: Purchase for {price}
|
text: Purchase for {price}
|
||||||
fail: Failed to Load
|
fail: Failed to Load
|
||||||
|
failSend: Failed to send purchase request
|
||||||
|
failPurchase: Failed to Purchase - {}
|
||||||
FolderView:
|
FolderView:
|
||||||
noteDeleted: Note Deleted
|
noteDeleted: Note Deleted
|
||||||
undo: Undo
|
undo: Undo
|
||||||
|
@ -49,8 +49,7 @@ class PurchaseButton extends StatelessWidget {
|
|||||||
.buyNonConsumable(purchaseParam: purchaseParam);
|
.buyNonConsumable(purchaseParam: purchaseParam);
|
||||||
|
|
||||||
if (!sentSuccess) {
|
if (!sentSuccess) {
|
||||||
var err = "Failed to send purchase request";
|
var dialog = PurchaseFailedDialog(tr("widgets.PurchaseButton.failSend"));
|
||||||
var dialog = PurchaseFailedDialog(err);
|
|
||||||
await showDialog(context: context, builder: (context) => dialog);
|
await showDialog(context: context, builder: (context) => dialog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,6 +59,13 @@ class PurchaseButton extends StatelessWidget {
|
|||||||
await _initPurchase(context);
|
await _initPurchase(context);
|
||||||
} catch (err, stackTrace) {
|
} catch (err, stackTrace) {
|
||||||
logException(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