Files
xenia-pos-local/packages/i18n/src/index.js
T
bonaminandClaude Opus 5.5 e09056a7a4 feat(manager): Media page, photo field for products and categories (platform-v2 step 5.2)
- Management → Media (src/pages/media/): every picture and video, search,
  pictures / videos, batch upload (many files or drop on the page) with a
  result per file, details (preview, display name, kind, resolution, length,
  file size, uploaded file, when / who, the sizes made, what uses it, delete
  off while used).
- MediaField: upload on the spot (into the library and set at once), pick
  from the library (MediaPicker, which can also upload), remove; after an
  upload on the spot "Name it after the product / category" renames it in
  Latin letters. Used by the product editor and the category dialog.
- nav: `anyPerm` (any of the keys that manage pictures); the route guard uses
  the same rule. Product rows have test ids.
- @xenia/i18n: latin() (Greek to Latin, the way venues write it) + tests.
- tests: manager media.test.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 15:57:50 +02:00

27 lines
1.4 KiB
JavaScript

// @xenia/i18n — translations, language choice and venue-time formatting for every
// frontend (APPS_PLATFORM D-11, D-12, §7.2, §8; plan step 2.4). Imported from source by Vite.
//
// const i18n = createI18n({ language: resolveLanguage({ user, device, venue }) })
// <I18nProvider i18n={i18n} venue={bootstrap.venue}>
// <UiLabelsProvider labels={useUiLabels()}>… (@xenia/ui component texts)
// const { t } = useTranslation('manager'); const { formatTime, formatMoney } = useFormat()
//
// Rules: never toLocaleString()/Intl.DateTimeFormat without the venue zone (use useFormat);
// new UI text is a key in locales/en (+ el); run `npm test -w @xenia/i18n` (includes
// scripts/check-i18n.mjs) after adding keys.
export { createI18n } from './i18n.js'
export { setUserLanguage } from './language.js'
export { I18nProvider } from './provider.jsx'
export { useFormat, useLanguage, useUiLabels } from './hooks.js'
export { createFormatters, toDate, DATE_STYLES } from './format.js'
export { parseNumber } from './number.js'
export { latin } from './latin.js'
export {
SUPPORTED_LANGUAGES, FALLBACK_LANGUAGE, LANGUAGE_NAMES, DEFAULT_TIMEZONE, DEFAULT_CURRENCY,
resolveLanguage, normalizeLanguage, intlLocale,
} from './locale.js'
export { NAMESPACES } from './resources.js'
// Re-exported so apps depend on one package for translation
export { useTranslation, Trans } from 'react-i18next'