Aller au contenu

Paramètres régionaux

locale permet de définir des préférences spécifiques aux paramètres régionaux

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.locale?: LocaleConfig

Locale specific settings

locale
: {
LocaleConfig.dateLocale?: string

Date Locale used for formatting dates

@default'en-us'

dateLocale
: 'en-US',
LocaleConfig.dateTimeFormat?: Intl.DateTimeFormatOptions

DateTime Format Options

@default{ year: 'numeric', month: 'short', day: 'numeric' }

dateTimeFormat
: {},
LocaleConfig.i18n?: {
defaultLocale?: string;
}

I18n Specific Settings

i18n
: {}
},
});

dateLocale est un identifiant de paramètres régionaux BCP 47 utilisé pour le formatage des dates.

  • Type : string
  • Par défaut : 'en-US'
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.locale?: LocaleConfig

Locale specific settings

locale
: {
LocaleConfig.dateLocale?: string

Date Locale used for formatting dates

@default'en-us'

dateLocale
: 'en-US', // PAR DÉFAUT - Ceci définit les paramètres régionaux de date pour le formatage de la date.
}
})

dateTimeFormat est un objet utilisé pour configurer le format de date et d’heure.

  • Type : Intl.DateTimeFormatOptions
  • Par défaut : {}
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.locale?: LocaleConfig

Locale specific settings

locale
: {
LocaleConfig.dateTimeFormat?: Intl.DateTimeFormatOptions

DateTime Format Options

@default{ year: 'numeric', month: 'short', day: 'numeric' }

dateTimeFormat
: {
Intl.DateTimeFormatOptions.year?: "numeric" | "2-digit" | undefined
year
: "numeric",
Intl.DateTimeFormatOptions.month?: "numeric" | "2-digit" | "short" | "long" | "narrow" | undefined
month
: "short",
Intl.DateTimeFormatOptions.day?: "numeric" | "2-digit" | undefined
day
: "numeric"
},
}
})

i18n est un objet utilisé pour configurer les options d’internationalisation.

  • Type : object
  • Par défaut : {}
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptions

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
StudioCMSOptions.locale?: LocaleConfig

Locale specific settings

locale
: {
LocaleConfig.i18n?: {
defaultLocale?: string;
}

I18n Specific Settings

i18n
: {
defaultLocale?: string

Default Locale for the StudioCMS

This option sets the default language for the StudioCMS application.

It must be one of the available translation keys or 'en' for English.

@default'en'

defaultLocale
: 'en',
},
}
})