"use client"; import { createContext, type ReactNode, useContext, useMemo } from "react"; /** ข้อความคงที่ที่ component ของ @pi/ui ใช้เอง — แอปส่งชุดภาษาอื่นเข้ามาผ่าน UiTextProvider */ export interface UiText { cancel: string; done: string; save: string; actions: string; copy: string; copied: string; showOnce: string; success: string; /** EnvSnippet: คัดลอกอัตโนมัติไม่ได้ (optional — มีค่าเริ่มต้นในตัว) */ copyFailed?: string; /** ConfirmDialog: ปุ่มยืนยัน (optional — ค่าเริ่มต้น "ยืนยัน") */ confirm?: string; /** ConfirmDialog: หัวกล่อง (optional — ค่าเริ่มต้น "ยืนยันการทำรายการ") */ confirmTitle?: string; /** RowActions/ConfirmActionButton: action โยน error (optional — ค่าเริ่มต้น "ดำเนินการไม่สำเร็จ") */ actionFailed?: string; /** InlineEdit: ปุ่มดินสอ (optional — "แก้ไข") */ edit?: string; /** SortableList (optional) — ที่จับลาก + คำอธิบายสำหรับ screen reader */ sortable?: Partial<{ handle: string; instructions: string; /** ใช้ `{index}` / `{total}` */ started: string; /** เริ่มลากหลายรายการที่เลือกไว้ — ใช้ `{count}` */ startedMany: string; moved: string; dropped: string; cancelled: string; }>; /** MultiSelectCombobox / FormFieldCombobox (optional) — `search`/`remove` ใช้ `{label}`, `add` ใช้ `{value}` */ combobox?: Partial<{ search: string; empty: string; clearAll: string; remove: string; add: string; /** ชิปสรุปที่เกินจำนวนที่แสดง — ใช้ `{count}` */ moreCount: string; /** `Combobox`: ข้อความในปุ่มเมื่อยังไม่เลือก / ช่องค้นหา */ placeholder: string; searchPlaceholder: string; /** `AsyncCombobox`: กำลังค้น / ยังพิมพ์ไม่ครบ `minQuery` (ใช้ `{count}`) / ค้นไม่สำเร็จ */ loading: string; typeToSearch: string; searchFailed: string; }>; /** FileCard (optional) — `select` ใช้ `{name}` */ fileCard?: Partial<{ select: string; folder: string }>; /** ResourcePropertyFilter (optional) — ตัวที่ใช้ `{name}` คือชื่อคุณสมบัติ */ filter?: Partial<{ title: string; description: string; searchProperty: string; clearSearch: string; noProperties: string; active: string; searchValue: string; filterOne: string; clearOne: string; min: string; max: string; unit: string; /** ปุ่มล้างตัวกรองทั้งหมดในหัวกล่อง */ clearAll: string; }>; /** AppShell เมนู (optional) — `noResults` ใช้ `{query}` */ nav?: Partial<{ main: string; sub: string; choosePage: string; noResults: string; clearSearch: string; /** คำอธิบายของแผ่นเมนู (sidebar บนมือถือ / แบบลอย) สำหรับโปรแกรมอ่านจอ */ sheetDescription: string; }>; /** ErrorState เซสชันหมดอายุ (optional) */ sessionExpired?: Partial<{ title: string; description: string; signIn: string }>; /** ErrorState (optional) — `reference` ตามด้วยรหัสอ้างอิง (error.digest) */ errorState?: Partial<{ title: string; description: string; reference: string; retry: string; home: string; }>; /** TransitionLink: toast ระหว่างเปลี่ยนหน้า (optional) */ navigating?: string; /** UsageMeter (optional) — `of` ใช้ `{used}`/`{limit}`, `remaining` ใช้ `{remaining}` */ usage?: Partial<{ of: string; unlimited: string; nearlyFull: string; remaining: string; over: string; }>; /** VersionHistory (optional) */ versions?: Partial<{ label: string; current: string; restore: string; confirm: string; confirmAction: string; restored: string; }>; /** AccessDenied (optional) — `permission` ใช้ `{permission}` */ accessDenied?: Partial<{ title: string; description: string; permission: string; signedInAs: string; switchAccount: string; home: string; request: string; }>; /** ExportMenu (optional) — `rows`/`selectedOnly` ใช้ `{count}`, `done` ใช้ `{name}` */ exportMenu?: Partial<{ button: string; rows: string; selectedOnly: string; preparing: string; done: string; failed: string; }>; /** ActiveFilterChips (optional) — `remove` ใช้ `{name}` */ filterChips?: Partial<{ label: string; remove: string; clearAll: string }>; /** ภาษาของชุดข้อความ ("th" | "en") — component ที่มีชื่อสองภาษาในข้อมูล (ชื่อสี/ไอคอน) เลือกตามนี้ */ lang?: string; /** ColorSelect (optional) */ colorSelect?: Partial<{ placeholder: string; title: string; clear: string }>; /** IconSelect / IconPicker หมวด (optional) */ iconSelect?: Partial<{ placeholder: string; title: string; clear: string; all: string }>; /** BulkEditDialog (optional) — {count} {items} */ bulkEdit?: Partial<{ title: string; description: string; submit: string; mixed: string; noneSelected: string; success: string; items: string; }>; /** PermissionMatrix (optional) */ permissionMatrix?: Partial<{ label: string; permission: string; search: string; empty: string; toggleRole: string; toggleGroup: string; locked: string; changed: string; reset: string; /** `ResourcePermissionMatrix` (0.111.0) — `{name}` */ resource: string; allRow: string; allColumn: string; notApplicable: string; }>; /** `ZoomControls` (optional, 0.111.0) */ zoom?: Partial<{ label: string; zoomIn: string; zoomOut: string; reset: string }>; /** `StepIndicator` (optional, 0.111.0) */ stepIndicator?: Partial<{ label: string; done: string; error: string }>; /** ActivityFeed (optional) */ activity?: Partial<{ empty: string }>; /** ThaiIdInput / PhoneInput (optional) */ thaiInput?: Partial<{ invalidId: string; invalidPhone: string }>; /** ApprovalTimeline (optional) — `progress` ใช้ `{approved}`/`{total}` */ approval?: Partial<{ label: string; done: string; current: string; rejected: string; skipped: string; pending: string; policyAll: string; policyAny: string; progress: string; waitingSince: string; approvedBy: string; rejectedBy: string; }>; /** DocumentFlow (optional) */ documentFlow?: Partial<{ label: string; notCreated: string }>; /** DocumentHeader (optional) */ documentHeader?: Partial<{ back: string; more: string }>; /** ปุ่มมาตรฐาน AddNew/Save/Submit/Delete/Print/Refresh/FloatingSave (optional) — Cancel/Confirm ใช้ `cancel`/`confirm` */ buttons?: Partial<{ addNew: string; createNew: string; saving: string; saved: string; delete: string; deleting: string; print: string; refresh: string; }>; /** DeleteManyButton (optional) — `trigger`/`title`/`success` ใช้ `{count}`; `title`/`description`/`success` ใช้ `{items}` */ deleteMany?: Partial<{ trigger: string; title: string; description: string; items: string; success: string; }>; /** useCopyToClipboard toast (optional) */ clipboard?: Partial<{ success: string; failed: string }>; /** RecordSection (optional) */ recordSection?: Partial<{ add: string; count: string }>; /** ComparisonMatrix (optional) */ comparison?: Partial<{ item: string; lowest: string; highest: string; total: string; incomplete: string; }>; /** ImportDialog (optional) — `{count}`/`{name}` แทนค่า */ importDialog?: Partial<{ steps: string; stepSelect: string; stepReview: string; stepResult: string; template: string; reading: string; readFailed: string; emptyFile: string; tooLarge: string; wrongType: string; validCount: string; invalidCount: string; /** แถวผิดที่ไม่ได้แสดง (เกิน 200) — `{count}` */ moreInvalid: string; row: string; problem: string; preview: string; skipInvalid: string; fixFirst: string; importCount: string; commitFailed: string; chooseAnother: string; cancel: string; done: string; created: string; updated: string; skipped: string; }>; /** ChangeDiff (optional) */ changeDiff?: Partial<{ changed: string; empty: string; noChanges: string; showMore: string; showLess: string; }>; /** DateRangePicker ช่วงด่วน (optional) — `days` ใช้ `{count}` */ rangePresets?: Partial<{ label: string; today: string; last7: string; last30: string; thisMonth: string; lastMonth: string; thisQuarter: string; thisYear: string; custom: string; apply: string; days: string; }>; /** useUndoableAction (optional) — `deletedMany` ใช้ `{count}` */ undo?: Partial<{ undo: string; done: string; deletedMany: string; failed: string }>; /** useHotkeys / ShortcutsDialog (optional) */ hotkeys?: Partial<{ title: string; sequenceThen: string; general: string; singleKeys: string; singleKeysHint: string; empty: string; }>; /** LoadMore / InfiniteList (optional) — `moreCount` ใช้ `{count}`, `shown` ใช้ `{shown}`/`{total}` */ loadMore?: Partial<{ more: string; moreCount: string; loading: string; failed: string; retry: string; done: string; shown: string; }>; /** ActivityFeed ส่วนเสริม (optional): ขยาย/ย่อรายละเอียด, สถานะโหลด/ผิดพลาด, หัววัน */ activityExtra?: Partial<{ expand: string; collapse: string; loading: string; failed: string; retry: string; today: string; yesterday: string; }>; /** Rating (optional) — `valueOf` ใช้ `{value}`/`{max}`, `stars` ใช้ `{count}`, `reviews` ใช้ `{count}` */ rating?: Partial<{ label: string; valueOf: string; stars: string; clear: string; reviews: string; }>; /** Banner (optional) */ banner?: Partial<{ dismiss: string }>; /** KeyValueEditor (optional) — `pasteAdd` ใช้ `{count}`, `duplicate` ใช้ `{row}` */ keyValue?: Partial<{ key: string; value: string; add: string; remove: string; showValue: string; hideValue: string; duplicate: string; keyRequired: string; keyInvalid: string; pasteAdd: string; moveUp: string; moveDown: string; empty: string; /** ใช้ `{count}` */ pasteDuplicates: string; overwrite: string; skip: string; }>; /** SwipeableRow (optional) */ swipe?: Partial<{ actions: string }>; /** Lightbox (optional) — `counter` ใช้ `{index}`/`{total}` */ lightbox?: Partial<{ label: string; close: string; download: string; previous: string; next: string; zoom: string; counter: string; noPreview: string; /** PDF: ปุ่มเปิดในแท็บใหม่ */ openInNewTab: string; }>; /** DataTable มุมมองที่บันทึก (optional) */ savedViews?: Partial<{ label: string; all: string; saveNew: string; modified: string; update: string; reset: string; name: string; summary: string; save: string; cancel: string; remove: string; exists: string; }>; /** DataTable แก้ค่าในเซลล์ (optional) */ cellEdit?: Partial<{ edit: string; save: string; cancel: string; saving: string; failed: string; retry: string; }>; /** CalendarMonthGrid โหมดสัปดาห์ (optional) — `items` ใช้ `{count}` */ calendarView?: Partial<{ month: string; week: string; prevWeek: string; nextWeek: string; items: string; noItems: string; }>; /** Tour (optional) — `step` ใช้ `{current}`/`{total}` */ tour?: Partial<{ label: string; next: string; back: string; skip: string; done: string; step: string; }>; /** NotificationCenter (optional) */ notifications?: Partial<{ title: string; empty: string; viewAll: string }>; /** SelectionBar (optional) — `selected` ใช้ `{count}` */ selection?: Partial<{ selected: string; clear: string }>; /** RecordCard (optional) — ชื่อส่วนรายละเอียดสำหรับ screen reader */ record?: Partial<{ details: string }>; /** FormDialog `confirmDiscard` (optional) */ formDialog?: Partial<{ discardTitle: string; discardHint: string; keepEditing: string; discard: string; }>; /** StageFilterBar (optional) — `alert` ใช้ `{count}` */ stageBar?: Partial<{ label: string; alert: string }>; /** ป้ายซ่อนของช่องบังคับกรอก (อ่านต่อจากชื่อช่อง) · SkipLink · HeaderBreadcrumbs (optional) */ requiredField?: string; skipToContent?: string; breadcrumb?: Partial<{ home: string; back: string; label: string }>; /** UnsavedChangesGuard (optional) — ไม่ระบุ = ใช้ข้อความของ formDialog */ unsavedGuard?: Partial<{ title: string; description: string; leave: string; stay: string }>; /** ตาข่ายฟอร์มที่ไม่ผ่าน validation (`useFormInvalidNotice`, FormDialog, ActionForm) — `fields` ใช้ `{fields}` */ invalidForm?: Partial<{ fields: string; generic: string }>; /** DataTable (optional) — `rowsSelected` ใช้ `{selected}`/`{total}`, `pageOf` ใช้ `{page}`/`{pages}` */ table?: Partial<{ /** `Table` ที่กว้างเกินจอ (เลื่อนแนวนอน) — ชื่อของกรอบเลื่อนเมื่อตารางไม่มี aria-label */ scrollRegion: string; rowsPerPage: string; pageOf: string; /** `variant="quiet"` — `{from}`/`{to}`/`{total}` และ `{shown}`/`{total}` */ rangeOf: string; shownOf: string; density: string; /** `variant="quiet"` มือถือ — `{count}` */ selectedCount: string; /** สถานะตาราง: `emptyTitleOf` ใช้ `{resource}`, `noMatchQuery` ใช้ `{query}` */ loading: string; emptyTitle: string; emptyTitleOf: string; emptyHint: string; noMatch: string; noMatchQuery: string; noMatchHint: string; clearAllFilters: string; clearQuery: string; errorTitle: string; errorHint: string; retry: string; /** ข้อความในแคปซูลเลือกหมู่ (สั้นกว่า `selectedCount` เพราะหัวรายการมือถือบอก "เลือก N รายการ" อยู่แล้ว) */ selectedPill: string; selectAll: string; longPressHint: string; clearFilters: string; showResults: string; rowsSelected: string; noResults: string; /** ตารางแบบปกติ (ไม่ใช่ quiet): ยังไม่มีข้อมูลเลย / มีคำค้นหรือตัวกรองแต่ไม่พบ + บรรทัดแนะนำ */ noData: string; noResultsFiltered: string; noResultsFilteredHint: string; /** ชื่อปุ่ม ⋯ ของแถว — `{name}` = ชื่อรายการ (โปรแกรมอ่านจอแยกแถวได้) */ rowActionsOf: string; deleteTitle: string; /** ใช้ `{name}` และ `{resource}` (ชื่อชนิดข้อมูลที่ส่งมาทาง `resourceName`) */ deleteDescription: string; deleting: string; deleted: string; delete: string; search: string; clearSearch: string; filters: string; filtersDescription: string; closeFilters: string; /** ใช้ `{name}` */ clearFilter: string; /** เมนูซ่อน/แสดงคอลัมน์: ปุ่ม + หัวเมนู */ columns: string; toggleColumns: string; /** ปุ่มเปิดแผ่นตัวกรอง / ล้างตัวกรองของ toolbar */ filterButton: string; resetFilters: string; /** เมนูหัวคอลัมน์ */ sortAsc: string; sortDesc: string; sortClear: string; hideColumn: string; /** ตารางลากเรียง: ลากไม่ได้ระหว่างกรอง/เรียงคอลัมน์ */ reorderBlocked: string; }>; /** DialogsProvider: ปุ่มปิดของ alert (optional — ค่าเริ่มต้น "ตกลง") */ ok?: string; /** DialogsProvider: หัวกล่อง alert (optional — ค่าเริ่มต้น "แจ้งให้ทราบ") */ alertTitle?: string; /** DialogsProvider: หัวกล่อง prompt (optional — ค่าเริ่มต้น "กรอกข้อมูล") */ promptTitle?: string; /** DialogsProvider: หัวกล่อง choose (optional — ค่าเริ่มต้น "เลือกการทำรายการ") */ chooseTitle?: string; /** DialogsProvider: หัวกล่อง checklist (optional — ค่าเริ่มต้น "เลือกรายการ") */ checklistTitle?: string; /** CommandPalette (optional — ค่าเริ่มต้นไทยในตัว) */ palette?: Partial<{ placeholder: string; title: string; description: string; empty: string; searching: string; pages: string; }>; /** OrganizationSwitcher (optional) */ switcher?: Partial<{ choose: string; organization: string }>; /** UserMenu: aria-label ปุ่มเปิดเมนู (optional — "เมนูผู้ใช้") */ userMenu?: string; /** AppShell: ปุ่มย่อ/ขยายเมนูข้าง (optional — "ย่อ/ขยายเมนู") */ toggleSidebar?: string; /** UserMenu: ปุ่มออกจากระบบ (optional — "ออกจากระบบ") */ signOut?: string; /** ThemeMenuItems: หัวกลุ่ม + ตัวเลือก (optional) */ theme?: Partial<{ label: string; light: string; dark: string; system: string }>; /** SectionNav: aria-label ของแถบแท็บย่อย (optional — "แท็บย่อย") */ sectionNav?: Partial<{ tabs: string }>; /** SearchInput: placeholder / aria-label ช่อง / aria-label ปุ่มล้าง (optional) */ search?: Partial<{ placeholder: string; label: string; clear: string }>; /** LanguageSwitch/LanguageMenuItems: หัวกลุ่ม + aria-label ปุ่ม (optional — "ภาษา") */ language?: Partial<{ label: string }>; /** ConfirmDialog `requireText`: คำนำหน้า/ต่อท้ายช่องพิมพ์ยืนยัน (optional — "พิมพ์" … "เพื่อยืนยัน") */ confirmTypeToConfirm?: string; confirmTypeToConfirmSuffix?: string; /** MonthStepper (optional) */ month?: Partial<{ previous: string; next: string; current: string }>; /** SetupChecklist: ป้ายขั้นเสริม + ความคืบหน้า ({done}/{total}) + ปุ่มของขั้นที่ทำแล้ว (optional) */ setup?: Partial<{ optional: string; progress: string; view: string }>; /** FilterBar: ปุ่มล้างตัวกรอง (optional) */ filters?: Partial<{ clear: string; label: string }>; /** SettingsLayout: ปุ่มย้อนกลับบนมือถือ + ไม่พบหัวข้อ (optional) */ settings?: Partial<{ back: string; empty: string; label: string }>; /** MobileTabBar: aria-label ของแถบ (optional) */ mobileTabs?: string; /** SimpleDialog/SimpleSheet: ปุ่มปิด (sr-only) (optional — "ปิด") */ close?: string; /** HostedAuthDialog */ openInNewTab?: string; /** LocaleToggle (aria-label) */ changeLanguage?: string; /** AuthDivider / ProviderButtons / PasswordInput (optional) — continueWith ใช้ {provider} */ auth?: Partial<{ or: string; continueWith: string; showPassword: string; hidePassword: string }>; /** SimpleQuestionnaire (optional) — progress ใช้ {current}/{total} */ questionnaire?: Partial<{ previous: string; next: string; skip: string; submit: string; progress: string; other: string; }>; /** ChatThread (optional) */ chat?: Partial<{ placeholder: string; send: string; typing: string; scrollToLatest: string; /** ชื่อของพื้นที่ข้อความ (region) สำหรับโปรแกรมอ่านจอ */ region: string; }>; /** SimplePagination / DataTablePagination (optional) */ pagination?: Partial<{ previous: string; next: string; first: string; last: string; label: string; page: string; }>; /** TableSkeleton/ListSkeleton/CardSkeleton (optional) — ข้อความสำหรับ screen reader */ loading?: string; /** สถานะออนไลน์ของ UserIdentity/Initials (optional) */ presence?: Partial<{ online: string; away: string; busy: string; offline: string }>; /** TextareaField (optional) — ข้อความ screen reader ของตัวนับ ใช้ {count} {max} */ characterCount?: string; /** NumberInput (optional) */ number?: Partial<{ increment: string; decrement: string }>; /** DatePicker (optional) — ทางลัดวันที่ + ช่องพิมพ์วันที่ */ datePicker?: Partial<{ placeholder: string; smartPlaceholder: string; apply: string; presets: string; today: string; yesterday: string; tomorrow: string; nextWeek: string; lastWeek: string; nextMonth: string; lastMonth: string; clear: string; /** โหมดช่วงวันที่ (`mode="range"`) */ rangePlaceholder: string; rangeSmartPlaceholder: string; /** ปุ่ม (i) และคำอธิบายวิธีพิมพ์ (0.42.0) */ help: string; helpDate: string; helpYear: string; helpToday: string; helpDays: string; helpUnits: string; helpRange: string; helpRangeShortcut: string; pickEnd: string; /** ช่องพิมพ์ (0.49.0) — `{example}` = ตัวอย่างที่พิมพ์ได้, `{count}` = จำนวนวัน */ cannotRead: string; shortcutsLabel: string; showAll: string; backToCalendar: string; openCalendar: string; dayCount: string; allShortcuts: string; tapToFill: string; /** `minDate`/`maxDate` — `{date}` = วันที่ขอบเขต (ตาม `locale` ของช่อง) */ beforeMin: string; afterMax: string; /** `DateRangePicker` (ตัวกรอง) */ clearRange: string; last7Days: string; last30Days: string; thisMonth: string; previousMonth: string; next7Days: string; next30Days: string; }>; /** TimePicker / DateTimePicker (optional) */ time?: Partial<{ choose: string; hour: string; minute: string; now: string; clear: string; dateTimePlaceholder: string; invalid: string; }>; /** TagsInput (optional) — remove ใช้ {tag}, duplicate ใช้ {tag}, max ใช้ {max} */ tags?: Partial<{ placeholder: string; remove: string; duplicate: string; max: string }>; /** StepForm (optional) — progress ใช้ {current} {total} */ stepForm?: Partial<{ label: string; previous: string; next: string; submit: string; progress: string; }>; /** RichTextEditor (@suphark/ui/rich-text) (optional) — fontSizeValue ใช้ {size}, colorSwatch ใช้ {target} {color}, variableCreate ใช้ {name} */ richText?: Partial<{ placeholder: string; toolbar: string; undo: string; redo: string; fontSize: string; fontSizeValue: string; resetFontSize: string; bold: string; italic: string; underline: string; alignment: string; alignLeft: string; alignCenter: string; alignRight: string; justify: string; lists: string; bulletList: string; orderedList: string; insert: string; insertLink: string; insertTable: string; horizontalRule: string; table: string; tableActions: string; addRow: string; addColumn: string; mergeCells: string; unmergeCell: string; color: string; cell: string; row: string; column: string; colorClear: string; colorGray: string; colorBlue: string; colorGreen: string; colorYellow: string; colorRed: string; colorPurple: string; colorSwatch: string; verticalAlign: string; alignTop: string; alignMiddle: string; alignBottom: string; rowHeight: string; rowNormal: string; rowTall: string; rowExtraTall: string; deleteRow: string; deleteColumn: string; linkTitle: string; linkUrl: string; linkInvalid: string; tableTitle: string; tableRows: string; tableColumns: string; insertConfirm: string; variableNew: string; variableCreate: string; }>; /** useDiscardChangesGuard (optional) — กล่องถามก่อนทิ้งฟอร์มใน dialog */ discardChanges?: Partial<{ title: string; description: string; discard: string; keepEditing: string; }>; /** FormFieldImageUpload (optional) — `tooLarge` ใช้ {size} */ imageUpload?: Partial<{ choose: string; change: string; remove: string; preview: string; tooLarge: string; }>; /** SecretReveal `autoHideMs`/`hideOnTabSwitch` (optional) */ secretReveal?: Partial<{ hidden: string; show: string }>; /** `EventCalendar` (optional) — `more` ใช้ `{count}`, `dayLabel` ใช้ `{date}` `{count}` */ eventCalendar?: Partial<{ today: string; previous: string; next: string; view: string; month: string; week: string; day: string; agenda: string; more: string; less: string; allDay: string; empty: string; dayLabel: string; "3days": string; "2months": string; moved: string; resize: string; /** หลังยืด/หดเวลาจบด้วยคีย์บอร์ด — `{title}` `{when}` (0.110.0) */ resized: string; }>; /** `PdfExportButton` (optional) — ทับรายปุ่มด้วย prop `labels` */ pdfExport?: Partial<{ download: string; loading: string; optionsAriaLabel: string; printPreview: string; print: string; scaleMode: string; fitToOnePage: string; fitToPageWidth: string; success: string; error: string; }>; /** `PdfPreview` (optional) */ pdfPreview?: Partial<{ title: string; loading: string; generating: string; updating: string; failed: string; /** iOS/iPadOS: iframe แสดงแค่หน้าแรก (0.110.0) */ firstPageOnly: string; openFull: string; /** ไม่มีตัวดู PDF ในตัว (0.110.0) */ unsupported: string; open: string; }>; /** `ExportJobsPanel`/`ExportJobsButton` (optional) — `{date}` `{count}` */ exportJobs?: Partial<{ title: string; button: string; empty: string; loading: string; pending: string; running: string; success: string; failed: string; expired: string; createdAt: string; expiresAt: string; download: string; delete: string; deleteFailed: string; activeCount: string; readyCount: string; loadFailed: string; retry: string; /** ประกาศให้ screen reader เมื่องานเสร็จ/ล้มเหลว — `{count}` (0.110.0) */ announceReady: string; announceFailed: string; }>; /** ปุ่มเลื่อนของ `Carousel` (optional) */ carousel?: Partial<{ previous: string; next: string }>; /** ปุ่มเลื่อนของ `MessageScrollerButton` (optional) */ messageScroller?: Partial<{ toEnd: string; toStart: string }>; /** ปุ่มตรึง sidebar ของ `AppShell sidebarPinnable` (optional) — `*Hint` = tooltip */ sidebarPin?: Partial<{ pin: string; unpin: string; pinHint: string; unpinHint: string; }>; /** PinnedLinks (optional) — แถบเมนูที่ปักหมุดบน header · `confirmDescription` ใช้ {title} */ pinnedLinks?: Partial<{ label: string; unpin: string; confirmTitle: string; confirmDescription: string; }>; } export const UI_TEXT_TH: UiText = { cancel: "ยกเลิก", formDialog: { discardTitle: "ทิ้งการแก้ไขที่ยังไม่บันทึก?", discardHint: "ข้อมูลที่กรอกไว้จะหายไป", keepEditing: "กลับไปแก้ต่อ", discard: "ทิ้งและปิด", }, unsavedGuard: { leave: "ออกจากหน้านี้" }, requiredField: "จำเป็น", skipToContent: "ข้ามไปเนื้อหา", breadcrumb: { home: "หน้าแรก", back: "ย้อนกลับ", label: "เส้นทางหน้า" }, stageBar: { label: "ขั้นตอน", alert: "{count} ค้างนาน" }, done: "เสร็จแล้ว", save: "บันทึก", actions: "การกระทำ", copy: "คัดลอก", copied: "คัดลอกแล้ว", showOnce: "แสดงครั้งเดียว — คัดลอกเก็บไว้ทันที", success: "สำเร็จ", copyFailed: "คัดลอกอัตโนมัติไม่ได้ — เลือกข้อความให้แล้ว กด Ctrl+C / ⌘C", confirm: "ยืนยัน", confirmTitle: "ยืนยันการทำรายการ", actionFailed: "ดำเนินการไม่สำเร็จ", edit: "แก้ไข", combobox: { search: "ค้นหา {label}…", empty: "ไม่พบข้อมูล", clearAll: "ล้างทั้งหมด", remove: "ลบ {label}", add: "เพิ่ม “{value}”", moreCount: "+{count} รายการ", placeholder: "เลือก...", searchPlaceholder: "ค้นหา...", loading: "กำลังค้นหา…", typeToSearch: "พิมพ์อย่างน้อย {count} ตัวอักษรเพื่อค้นหา", searchFailed: "ค้นหาไม่สำเร็จ", }, fileCard: { select: "เลือก {name}", folder: "โฟลเดอร์" }, filter: { title: "กรองตามคุณสมบัติ", description: "ค่าในคุณสมบัติเดียวกันเป็น OR และคนละคุณสมบัติเป็น AND", searchProperty: "ค้นหาคุณสมบัติ…", clearSearch: "ล้างคำค้นหา", noProperties: "ไม่พบคุณสมบัติ", active: "ตัวกรองคุณสมบัติที่ใช้งาน", searchValue: "ค้นหาข้อความ…", filterOne: "กรอง {name}", clearOne: "ล้างตัวกรอง {name}", min: "ต่ำสุด", max: "สูงสุด", unit: "เลือกหน่วย", clearAll: "ล้าง", }, nav: { main: "เมนูหลัก", sub: "เมนูย่อย", choosePage: "เลือกหน้า…", noResults: "ไม่พบ “{query}”", clearSearch: "ล้างคำค้นหาเมนู", sheetDescription: "เลือกหน้าที่ต้องการเปิด", }, sessionExpired: { title: "เซสชันหมดอายุ", description: "คุณถูกออกจากระบบระหว่างใช้งาน ข้อมูลที่ยังไม่ได้บันทึกจะหายไป กรุณาเข้าสู่ระบบอีกครั้ง แล้วระบบจะพากลับมาหน้านี้", signIn: "เข้าสู่ระบบ", }, errorState: { title: "เกิดข้อผิดพลาด", description: "ระบบไม่สามารถแสดงหน้านี้ได้ในขณะนี้ กรุณาลองใหม่อีกครั้ง หากยังพบปัญหาโปรดแจ้งผู้ดูแลระบบ", reference: "รหัสอ้างอิง:", retry: "ลองใหม่", home: "กลับหน้าหลัก", }, navigating: "กำลังโหลด...", usage: { of: "{used} จาก {limit}", unlimited: "ไม่จำกัด", nearlyFull: "ใกล้เต็ม", remaining: "เหลือ {remaining}", over: "เกินโควตา", }, versions: { label: "ประวัติรุ่น", current: "รุ่นปัจจุบัน", restore: "กู้คืน", confirm: "กู้คืนรุ่นนี้? รุ่นปัจจุบันจะถูกเก็บไว้เป็นรุ่นหนึ่งในประวัติ", confirmAction: "กู้คืนรุ่นนี้", restored: "กู้คืนแล้ว", }, accessDenied: { title: "ไม่มีสิทธิ์เข้าหน้านี้", description: "ขอให้ผู้ดูแลระบบเพิ่มสิทธิ์ให้ หรือเข้าด้วยบัญชีอื่น", permission: "หน้านี้ต้องใช้สิทธิ์ {permission}", signedInAs: "เข้าสู่ระบบเป็น", switchAccount: "สลับบัญชี", home: "กลับหน้าหลัก", request: "ขอสิทธิ์จากผู้ดูแล", }, exportMenu: { button: "ส่งออก", rows: "{count} รายการตามตัวกรอง", selectedOnly: "เฉพาะแถวที่เลือก ({count})", preparing: "กำลังเตรียมไฟล์…", done: "ดาวน์โหลด {name} แล้ว", failed: "ส่งออกไม่สำเร็จ", }, filterChips: { label: "ตัวกรองที่ใช้อยู่", remove: "ล้างตัวกรอง {name}", clearAll: "ล้างทั้งหมด" }, lang: "th", colorSelect: { placeholder: "เลือกสี", title: "เลือกสี", clear: "ไม่ระบุสี" }, iconSelect: { placeholder: "เลือกไอคอน", title: "เลือกไอคอน", clear: "ไม่ระบุไอคอน", all: "ทั้งหมด" }, bulkEdit: { title: "แก้ไข {count} {items}", description: "ติ๊กช่องที่จะเปลี่ยน — ช่องที่ไม่ติ๊กคงค่าเดิมของแต่ละรายการ", submit: "บันทึก {count} {items}", mixed: "ค่าต่างกัน", noneSelected: "ติ๊กอย่างน้อย 1 ช่องที่จะเปลี่ยน", success: "แก้ไข {count} {items}แล้ว", items: "รายการ", }, permissionMatrix: { label: "ตารางสิทธิ์", permission: "สิทธิ์", search: "ค้นหาสิทธิ์…", empty: "ไม่พบสิทธิ์ที่ตรงกับ “{query}”", toggleRole: "ให้สิทธิ์ทั้งหมดแก่ {role}", toggleGroup: "{group} ทั้งหมดสำหรับ {role}", locked: "กำหนดโดยระบบ แก้ไม่ได้", changed: "แก้แล้ว {count} จุด", reset: "คืนค่า", resource: "รายการ", allRow: "ทุกการกระทำของ {name}", allColumn: "{name} ทุกรายการ", notApplicable: "ไม่มี", }, zoom: { label: "ซูม", zoomIn: "ซูมเข้า", zoomOut: "ซูมออก", reset: "รีเซ็ตการซูม" }, stepIndicator: { label: "ขั้นตอน", done: "เสร็จแล้ว", error: "มีปัญหา" }, activity: { empty: "ยังไม่มีรายการ" }, thaiInput: { invalidId: "เลขบัตรประชาชนไม่ถูกต้อง", invalidPhone: "เบอร์โทรไม่ถูกต้อง" }, approval: { label: "ลำดับการอนุมัติ", done: "อนุมัติแล้ว", current: "กำลังรอ", rejected: "ไม่อนุมัติ", skipped: "ข้าม", pending: "ยังไม่ถึง", policyAll: "ทุกคนต้องอนุมัติ", policyAny: "คนใดคนหนึ่ง", progress: "{approved} จาก {total}", waitingSince: "รอตั้งแต่", approvedBy: "อนุมัติแล้ว", rejectedBy: "ไม่อนุมัติ", }, documentFlow: { label: "ลำดับเอกสาร", notCreated: "ยังไม่สร้าง" }, documentHeader: { back: "กลับ", more: "คำสั่งอื่น" }, buttons: { addNew: "เพิ่มใหม่", createNew: "สร้างใหม่", saving: "กำลังบันทึก...", saved: "บันทึกแล้ว", delete: "ลบ", deleting: "กำลังลบ...", print: "พิมพ์", refresh: "รีเฟรช", }, deleteMany: { trigger: "ลบ ({count})", title: "ลบ {count} {items}ที่เลือก?", description: "{items}ที่เลือกจะถูกลบถาวร และย้อนกลับไม่ได้", items: "รายการ", success: "ลบ {count} {items}แล้ว", }, clipboard: { success: "คัดลอกแล้ว", failed: "คัดลอกไม่สำเร็จ" }, recordSection: { add: "เพิ่ม", count: "จำนวน" }, comparison: { item: "รายการ", lowest: "ต่ำสุด", highest: "สูงสุด", total: "รวมทั้งสิ้น", incomplete: "เสนอไม่ครบ", }, importDialog: { steps: "ขั้นตอน", stepSelect: "เลือกไฟล์", stepReview: "ตรวจทาน", stepResult: "ผลลัพธ์", template: "ดาวน์โหลดไฟล์แม่แบบ", reading: "กำลังอ่าน {name}…", readFailed: "อ่านไฟล์ไม่ได้ ตรวจว่าเป็นไฟล์ตามแม่แบบ", emptyFile: "ไม่พบข้อมูลในไฟล์", tooLarge: "ไฟล์ใหญ่เกินกำหนด", wrongType: "ชนิดไฟล์ไม่ตรงกับที่รับ", validCount: "ถูกต้อง {count}", invalidCount: "ผิด {count}", moreInvalid: "และอีก {count} แถวที่ผิด — แก้ในไฟล์แล้วเลือกใหม่", row: "แถว", problem: "ปัญหา", preview: "ตัวอย่าง {count} แถวแรก", skipInvalid: "ข้ามแถวที่ผิด แล้วนำเข้า {count} แถว", fixFirst: "แก้แถวที่ผิดในไฟล์แล้วเลือกไฟล์ใหม่", importCount: "นำเข้า {count} แถว", commitFailed: "นำเข้าไม่สำเร็จ", chooseAnother: "เลือกไฟล์ใหม่", cancel: "ยกเลิก", done: "เสร็จ", created: "เพิ่มใหม่", updated: "อัปเดต", skipped: "ข้าม", }, changeDiff: { changed: "เปลี่ยน", empty: "(ว่าง)", noChanges: "ไม่มีการเปลี่ยนแปลง", showMore: "แสดงทั้งหมด", showLess: "ย่อ", }, rangePresets: { label: "ช่วงด่วน", today: "วันนี้", last7: "7 วันล่าสุด", last30: "30 วันล่าสุด", thisMonth: "เดือนนี้", lastMonth: "เดือนก่อน", thisQuarter: "ไตรมาสนี้", thisYear: "ปีนี้", custom: "กำหนดเอง…", apply: "ใช้ช่วงนี้", days: "{count} วัน", }, undo: { undo: "เลิกทำ", done: "ลบแล้ว", deletedMany: "ลบ {count} รายการแล้ว", failed: "ทำรายการไม่สำเร็จ", }, hotkeys: { title: "คีย์ลัด", sequenceThen: "แล้ว", general: "ทั่วไป", singleKeys: "คีย์ลัดตัวอักษรเดี่ยว", singleKeysHint: "ปิดได้ถ้าชนกับโปรแกรมอ่านจอหรือการพิมพ์ด้วยเสียง", empty: "หน้านี้ไม่มีคีย์ลัด", }, loadMore: { more: "โหลดเพิ่ม", moreCount: "โหลดเพิ่ม {count} รายการ", loading: "กำลังโหลด…", failed: "โหลดต่อไม่สำเร็จ ลองใหม่อีกครั้ง", retry: "ลองใหม่", done: "ครบทุกรายการแล้ว", shown: "แสดง {shown} จาก {total}", }, activityExtra: { expand: "ดูรายละเอียด", collapse: "ซ่อนรายละเอียด", loading: "กำลังโหลด…", failed: "โหลดรายการไม่สำเร็จ", retry: "ลองใหม่", today: "วันนี้", yesterday: "เมื่อวาน", }, rating: { label: "ให้คะแนน", valueOf: "{value} จาก {max} ดาว", stars: "{count} ดาว", clear: "ล้างคะแนน", reviews: "{count} รีวิว", }, banner: { dismiss: "ปิดประกาศ" }, keyValue: { key: "ชื่อ", value: "ค่า", add: "เพิ่มแถว", remove: "ลบแถว", showValue: "แสดงค่า", hideValue: "ซ่อนค่า", duplicate: "ชื่อซ้ำกับแถวที่ {row}", keyRequired: "ใส่ชื่อ", keyInvalid: "ชื่อใช้ไม่ได้", pasteAdd: "เพิ่ม {count} แถวจากข้อความที่วาง", moveUp: "เลื่อนขึ้น", moveDown: "เลื่อนลง", empty: "ยังไม่มีรายการ", pasteDuplicates: "มีชื่อที่ซ้ำกับแถวเดิม {count} รายการ", overwrite: "ทับค่าเดิม", skip: "ข้ามรายการซ้ำ", }, swipe: { actions: "คำสั่งของแถว" }, lightbox: { label: "ดูรูปขยาย", close: "ปิด", download: "ดาวน์โหลด", previous: "ก่อนหน้า", next: "ถัดไป", zoom: "ซูม", counter: "{index} / {total}", noPreview: "ดูตัวอย่างไม่ได้", openInNewTab: "เปิดในแท็บใหม่", }, savedViews: { label: "มุมมอง", all: "ทั้งหมด", saveNew: "บันทึกเป็นมุมมองใหม่…", modified: "แก้ไขแล้ว", update: "บันทึกทับ", reset: "คืนค่า", name: "ชื่อมุมมอง", summary: "จะบันทึกตัวกรอง การเรียง และคอลัมน์ที่ซ่อนตอนนี้", save: "บันทึก", cancel: "ยกเลิก", remove: "ลบมุมมอง", exists: "มีมุมมองชื่อนี้แล้ว", }, cellEdit: { edit: "แก้ไข", save: "บันทึก", cancel: "ยกเลิก", saving: "กำลังบันทึก…", failed: "บันทึกไม่สำเร็จ", retry: "ลองใหม่", }, calendarView: { month: "เดือน", week: "สัปดาห์", prevWeek: "สัปดาห์ก่อนหน้า", nextWeek: "สัปดาห์ถัดไป", items: "{count} รายการ", noItems: "ไม่มีรายการ", }, tour: { label: "แนะนำการใช้งาน", next: "ถัดไป", back: "ย้อน", skip: "ข้าม", done: "เสร็จสิ้น", step: "{current} / {total}", }, notifications: { title: "การแจ้งเตือน", empty: "ไม่มีรายการที่ต้องจัดการ", viewAll: "ดูทั้งหมด", }, selection: { selected: "เลือก {count} รายการ", clear: "ล้างการเลือก" }, record: { details: "ข้อมูลเพิ่มเติม" }, invalidForm: { fields: "กรุณากรอกหรือแก้ไข: {fields}", generic: "กรุณากรอกข้อมูลให้ครบถ้วน" }, sortable: { handle: "ลากเพื่อจัดลำดับ", instructions: "กด Space เพื่อเริ่มลาก ใช้ปุ่มลูกศรเลื่อน แล้วกด Space อีกครั้งเพื่อวาง (Esc = ยกเลิก)", started: "เริ่มลากรายการที่ {index} จาก {total}", startedMany: "เริ่มลาก {count} รายการที่เลือกไว้", moved: "ย้ายไปตำแหน่งที่ {index} จาก {total}", dropped: "วางที่ตำแหน่งที่ {index} จาก {total}", cancelled: "ยกเลิกการลาก", }, table: { scrollRegion: "ตาราง (เลื่อนซ้าย–ขวาได้)", rowsPerPage: "แถวต่อหน้า", pageOf: "หน้า {page} จาก {pages}", rangeOf: "{from}–{to} จาก {total}", shownOf: "{shown} จาก {total} รายการ", density: "ความหนาแน่นของแถว", selectedCount: "เลือก {count} รายการ", loading: "กำลังโหลด…", emptyTitle: "ยังไม่มีรายการ", emptyTitleOf: "ยังไม่มี{resource}", emptyHint: "เมื่อสร้างแล้วจะแสดงที่นี่", noMatch: "ไม่พบรายการที่ตรงกัน", noMatchQuery: 'ไม่พบรายการที่ตรงกับ "{query}"', noMatchHint: "ลองคำค้นอื่น หรือเอาตัวกรองออกบางตัว", clearAllFilters: "ล้างตัวกรองทั้งหมด", clearQuery: "ล้างคำค้น", errorTitle: "โหลดรายการไม่สำเร็จ", errorHint: "การเชื่อมต่อขัดข้อง ลองใหม่อีกครั้ง", retry: "ลองใหม่", selectedPill: "{count} รายการ", selectAll: "เลือกทั้งหมด", longPressHint: "กดค้างที่แถวเพื่อเลือกหมู่", clearFilters: "ล้าง", showResults: "ดู {count} รายการ", rowsSelected: "เลือก {selected} จาก {total} แถว", noResults: "ไม่พบข้อมูล", noData: "ยังไม่มีข้อมูล", noResultsFiltered: "ไม่พบข้อมูลที่ตรงกับการค้นหา", noResultsFilteredHint: "ลองเปลี่ยนคำค้นหรือล้างตัวกรอง", rowActionsOf: "ตัวเลือกของ {name}", deleteTitle: "ยืนยันการลบ", deleteDescription: "ลบ{resource} “{name}” แล้วกู้คืนไม่ได้", deleting: "กำลังลบ{resource} “{name}”…", deleted: "ลบ{resource} “{name}” แล้ว", delete: "ลบ", search: "ค้นหาข้อมูลในตาราง", clearSearch: "ล้างคำค้นหา", filters: "ตัวกรองข้อมูล", filtersDescription: "เลือกได้หลายเงื่อนไข ผลลัพธ์จะอัปเดตทันที", closeFilters: "ปิดตัวกรอง", clearFilter: "ล้างตัวกรอง {name}", columns: "คอลัมน์", toggleColumns: "แสดงคอลัมน์", filterButton: "ตัวกรอง", resetFilters: "ล้างตัวกรอง", sortAsc: "เรียงน้อยไปมาก", sortDesc: "เรียงมากไปน้อย", sortClear: "ยกเลิกการเรียง", hideColumn: "ซ่อนคอลัมน์", reorderBlocked: "จัดลำดับไม่ได้ขณะกรองหรือเรียงคอลัมน์อยู่", }, ok: "ตกลง", alertTitle: "แจ้งให้ทราบ", promptTitle: "กรอกข้อมูล", chooseTitle: "เลือกการทำรายการ", checklistTitle: "เลือกรายการ", palette: { placeholder: "ค้นหาหรือสั่งงาน…", title: "ค้นหา", description: "พิมพ์เพื่อค้นหาหน้าและข้อมูล", empty: "ไม่พบผลลัพธ์", searching: "กำลังค้นหา…", pages: "หน้า", }, switcher: { choose: "เลือกองค์กร", organization: "องค์กร" }, userMenu: "เมนูผู้ใช้", toggleSidebar: "ย่อ/ขยายเมนู", signOut: "ออกจากระบบ", theme: { label: "ธีม", light: "สว่าง", dark: "มืด", system: "ตามระบบ" }, sectionNav: { tabs: "แท็บย่อย" }, search: { placeholder: "ค้นหา…", label: "ค้นหา", clear: "ล้างการค้นหา" }, language: { label: "ภาษา" }, confirmTypeToConfirm: "พิมพ์", confirmTypeToConfirmSuffix: "เพื่อยืนยัน", month: { previous: "เดือนก่อน", next: "เดือนถัดไป", current: "กลับไปเดือนนี้" }, setup: { optional: "ไม่บังคับ", progress: "ทำแล้ว {done} จาก {total} ขั้น", view: "ดู" }, filters: { clear: "ล้างตัวกรอง", label: "ตัวกรอง" }, settings: { back: "กลับ", empty: "ไม่พบหัวข้อที่ตรงกับคำค้น", label: "หัวข้อการตั้งค่า" }, mobileTabs: "เมนูหลัก", close: "ปิด", openInNewTab: "เปิดในแท็บใหม่", changeLanguage: "เปลี่ยนภาษา", auth: { or: "หรือ", continueWith: "ดำเนินการต่อด้วย {provider}", showPassword: "แสดงรหัสผ่าน", hidePassword: "ซ่อนรหัสผ่าน", }, questionnaire: { previous: "ย้อนกลับ", next: "ถัดไป", skip: "ข้าม", submit: "ส่งคำตอบ", progress: "ข้อ {current} จาก {total}", other: "คำตอบอื่น…", }, chat: { placeholder: "พิมพ์ข้อความ…", send: "ส่ง", typing: "กำลังพิมพ์…", scrollToLatest: "ไปข้อความล่าสุด", region: "ข้อความ", }, pagination: { previous: "ก่อนหน้า", next: "ถัดไป", first: "หน้าแรก", last: "หน้าสุดท้าย", label: "แบ่งหน้า", page: "หน้า", }, loading: "กำลังโหลด…", presence: { online: "ออนไลน์", away: "ไม่อยู่", busy: "ไม่ว่าง", offline: "ออฟไลน์" }, characterCount: "พิมพ์แล้ว {count} จาก {max} ตัวอักษร", number: { increment: "เพิ่ม", decrement: "ลด" }, datePicker: { placeholder: "เลือกวันที่", smartPlaceholder: "เช่น 15/3, t+3, t+1m", apply: "ตกลง", presets: "ทางลัด", today: "วันนี้", yesterday: "เมื่อวาน", tomorrow: "พรุ่งนี้", nextWeek: "+1 สัปดาห์", lastWeek: "-1 สัปดาห์", nextMonth: "+1 เดือน", lastMonth: "-1 เดือน", clear: "ล้างวันที่", rangePlaceholder: "เลือกช่วงวันที่", rangeSmartPlaceholder: "เช่น 1/7-5/7, t-7..t", help: "วิธีพิมพ์วันที่", helpDate: "15 มี.ค. ปีนี้ (ไม่ใส่ปี = ปีปัจจุบัน)", helpYear: "ใส่ปี พ.ศ. หรือ ค.ศ. ได้ (2 หรือ 4 หลัก)", helpToday: "วันนี้", helpDays: "อีก 3 วัน · 2 วันก่อน (d = วัน)", helpUnits: "สัปดาห์ · เดือน · ปี", helpRange: "1–5 ก.ค.", helpRangeShortcut: "ช่วงจากตัวย่อ (คั่นด้วย .. ~ ถึง to)", pickEnd: "เลือกวันสุดท้ายของช่วง", cannotRead: "อ่านไม่ออก — ลองพิมพ์ {example}", shortcutsLabel: "พิมพ์ลัด", showAll: "ทั้งหมด", backToCalendar: "ปฏิทิน", openCalendar: "เปิดปฏิทิน", dayCount: "{count} วัน", allShortcuts: "พิมพ์ลัดทั้งหมด", tapToFill: "กดเพื่อเติมในช่อง", beforeMin: "เลือกได้ตั้งแต่วันที่ {date}", afterMax: "เลือกได้ถึงวันที่ {date}", clearRange: "ล้างช่วงวันที่", last7Days: "7 วันล่าสุด", last30Days: "30 วันล่าสุด", thisMonth: "เดือนนี้", previousMonth: "เดือนที่แล้ว", next7Days: "7 วันข้างหน้า", next30Days: "30 วันข้างหน้า", }, time: { choose: "เลือกเวลา", hour: "ชั่วโมง", minute: "นาที", now: "ตอนนี้", clear: "ล้าง", dateTimePlaceholder: "เลือกวันและเวลา", invalid: "รูปแบบเวลาไม่ถูกต้อง (เช่น 14:30)", }, tags: { placeholder: "พิมพ์แล้วกด Enter", remove: "ลบ {tag}", duplicate: "มี “{tag}” แล้ว", max: "เพิ่มได้สูงสุด {max} รายการ", }, stepForm: { label: "ขั้นตอน", previous: "ย้อนกลับ", next: "ถัดไป", submit: "ส่ง", progress: "ขั้นที่ {current} จาก {total}", }, richText: { placeholder: "เริ่มพิมพ์…", toolbar: "แถบจัดรูปแบบ", undo: "เลิกทำ", redo: "ทำซ้ำ", fontSize: "ขนาดตัวอักษร", fontSizeValue: "{size} pt", resetFontSize: "ขนาดเริ่มต้น", bold: "ตัวหนา", italic: "ตัวเอียง", underline: "ขีดเส้นใต้", alignment: "จัดแนว", alignLeft: "ชิดซ้าย", alignCenter: "กึ่งกลาง", alignRight: "ชิดขวา", justify: "เต็มบรรทัด", lists: "รายการ", bulletList: "รายการหัวข้อย่อย", orderedList: "รายการลำดับเลข", insert: "แทรก", insertLink: "แทรกลิงก์…", insertTable: "แทรกตาราง…", horizontalRule: "เส้นคั่น", table: "ตาราง", tableActions: "จัดการตาราง", addRow: "เพิ่มแถว", addColumn: "เพิ่มคอลัมน์", mergeCells: "รวมช่อง", unmergeCell: "แยกช่อง", color: "สีพื้น", cell: "ช่อง", row: "แถว", column: "คอลัมน์", colorClear: "ไม่มีสี", colorGray: "เทา", colorBlue: "ฟ้า", colorGreen: "เขียว", colorYellow: "เหลือง", colorRed: "แดง", colorPurple: "ม่วง", colorSwatch: "{target}: {color}", verticalAlign: "จัดแนวตั้ง", alignTop: "บน", alignMiddle: "กลาง", alignBottom: "ล่าง", rowHeight: "ความสูงแถว", rowNormal: "ปกติ", rowTall: "สูง", rowExtraTall: "สูงมาก", deleteRow: "ลบแถว", deleteColumn: "ลบคอลัมน์", linkTitle: "แทรกลิงก์", linkUrl: "ที่อยู่ลิงก์ (URL)", linkInvalid: "ใช้ลิงก์ที่ขึ้นต้นด้วย https://, mailto: หรือ tel:", tableTitle: "แทรกตาราง", tableRows: "จำนวนแถว", tableColumns: "จำนวนคอลัมน์", insertConfirm: "แทรก", variableNew: "ตัวแปรใหม่…", variableCreate: "สร้างตัวแปร: {name}", }, discardChanges: { title: "ทิ้งข้อมูลที่กรอกไว้?", description: "ข้อมูลที่กรอกไว้และยังไม่ได้บันทึกจะหายไป", discard: "ทิ้งข้อมูล", keepEditing: "กรอกต่อ", }, secretReveal: { hidden: "ซ่อนค่าแล้วเพื่อความปลอดภัย", show: "แสดงอีกครั้ง" }, carousel: { previous: "สไลด์ก่อนหน้า", next: "สไลด์ถัดไป" }, eventCalendar: { today: "วันนี้", previous: "ก่อนหน้า", next: "ถัดไป", view: "มุมมอง", month: "เดือน", week: "สัปดาห์", day: "วัน", agenda: "รายการ", more: "+{count} รายการ", less: "ย่อ", allDay: "ทั้งวัน", empty: "ไม่มีรายการในช่วงนี้", dayLabel: "{date} มี {count} รายการ", "3days": "3 วัน", "2months": "2 เดือน", moved: "ย้าย {title} ไป {when}", resize: "ยืดเวลาจบ", resized: "{title} เป็น {when}", }, pdfExport: { download: "สร้าง PDF", loading: "กำลังสร้าง PDF...", optionsAriaLabel: "ตัวเลือก PDF", printPreview: "ดูตัวอย่างก่อนพิมพ์", print: "พิมพ์เอกสาร", scaleMode: "การย่อขยาย", fitToOnePage: "ย่อให้พอดี 1 หน้า", fitToPageWidth: "พอดีความกว้างหน้า", success: "สร้าง PDF สำเร็จ", error: "สร้าง PDF ไม่สำเร็จ", }, pdfPreview: { title: "ตัวอย่าง PDF", loading: "กำลังโหลด PDF...", generating: "กำลังสร้างตัวอย่าง PDF...", updating: "กำลังอัปเดต PDF...", failed: "สร้างตัวอย่าง PDF ไม่สำเร็จ", firstPageOnly: "แสดงเฉพาะหน้าแรก", openFull: "เปิดทั้งเอกสาร", unsupported: "เบราว์เซอร์นี้แสดง PDF ในหน้าไม่ได้", open: "เปิด PDF", }, exportJobs: { title: "งานส่งออก", button: "งานส่งออก", empty: "ยังไม่มีงานส่งออก", loading: "กำลังโหลด...", pending: "รอคิว", running: "กำลังทำ", success: "พร้อมดาวน์โหลด", failed: "ล้มเหลว", expired: "หมดอายุ", createdAt: "สั่งเมื่อ {date}", expiresAt: "หมดอายุ {date}", download: "ดาวน์โหลด", delete: "ลบงานและไฟล์ผลลัพธ์", deleteFailed: "ลบงานไม่สำเร็จ", activeCount: "{count} กำลังทำ", readyCount: "{count} พร้อม", loadFailed: "โหลดรายการงานไม่สำเร็จ", retry: "ลองใหม่", announceReady: "งานส่งออกพร้อมดาวน์โหลด {count} งาน", announceFailed: "งานส่งออกล้มเหลว {count} งาน", }, messageScroller: { toEnd: "เลื่อนลงล่างสุด", toStart: "เลื่อนขึ้นบนสุด" }, imageUpload: { choose: "เลือกรูป", change: "เปลี่ยนรูป", remove: "ลบรูป", preview: "ตัวอย่างรูป", tooLarge: "ไฟล์ใหญ่เกิน {size}", }, sidebarPin: { pin: "ตรึงเมนูไว้", unpin: "เลิกตรึงเมนู", pinHint: "ตรึงเมนู — เปิดค้างไว้ข้างซ้าย ไม่ปิดเมื่อเลือกเมนู", unpinHint: "เลิกตรึง — ซ่อนเมนูไว้ เปิดจากปุ่มเมนูเมื่อต้องการ และปิดเองเมื่อเลือกเมนู", }, pinnedLinks: { label: "เมนูที่ปักหมุด", unpin: "เลิกปักหมุด", confirmTitle: "เลิกปักหมุดเมนูนี้?", confirmDescription: 'นำ "{title}" ออกจากแถบเมนูด้านบน', }, }; export const UI_TEXT_EN: UiText = { cancel: "Cancel", formDialog: { discardTitle: "Discard unsaved changes?", discardHint: "What you've entered will be lost.", keepEditing: "Keep editing", discard: "Discard and close", }, unsavedGuard: { leave: "Leave page" }, requiredField: "required", skipToContent: "Skip to content", breadcrumb: { home: "Home", back: "Back", label: "Breadcrumb" }, stageBar: { label: "Stages", alert: "{count} overdue" }, done: "Done", save: "Save", actions: "Actions", copy: "Copy", copied: "Copied", showOnce: "Shown once — copy it now", success: "Done", copyFailed: "Automatic copy is blocked — text selected, press Ctrl+C / ⌘C", confirm: "Confirm", confirmTitle: "Please confirm", actionFailed: "Action failed", edit: "Edit", combobox: { search: "Search {label}…", empty: "No results", clearAll: "Clear all", remove: "Remove {label}", add: "Add “{value}”", moreCount: "+{count} more", placeholder: "Select…", searchPlaceholder: "Search…", loading: "Searching…", typeToSearch: "Type at least {count} characters to search", searchFailed: "Search failed", }, fileCard: { select: "Select {name}", folder: "Folder" }, filter: { title: "Filter by property", description: "Values in the same property are OR, different properties are AND", searchProperty: "Search properties…", clearSearch: "Clear search", noProperties: "No properties found", active: "Active property filters", searchValue: "Search values…", filterOne: "Filter {name}", clearOne: "Clear {name} filter", min: "Min", max: "Max", unit: "Select unit", clearAll: "Clear", }, nav: { main: "Main menu", sub: "Section menu", choosePage: "Choose a page…", noResults: "No match for “{query}”", clearSearch: "Clear menu search", sheetDescription: "Choose a page to open", }, sessionExpired: { title: "Session expired", description: "You were signed out while working. Unsaved changes are lost — sign in again and we will bring you back to this page.", signIn: "Sign in", }, errorState: { title: "Something went wrong", description: "This page can't be shown right now. Please try again — if it keeps happening, contact your administrator.", reference: "Reference:", retry: "Try again", home: "Back to home", }, navigating: "Loading...", usage: { of: "{used} of {limit}", unlimited: "Unlimited", nearlyFull: "Nearly full", remaining: "{remaining} left", over: "Over quota", }, versions: { label: "Version history", current: "Current", restore: "Restore", confirm: "Restore this version? The current version is kept in the history.", confirmAction: "Restore version", restored: "Restored", }, accessDenied: { title: "You don't have access to this page", description: "Ask an administrator for access, or sign in with another account.", permission: "This page requires the {permission} permission.", signedInAs: "Signed in as", switchAccount: "Switch account", home: "Back to home", request: "Request access", }, exportMenu: { button: "Export", rows: "{count} rows matching filters", selectedOnly: "Selected rows only ({count})", preparing: "Preparing file…", done: "Downloaded {name}", failed: "Export failed", }, filterChips: { label: "Active filters", remove: "Remove {name} filter", clearAll: "Clear all" }, lang: "en", colorSelect: { placeholder: "Choose color", title: "Choose color", clear: "No color" }, iconSelect: { placeholder: "Choose icon", title: "Choose icon", clear: "No icon", all: "All" }, bulkEdit: { title: "Edit {count} {items}", description: "Tick the fields to change — unticked fields keep each item's current value", submit: "Save {count} {items}", mixed: "Mixed values", noneSelected: "Tick at least one field to change", success: "Updated {count} {items}", items: "items", }, permissionMatrix: { label: "Permissions", permission: "Permission", search: "Search permissions…", empty: "No permissions match “{query}”", toggleRole: "Grant all to {role}", toggleGroup: "All {group} for {role}", locked: "Set by the system", changed: "{count} changes", reset: "Reset", resource: "Resource", allRow: "All actions for {name}", allColumn: "{name} for all", notApplicable: "Not applicable", }, zoom: { label: "Zoom", zoomIn: "Zoom in", zoomOut: "Zoom out", reset: "Reset zoom" }, stepIndicator: { label: "Steps", done: "done", error: "has a problem" }, activity: { empty: "No activity yet" }, thaiInput: { invalidId: "Invalid Thai ID number", invalidPhone: "Invalid phone number" }, approval: { label: "Approval steps", done: "Approved", current: "Waiting", rejected: "Rejected", skipped: "Skipped", pending: "Not reached", policyAll: "Everyone must approve", policyAny: "Any one approver", progress: "{approved} of {total}", waitingSince: "Waiting since", approvedBy: "approved", rejectedBy: "rejected", }, documentFlow: { label: "Document chain", notCreated: "Not created" }, documentHeader: { back: "Back", more: "More actions" }, buttons: { addNew: "Add New", createNew: "Create New", saving: "Saving...", saved: "Saved", delete: "Delete", deleting: "Deleting...", print: "Print", refresh: "Refresh", }, deleteMany: { trigger: "Delete ({count})", title: "Are you sure?", description: "This will permanently delete the selected {items}.", items: "items", success: "{count} {items} deleted successfully.", }, clipboard: { success: "Copied to clipboard", failed: "Failed to copy" }, recordSection: { add: "Add", count: "Count" }, comparison: { item: "Item", lowest: "Lowest", highest: "Highest", total: "Grand total", incomplete: "Incomplete bid", }, importDialog: { steps: "Steps", stepSelect: "Choose file", stepReview: "Review", stepResult: "Result", template: "Download template", reading: "Reading {name}…", readFailed: "Couldn't read the file. Check that it follows the template", emptyFile: "The file has no rows", tooLarge: "The file is too large", wrongType: "This file type isn't accepted", validCount: "Valid {count}", invalidCount: "Invalid {count}", moreInvalid: "…and {count} more invalid rows — fix the file and choose it again", row: "Row", problem: "Problem", preview: "First {count} rows", skipInvalid: "Skip invalid rows and import {count} rows", fixFirst: "Fix the invalid rows in the file, then choose it again", importCount: "Import {count} rows", commitFailed: "Import failed", chooseAnother: "Choose another file", cancel: "Cancel", done: "Done", created: "Created", updated: "Updated", skipped: "Skipped", }, changeDiff: { changed: "changed", empty: "(empty)", noChanges: "No changes", showMore: "Show all", showLess: "Show less", }, rangePresets: { label: "Quick ranges", today: "Today", last7: "Last 7 days", last30: "Last 30 days", thisMonth: "This month", lastMonth: "Last month", thisQuarter: "This quarter", thisYear: "This year", custom: "Custom…", apply: "Apply", days: "{count} days", }, undo: { undo: "Undo", done: "Deleted", deletedMany: "Deleted {count} items", failed: "Couldn't complete that", }, hotkeys: { title: "Keyboard shortcuts", sequenceThen: "then", general: "General", singleKeys: "Single-key shortcuts", singleKeysHint: "Turn off if they clash with a screen reader or voice input", empty: "No shortcuts on this page", }, loadMore: { more: "Load more", moreCount: "Load {count} more", loading: "Loading…", failed: "Couldn't load more. Try again.", retry: "Try again", done: "All items loaded", shown: "Showing {shown} of {total}", }, activityExtra: { expand: "Show details", collapse: "Hide details", loading: "Loading…", failed: "Couldn't load activity", retry: "Try again", today: "Today", yesterday: "Yesterday", }, rating: { label: "Rating", valueOf: "{value} out of {max} stars", stars: "{count} stars", clear: "Clear rating", reviews: "{count} reviews", }, banner: { dismiss: "Dismiss" }, keyValue: { key: "Name", value: "Value", add: "Add row", remove: "Remove row", showValue: "Show value", hideValue: "Hide value", duplicate: "Same name as row {row}", keyRequired: "Enter a name", keyInvalid: "That name isn't valid", pasteAdd: "Add {count} rows from pasted text", moveUp: "Move up", moveDown: "Move down", empty: "Nothing here yet", pasteDuplicates: "{count} names already exist", overwrite: "Overwrite", skip: "Skip duplicates", }, swipe: { actions: "Row actions" }, lightbox: { label: "Image viewer", close: "Close", download: "Download", previous: "Previous", next: "Next", zoom: "Zoom", counter: "{index} / {total}", noPreview: "No preview available", openInNewTab: "Open in a new tab", }, savedViews: { label: "View", all: "All", saveNew: "Save as new view…", modified: "Modified", update: "Save changes", reset: "Reset", name: "View name", summary: "Saves the current filters, sorting, and hidden columns", save: "Save", cancel: "Cancel", remove: "Delete view", exists: "A view with this name already exists", }, cellEdit: { edit: "Edit", save: "Save", cancel: "Cancel", saving: "Saving…", failed: "Couldn't save", retry: "Try again", }, calendarView: { month: "Month", week: "Week", prevWeek: "Previous week", nextWeek: "Next week", items: "{count} items", noItems: "Nothing scheduled", }, tour: { label: "Product tour", next: "Next", back: "Back", skip: "Skip", done: "Done", step: "{current} / {total}", }, notifications: { title: "Notifications", empty: "Nothing needs your attention", viewAll: "View all", }, selection: { selected: "{count} selected", clear: "Clear selection" }, record: { details: "More details" }, invalidForm: { fields: "Please fill in or fix: {fields}", generic: "Please complete the required fields", }, sortable: { handle: "Drag to reorder", instructions: "Press Space to start dragging, use arrow keys to move, Space again to drop (Esc to cancel)", started: "Picked up item {index} of {total}", startedMany: "Picked up {count} selected items", moved: "Moved to position {index} of {total}", dropped: "Dropped at position {index} of {total}", cancelled: "Dragging cancelled", }, table: { scrollRegion: "Table (scrolls horizontally)", rowsPerPage: "Rows per page", pageOf: "Page {page} of {pages}", rangeOf: "{from}–{to} of {total}", shownOf: "{shown} of {total} items", density: "Row density", selectedCount: "{count} selected", loading: "Loading…", emptyTitle: "Nothing here yet", emptyTitleOf: "No {resource} yet", emptyHint: "Items will show up here once created.", noMatch: "No matching items", noMatchQuery: 'No items match "{query}"', noMatchHint: "Try another search, or remove some filters.", clearAllFilters: "Clear all filters", clearQuery: "Clear search", errorTitle: "Couldn't load the list", errorHint: "The connection dropped. Try again.", retry: "Try again", selectedPill: "{count} items", selectAll: "Select all", longPressHint: "Press and hold a row to select several", clearFilters: "Clear", showResults: "Show {count} items", rowsSelected: "{selected} of {total} row(s) selected", noResults: "No results", noData: "No data yet", noResultsFiltered: "No results match your search", noResultsFilteredHint: "Try a different search or clear the filters", rowActionsOf: "Options for {name}", deleteTitle: "Are you sure?", deleteDescription: "Deleting{resource} “{name}” cannot be undone", deleting: "Deleting{resource} “{name}”…", deleted: "“{name}”{resource} deleted", delete: "Delete", search: "Search the table", clearSearch: "Clear search", filters: "Filters", filtersDescription: "Combine conditions — results update instantly", closeFilters: "Close filters", clearFilter: "Clear {name} filter", columns: "Columns", toggleColumns: "Toggle columns", filterButton: "Filters", resetFilters: "Reset filters", sortAsc: "Ascending", sortDesc: "Descending", sortClear: "Clear sort", hideColumn: "Hide column", reorderBlocked: "Can't reorder while filtering or sorting", }, ok: "OK", alertTitle: "Notice", promptTitle: "Input required", chooseTitle: "Choose an action", checklistTitle: "Choose options", palette: { placeholder: "Search or jump to…", title: "Search", description: "Type to search pages and records", empty: "No results", searching: "Searching…", pages: "Pages", }, switcher: { choose: "Choose organization", organization: "Organization" }, userMenu: "User menu", toggleSidebar: "Toggle sidebar", signOut: "Sign out", theme: { label: "Theme", light: "Light", dark: "Dark", system: "System" }, sectionNav: { tabs: "Section tabs" }, search: { placeholder: "Search…", label: "Search", clear: "Clear search" }, language: { label: "Language" }, confirmTypeToConfirm: "Type", confirmTypeToConfirmSuffix: "to confirm", month: { previous: "Previous month", next: "Next month", current: "Back to this month" }, setup: { optional: "Optional", progress: "{done} of {total} steps done", view: "View" }, filters: { clear: "Clear filters", label: "Filters" }, settings: { back: "Back", empty: "No settings match your search", label: "Settings sections" }, mobileTabs: "Main menu", close: "Close", openInNewTab: "Open in a new tab", changeLanguage: "Change language", auth: { or: "or", continueWith: "Continue with {provider}", showPassword: "Show password", hidePassword: "Hide password", }, questionnaire: { previous: "Back", next: "Next", skip: "Skip", submit: "Submit", progress: "Question {current} of {total}", other: "Other answer…", }, chat: { placeholder: "Type a message…", send: "Send", typing: "Typing…", scrollToLatest: "Jump to latest", region: "Messages", }, pagination: { previous: "Previous", next: "Next", first: "First page", last: "Last page", label: "Pagination", page: "Page", }, loading: "Loading…", presence: { online: "Online", away: "Away", busy: "Busy", offline: "Offline" }, characterCount: "{count} of {max} characters", number: { increment: "Increase", decrement: "Decrease" }, datePicker: { placeholder: "Pick a date", smartPlaceholder: "e.g. 15/3, t+3, t+1m", apply: "Apply", presets: "Shortcuts", today: "Today", yesterday: "Yesterday", tomorrow: "Tomorrow", nextWeek: "+1 week", lastWeek: "-1 week", nextMonth: "+1 month", lastMonth: "-1 month", clear: "Clear date", rangePlaceholder: "Pick a date range", rangeSmartPlaceholder: "e.g. 1/7-5/7, t-7..t", help: "How to type a date", helpDate: "15 Mar this year (no year = current year)", helpYear: "Year in CE or BE (2 or 4 digits)", helpToday: "Today", helpDays: "In 3 days · 2 days ago (d = days)", helpUnits: "Weeks · months · years", helpRange: "1–5 Jul", helpRangeShortcut: "Range from shortcuts (separate with .. ~ to)", pickEnd: "Pick the last day of the range", cannotRead: "Can't read that — try {example}", shortcutsLabel: "Shortcuts", showAll: "All", backToCalendar: "Calendar", openCalendar: "Open calendar", dayCount: "{count} days", allShortcuts: "All shortcuts", tapToFill: "Tap to fill the field", beforeMin: "Pick {date} or later", afterMax: "Pick {date} or earlier", clearRange: "Clear selection", last7Days: "Last 7 days", last30Days: "Last 30 days", thisMonth: "This month", previousMonth: "Last month", next7Days: "Next 7 days", next30Days: "Next 30 days", }, time: { choose: "Choose time", hour: "Hour", minute: "Minute", now: "Now", clear: "Clear", dateTimePlaceholder: "Pick date and time", invalid: "Invalid time (e.g. 14:30)", }, tags: { placeholder: "Type and press Enter", remove: "Remove {tag}", duplicate: "“{tag}” is already added", max: "Up to {max} items", }, stepForm: { label: "Steps", previous: "Back", next: "Next", submit: "Submit", progress: "Step {current} of {total}", }, richText: { placeholder: "Start typing…", toolbar: "Formatting", undo: "Undo", redo: "Redo", fontSize: "Font size", fontSizeValue: "{size} pt", resetFontSize: "Reset size", bold: "Bold", italic: "Italic", underline: "Underline", alignment: "Alignment", alignLeft: "Align left", alignCenter: "Align center", alignRight: "Align right", justify: "Justify", lists: "Lists", bulletList: "Bulleted list", orderedList: "Numbered list", insert: "Insert", insertLink: "Insert link…", insertTable: "Insert table…", horizontalRule: "Horizontal rule", table: "Table", tableActions: "Table actions", addRow: "Add row", addColumn: "Add column", mergeCells: "Merge cells", unmergeCell: "Unmerge cell", color: "Background", cell: "Cell", row: "Row", column: "Column", colorClear: "No color", colorGray: "Gray", colorBlue: "Blue", colorGreen: "Green", colorYellow: "Yellow", colorRed: "Red", colorPurple: "Purple", colorSwatch: "{target}: {color}", verticalAlign: "Vertical align", alignTop: "Top", alignMiddle: "Middle", alignBottom: "Bottom", rowHeight: "Row height", rowNormal: "Normal", rowTall: "Tall", rowExtraTall: "Extra tall", deleteRow: "Delete row", deleteColumn: "Delete column", linkTitle: "Insert link", linkUrl: "Link URL", linkInvalid: "Use a link starting with https://, mailto: or tel:", tableTitle: "Insert table", tableRows: "Rows", tableColumns: "Columns", insertConfirm: "Insert", variableNew: "New variable…", variableCreate: "Create variable: {name}", }, discardChanges: { title: "Discard your changes?", description: "Anything you entered and haven't saved will be lost.", discard: "Discard", keepEditing: "Keep editing", }, secretReveal: { hidden: "Hidden for your security", show: "Show again" }, carousel: { previous: "Previous slide", next: "Next slide" }, eventCalendar: { today: "Today", previous: "Previous", next: "Next", view: "View", month: "Month", week: "Week", day: "Day", agenda: "Agenda", more: "+{count} more", less: "Less", allDay: "All day", empty: "Nothing scheduled in this period", dayLabel: "{date}, {count} items", "3days": "3 days", "2months": "2 months", moved: "Moved {title} to {when}", resize: "Resize end time", resized: "{title} now {when}", }, pdfExport: { download: "Create PDF", loading: "Creating PDF...", optionsAriaLabel: "PDF options", printPreview: "Print preview", print: "Print", scaleMode: "Scaling", fitToOnePage: "Fit to one page", fitToPageWidth: "Fit to page width", success: "PDF created", error: "Couldn't create PDF", }, pdfPreview: { title: "PDF preview", loading: "Loading PDF...", generating: "Creating PDF preview...", updating: "Updating PDF...", failed: "Couldn't create the PDF preview", firstPageOnly: "Showing the first page only", openFull: "Open full document", unsupported: "This browser can't show PDFs in the page", open: "Open PDF", }, exportJobs: { title: "Export jobs", button: "Exports", empty: "No export jobs yet", loading: "Loading...", pending: "Queued", running: "Running", success: "Ready", failed: "Failed", expired: "Expired", createdAt: "Requested {date}", expiresAt: "Expires {date}", download: "Download", delete: "Delete job and file", deleteFailed: "Couldn't delete the job", activeCount: "{count} running", readyCount: "{count} ready", loadFailed: "Couldn't load export jobs", retry: "Retry", announceReady: "{count} export(s) ready to download", announceFailed: "{count} export(s) failed", }, messageScroller: { toEnd: "Scroll to end", toStart: "Scroll to start" }, imageUpload: { choose: "Choose image", change: "Change image", remove: "Remove image", preview: "Image preview", tooLarge: "File is larger than {size}", }, sidebarPin: { pin: "Pin menu", unpin: "Unpin menu", pinHint: "Pin menu — keep it open on the left; it stays open after choosing a page", unpinHint: "Unpin — hide the menu; open it from the menu button and it closes after choosing a page", }, pinnedLinks: { label: "Pinned menus", unpin: "Unpin", confirmTitle: "Unpin this menu?", confirmDescription: 'Remove "{title}" from the top bar.', }, }; const UiTextContext = createContext(UI_TEXT_TH); /** ทับข้อความบางคำ — กลุ่ม (object) รวมกับของเดิมทีละคีย์ ไม่แทนทั้งกลุ่ม */ export type UiTextOverrides = { [K in keyof UiText]?: UiText[K] extends string | undefined ? string : Partial>; }; function mergeUiText(base: UiText, overrides: UiTextOverrides | undefined): UiText { if (!overrides) return base; const merged: Record = { ...base }; for (const [key, value] of Object.entries(overrides)) { if (value === undefined) continue; const current = merged[key]; merged[key] = typeof value === "object" && value !== null && typeof current === "object" && current !== null ? { ...current, ...value } : value; } return merged as unknown as UiText; } /** * ข้อความในตัวของ component ทั้งแพ็กเกจ (ไม่ครอบ = ไทย) * * // "th" | "en" * * // ชุดของแอปเองทั้งชุด * * `locale`/`overrides` เป็นค่าธรรมดา จึงส่งจาก server layout ได้ตรง ๆ (ต่างจาก `text={{ ...UI_TEXT_EN }}` * ที่ spread ใน server component แล้วได้ client reference ว่าง ต้องห่อด้วย client component เอง) */ export function UiTextProvider({ text, locale, overrides, children, }: { /** ชุดข้อความทั้งชุด — ชนะ `locale` */ text?: UiText; /** เลือกชุดในตัว: "en" = `UI_TEXT_EN`, อื่น ๆ = `UI_TEXT_TH` */ locale?: string; overrides?: UiTextOverrides; children: ReactNode; }) { const base = text ?? (locale === "en" ? UI_TEXT_EN : UI_TEXT_TH); const value = useMemo(() => mergeUiText(base, overrides), [base, overrides]); return {children}; } export function useUiText(): UiText { return useContext(UiTextContext); }