Replace home chart with landing live card, catalog-driven tabs, and smoother range transitions; normalize مظنه to قیمت in user-facing strings; add installment and zaarbox chart APIs.
26 lines
840 B
TypeScript
26 lines
840 B
TypeScript
/** جایگزینی «مظنه» و شکلهای وابسته با «قیمت» در متنهای نمایشی به مشتری */
|
|
|
|
const MAZANEH_TO_PRICE: Array<[RegExp, string]> = [
|
|
[/مظنههای/g, 'قیمتهای'],
|
|
[/مظنهها/g, 'قیمتها'],
|
|
[/مظنهای/g, 'قیمتی'],
|
|
[/مظنهای/g, 'قیمتی'],
|
|
[/مظنهٔ/g, 'قیمت'],
|
|
[/مظنه/g, 'قیمت'],
|
|
]
|
|
|
|
export function replaceMazanehTerminology(text: string): string {
|
|
let result = text
|
|
for (const [pattern, replacement] of MAZANEH_TO_PRICE) {
|
|
result = result.replace(pattern, replacement)
|
|
}
|
|
return result
|
|
}
|
|
|
|
export function polishUserFacingCopy(text: unknown): string {
|
|
if (typeof text !== 'string') return ''
|
|
const trimmed = text.trim()
|
|
if (!trimmed) return ''
|
|
return replaceMazanehTerminology(trimmed)
|
|
}
|