admin/docs/consumer-texts.md
alisaza e1eaf5eff5 feat: initial ghabilee-admin backoffice app
Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js
app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
2026-09-05 13:12:59 +03:30

2.4 KiB

Consumer texts catalog

Single-locale (Persian) string catalog for non-admin UI. Not multi-language i18n.

Location

frontend/texts/
  index.ts          # export const texts = { … }; export { format }
  format.ts         # {name} placeholder helper
  common.ts
  errors.ts
  auth.ts
  discovery.ts
  bookings.ts
  chats.ts
  events.ts
  profile.ts
  wallet.ts
  identity.ts
  support.ts
  notifications.ts
  reviews.ts
  publicSite.ts
  blog.ts
  seo.ts
  status.ts
  validation.ts

Import:

import { texts, format } from '@/texts'

Usage

texts.common.retry
texts.bookings.cancelConfirm
format(texts.events.shareLinkCopied, { channel: 'تلگرام' })
  • Prefer dot access (texts.domain.key) so Go to Definition jumps to the string.
  • Keys follow product domain, not route/page names.
  • Shared actions/labels → texts.common.
  • Product API codes / HTTP fallbacks → texts.errors (consumed by services/apiErrorLocalization.ts).
  • Status chip labels → texts.status (via types/status.ts).
  • Zod messages for consumer forms → texts.validation.*.

Scope

In Out
(consumer), (public), auth, event create/manage/detail for hosts/guests, SEO landings, blog app/(dashboard)/** admin panel (unless already shared)
Shared consumer chrome (nav, toasts, upload, feedback) Second-locale / next-intl

Conventions

  1. New consumer UI string → add to the right domain file, then reference texts.*.
  2. Do not hardcode Persian literals in non-admin components (tests may still assert the Persian text).
  3. Brand display spelling is always قبیله.
  4. Avoid duplicate keys with the same Persian value; reuse common / existing keys when possible.
  5. Interpolation uses {key} placeholders and format().
  • Cursor rule: .cursor/rules/consumer-texts.mdc
  • Brand spelling: .cursor/rules/persian-brand-name.mdc
  • Consumer UI (modals + mobile): consumer-ui-guidelines.md · rules consumer-modals, consumer-mobile-first