feat(home): landing-style live chart, dynamic product tabs, and price copy
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.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/** جایگزینی «مظنه» و شکلهای وابسته با «قیمت» در متنهای نمایشی به مشتری */
|
||||
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user