From 6fe3468dd02cbb991ba4d615cb32d2350a0738e5 Mon Sep 17 00:00:00 2001 From: KerollesFathy Date: Wed, 15 Apr 2026 21:54:21 +0000 Subject: [PATCH] fix: add translation context for fraction currency --- frappe/utils/data.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frappe/utils/data.py b/frappe/utils/data.py index a6273898ec..eb0bc7f1cb 100644 --- a/frappe/utils/data.py +++ b/frappe/utils/data.py @@ -1556,7 +1556,7 @@ def money_in_words( if main == "0" and fraction in ["0", "00", "000"]: out = _(main_currency, context="Currency") + " " + _("Zero") elif main == "0": - out = f"{fraction_in_words()} {fraction_currency}" + out = f"{fraction_in_words()} {_(fraction_currency, context='Currency')}" else: if main_currency == "DZD": # Use Dinars for Algerian Compliance @@ -1564,7 +1564,15 @@ def money_in_words( else: out = _(main_currency, context="Currency") + " " + in_words(main, in_million).title() if cint(fraction): - out = out + " " + _("and") + " " + fraction_in_words() + " " + fraction_currency + out = ( + out + + " " + + _("and") + + " " + + fraction_in_words() + + " " + + _(fraction_currency, context="Currency") + ) if main_currency == "DZD": return _("{0}.", context="Money in words").format(out)