From 6f3cb5f933797926032938a71e2df5cf9e7dd953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Thu, 9 Sep 2021 09:47:52 +0200 Subject: [PATCH] StripeDialog: Put the money icon in the right place depending on the locale. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In French we would write "5 $" and never "$ 5". --- src/Dialogs/StripeDialog.vala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Dialogs/StripeDialog.vala b/src/Dialogs/StripeDialog.vala index cf6905af7..a8645b598 100644 --- a/src/Dialogs/StripeDialog.vala +++ b/src/Dialogs/StripeDialog.vala @@ -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 };