Skip to main content

Basic Usage of SD Function

The SD (Sonamu Dictionary) function returns translated text matching the current Context’s locale:

Type Safety

Using a non-existent key results in a compile-time error:

Forcing a Specific Locale

Use SD.locale() to get values for a specific locale regardless of Context:

Getting Enum Labels

SD.enumLabels() returns a Proxy with labels for all values of an Enum:

Dictionary Writing Patterns

Key Naming Conventions

Writing Function Values

Use arrow functions when dynamic values are needed:
Unlike functions written directly in a dictionary file, new function values entered through Sonamu UI, Excel import, or the CLI are saved as functions only when they pass the function value rules; otherwise they are saved as strings.

Using in Models

Helper Functions

Using josa, plural, format

Entity Labels

Auto-extracted labels