Skip to content

Locale APIs

In addition to useI18n(), the Vue SDK exports lower-level locale primitives for advanced integrations:

  • locale
  • localeSetting
  • setLocale()
  • AVAILABLE_LOCALES
  • LOCALE_LABELS

Use these when you want direct store access, need to integrate locale state with a larger app shell, or want locale metadata without subscribing to the full useI18n() return object.

Usage

ts
import {
  locale,
  localeSetting,
  setLocale,
  AVAILABLE_LOCALES,
  LOCALE_LABELS,
} from '@open-pencil/vue'

Notes

  • locale is the resolved active locale store
  • localeSetting is the persisted user preference store
  • setLocale() updates the preference and active locale together
  • AVAILABLE_LOCALES and LOCALE_LABELS are useful for custom pickers

Released under the MIT License.