Ox Content

i18n.ts

Source

resolveI18nOptions

function

Resolves i18n options with defaults.

Source

export function resolveI18nOptions(
  options: I18nOptions | false | undefined,
  ): ResolvedI18nOptions | false

Returns

ResolvedI18nOptions | false -


createI18nPlugin

function

Creates the i18n sub-plugin for the Vite plugin array.

Source

export function createI18nPlugin(resolvedOptions: ResolvedOptions): Plugin

Returns

Plugin -


generateI18nModule

function

Generates the virtual module for i18n configuration.

Source

function generateI18nModule(options: ResolvedI18nOptions, root: string): string

Returns

string -


flattenObject

function

Flattens a nested object into dot-separated keys.

Source

function flattenObject(
  obj: Record<string, unknown>,
  prefix: string,
  result: Record<string, string>,
  ): void

Returns

void -


loadDictionariesFallback

function

Fallback dictionary loading using TS-based JSON file reading.

Source

function loadDictionariesFallback(
  options: ResolvedI18nOptions,
  dictDir: string,
  ): Record<string, Record<string, string>>

Returns

Record<string, Record<string, string>> -


collectKeysFromSource

function

Collects translation keys from source files using NAPI extractTranslationKeys.

Source


walkDir

function

Recursively walks a directory, calling the callback for files matching the pattern.

Source

function walkDir(dir: string, pattern: RegExp, callback: (filePath: string)

Returns

void -