Skip to content

Commit

Permalink
StripeDialog: Put the money icon in the right place depending on the …
Browse files Browse the repository at this point in the history
…locale.

In French we would write "5 $" and never "$ 5".
  • Loading branch information
tintou committed Sep 9, 2021
1 parent d3ce71f commit 6f3cb5f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Dialogs/StripeDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,16 @@ public class AppCenter.Widgets.StripeDialog : Granite.Dialog {
var custom_amount = new Gtk.SpinButton.with_range (0, 100, 1) {
activates_default = true,
hexpand = true,
primary_icon_name = "currency-dollar-symbolic",
value = amount
};

// Account for languages that places the monetary sign after the number
if (_("$%d").split ("%d", 2)[0]._strip ().length > 0) {
custom_amount.primary_icon_name = "currency-dollar-symbolic";
} else {
custom_amount.secondary_icon_name = "currency-dollar-symbolic";
}

var selection_list = new Gtk.Grid () {
column_spacing = 6
};
Expand Down

0 comments on commit 6f3cb5f

Please sign in to comment.