chore: use native Azərbaycan spelling in user-facing strings

Replaces "Azeri" / "Azerbaijani" with the native form "Azərbaycan" in
labels, descriptions, and Python comments. Field names / identifiers
are unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ali 2026-05-14 10:56:54 +00:00
parent 53d4eb1cc7
commit c9032df3bf
7 changed files with 15 additions and 15 deletions

View File

@ -103,7 +103,7 @@ Priority-based matching in `_find_mapping_for_txn()`: purpose+party > purpose-on
Three-tier party matching with configurable similarity thresholds: Three-tier party matching with configurable similarity thresholds:
1. Exact VÖEN (tax ID) match 1. Exact VÖEN (tax ID) match
2. Name similarity via `SequenceMatcher` (defaults: customer 90%, supplier 80%, purpose 70%) 2. Name similarity via `SequenceMatcher` (defaults: customer 90%, supplier 80%, purpose 70%)
3. Optional Azerbaijani character normalization (Ə→E, ə→e, etc.) 3. Optional Azərbaycan character normalization (Ə→E, ə→e, etc.)
### DocTypes ### DocTypes
@ -129,7 +129,7 @@ Three-tier party matching with configurable similarity thresholds:
- Progress published via `frappe.publish_realtime()` over Socket.IO (`kb_bt_import_progress`, `kb_bt_import_complete`) - Progress published via `frappe.publish_realtime()` over Socket.IO (`kb_bt_import_progress`, `kb_bt_import_complete`)
- Sensitive data (tokens, passwords) stored in Password-type fields (encrypted in DB) - Sensitive data (tokens, passwords) stored in Password-type fields (encrypted in DB)
- Error logging via `frappe.log_error()` with `_mask()` hiding account numbers (7+ digits → `first3***last3`) - Error logging via `frappe.log_error()` with `_mask()` hiding account numbers (7+ digits → `first3***last3`)
- Party names latinized via `_latinize()` for bank transfers (Azerbaijani → ASCII) - Party names latinized via `_latinize()` for bank transfers (Azərbaycan → ASCII)
- Card statements limited to 90-day range; cross-account transfers deduplicated by reference_no - Card statements limited to 90-day range; cross-account transfers deduplicated by reference_no
### Scheduler Events ### Scheduler Events

View File

@ -2431,7 +2431,7 @@ _AZERI_MAP = str.maketrans("ƏəÜüÖöĞğİıÇ窺", "EeUuOoGgIiCcSs")
def _normalize(text, consider_azeri=True): def _normalize(text, consider_azeri=True):
"""Normalize text for similarity comparison. """Normalize text for similarity comparison.
Optionally replaces Azerbaijani characters before lowercasing.""" Optionally replaces Azərbaycan characters before lowercasing."""
if not text: if not text:
return "" return ""
s = str(text) s = str(text)

View File

@ -65,10 +65,10 @@
"options": "\nIgnore Case\nCase Sensitive" "options": "\nIgnore Case\nCase Sensitive"
}, },
{ {
"description": "Override the global 'Consider Azerbaijani Characters' for this row's party-name matching. Blank = use the global setting.", "description": "Override the global 'Consider Azərbaycan Characters' for this row's party-name matching. Blank = use the global setting.",
"fieldname": "azeri_mode", "fieldname": "azeri_mode",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Azeri Translit", "label": "Azərbaycan Translit",
"options": "\nApply Translit\nStrict (No Translit)" "options": "\nApply Translit\nStrict (No Translit)"
}, },
{ {

View File

@ -115,10 +115,10 @@
}, },
{ {
"default": "1", "default": "1",
"description": "Consider replacement of Azerbaijani letters with Latin equivalents when matching", "description": "Consider replacement of Azərbaycan letters with Latin equivalents when matching",
"fieldname": "consider_azeri_chars", "fieldname": "consider_azeri_chars",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Consider Azerbaijani Characters" "label": "Consider Azərbaycan Characters"
}, },
{ {
"default": "1", "default": "1",

View File

@ -57,10 +57,10 @@
"options": "\nIgnore Case\nCase Sensitive" "options": "\nIgnore Case\nCase Sensitive"
}, },
{ {
"description": "Override the global 'Consider Azerbaijani Characters' for this row's party-name matching. Blank = use the global setting.", "description": "Override the global 'Consider Azərbaycan Characters' for this row's party-name matching. Blank = use the global setting.",
"fieldname": "azeri_mode", "fieldname": "azeri_mode",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Azeri Translit", "label": "Azərbaycan Translit",
"options": "\nApply Translit\nStrict (No Translit)" "options": "\nApply Translit\nStrict (No Translit)"
}, },
{ {

View File

@ -57,7 +57,7 @@ def _effective_case_insensitive(row, global_default):
def _effective_azeri(row, global_default): def _effective_azeri(row, global_default):
"""Per-row Azeri Translit mode overrides the global Consider Azerbaijani Characters flag.""" """Per-row Azərbaycan Translit mode overrides the global Consider Azərbaycan Characters flag."""
mode = (getattr(row, "azeri_mode", None) or "").strip() mode = (getattr(row, "azeri_mode", None) or "").strip()
if mode == "Apply Translit": if mode == "Apply Translit":
return True return True
@ -70,7 +70,7 @@ def _build_name_to_party(settings):
"""Counterparty text -> {"Customer": erp_customer} / {"Supplier": erp_supplier}. """Counterparty text -> {"Customer": erp_customer} / {"Supplier": erp_supplier}.
Each row is indexed under up to four key variants depending on its effective Each row is indexed under up to four key variants depending on its effective
Case Mode and Azeri Translit settings (both of which fall back to globals): Case Mode and Azərbaycan Translit settings (both of which fall back to globals):
strict / lowercase / translit / translit + lowercase. strict / lowercase / translit / translit + lowercase.
""" """
global_ci = bool(getattr(settings, "case_insensitive_party_match", 1)) global_ci = bool(getattr(settings, "case_insensitive_party_match", 1))
@ -117,7 +117,7 @@ def _build_name_to_party(settings):
def _resolve_party_from_name(name, name_to_party, payment_type): def _resolve_party_from_name(name, name_to_party, payment_type):
"""(party_type, erp_party) for `name`, or (None, None). Tries up to four """(party_type, erp_party) for `name`, or (None, None). Tries up to four
lookup variants (strict / lower / translit / translit+lower); the index lookup variants (strict / lower / translit / translit+lower); the index
encodes per-row case/azeri decisions, so flags aren't needed here.""" encodes per-row case/azərbaycan decisions, so flags aren't needed here."""
key = (name or "").strip() key = (name or "").strip()
if not key: if not key:
return None, None return None, None
@ -408,7 +408,7 @@ def create_purpose_mappings(transactions, paid_from=None, paid_to=None, document
def _norm_text(text, az): def _norm_text(text, az):
"""Lowercased + (optionally) Azeri-translit form for purpose/party comparison.""" """Lowercased + (optionally) Azərbaycan-translit form for purpose/party comparison."""
s = (text or "").lower() s = (text or "").lower()
if az: if az:
s = _translit_az(s) s = _translit_az(s)
@ -423,7 +423,7 @@ def _find_mapping_for_txn(txn, transaction_mappings, purpose_text_cache, purpose
fallback by counterparty_type. "Exact" = the keyword is a substring of the fallback by counterparty_type. "Exact" = the keyword is a substring of the
transaction's description; "fuzzy" = partial-ratio >= purpose_threshold. transaction's description; "fuzzy" = partial-ratio >= purpose_threshold.
`az` toggles Azerbaijani transliteration of purpose / party text before `az` toggles Azərbaycan transliteration of purpose / party text before
comparison (driven by settings.consider_azeri_chars). comparison (driven by settings.consider_azeri_chars).
""" """
payment_type = "Pay" if txn.get("drcr") == "D" else "Receive" payment_type = "Pay" if txn.get("drcr") == "D" else "Receive"

View File

@ -8,7 +8,7 @@ _AZ_MAP = str.maketrans("ƏəİışŞÇçÖöÜüĞğ", "EeIissCcOoUuGg")
def _latinize(text: str, max_len: int = None) -> str: def _latinize(text: str, max_len: int = None) -> str:
"""Transliterate Azerbaijani → Latin, strip non-ASCII, truncate.""" """Transliterate Azərbaycan → Latin, strip non-ASCII, truncate."""
text = str(text or "").translate(_AZ_MAP) text = str(text or "").translate(_AZ_MAP)
text = text.encode("ascii", errors="ignore").decode("ascii").strip() text = text.encode("ascii", errors="ignore").decode("ascii").strip()
return text[:max_len] if max_len else text return text[:max_len] if max_len else text