Options
All
  • Public
  • Public/Protected
  • All
Menu

Locales provide pods with a way of generating different content for different locales. Locale objects are used to instantiate documents, so that one document can be available in many locales – and documents, collections, and pods can each have their own sets of locales.

Locale objects provide a way with accessing the translations for a locale, as well as managing operations around the translation process such as recording strings that are missing translations. Locale objects also provide information about the locale that can be used within templates, such as whether the locale is a right-to-left locale.

Hierarchy

  • Locale

Index

Constructors

Properties

id: string
pod: Pod
podPath: string
recordedStrings: Map<TranslationString, Set<Document>>

Accessors

  • get rtl(): boolean
  • get translations(): any
  • Returns the translations for this locale. The translations are stored within a YAML file for each locale, in a file named /locales/{locale}.yaml. The translations are stored as a mapping of source string to translation, under a translations key within the file.

    Returns any

Methods

  • Records a missing translation string during the build process. If the build looks up a translation for a source string and if the translation doesn't exist, it is recorded by this function so that all missing translations can be collected (and translated) later. The location of the translation string (the Document where the missing translation string was located, is also collected, so that the order of appearance and the context can be bundled with the recorded strings and provided to translators.

    Parameters

    • string: TranslationString

      The source string that is missing a translation.

    • Optional location: Document

      The document where the string was requested.

    Returns void

  • toString(): string

Generated using TypeDoc