mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
perf: defer babel import
Only required when configuring but will get loaded everywhere
This commit is contained in:
@@ -6,7 +6,6 @@ import json
|
|||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from babel import Locale
|
|
||||||
from frappe import _, throw
|
from frappe import _, throw
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.utils import formatdate, getdate, today
|
from frappe.utils import formatdate, getdate, today
|
||||||
@@ -169,4 +168,6 @@ def is_holiday(holiday_list, date=None):
|
|||||||
|
|
||||||
def local_country_name(country_code: str) -> str:
|
def local_country_name(country_code: str) -> str:
|
||||||
"""Return the localized country name for the given country code."""
|
"""Return the localized country name for the given country code."""
|
||||||
|
from babel import Locale
|
||||||
|
|
||||||
return Locale.parse(frappe.local.lang, sep="-").territories.get(country_code, country_code)
|
return Locale.parse(frappe.local.lang, sep="-").territories.get(country_code, country_code)
|
||||||
|
|||||||
Reference in New Issue
Block a user