model.dictionary.ts

The dictionary file provides internationalization (i18n) for your module. It defines translations for model names, field labels, enum values, API endpoints, error messages, and custom UI text.
🌐Frontend Usage
Multi-language UI - field labels, button text, status badges, toast messages all use dictionary translations.
⚙️Backend Usage
API documentation (Swagger/OpenAPI), error messages with proper translations, database schema descriptions.
Dictionary Builder Structure

Core Translations

Basic translations for the model itself and its fields.
.of((t) => ...)

Define model name & description.

.model<T>((t) => ...)

Define field translations.

2. Feature Translations
Translations for various features like insights, queries, enums, slices, and endpoints.
.insight<T>((t) => ...)

Define insight field translations.

.query<T>((fn) => ...)

Define query/filter translations.

.enum<T>(name, (t) => ...)

Define enum value translations.

.slice<T>((fn) => ...)

Define slice translations.

.endpoint<T>((fn) => ...)

Define endpoint translations.

3. Utility Translations
Translations for error messages and custom UI text.
.error({ ... })

Define error messages.

.translate({ ... })

Define custom UI translations.

Translation Usage

Translations defined in the dictionary are automatically used by the framework, but can also be accessed manually.
Manual Access

Dictionary Best Practices

1️⃣Consistent Naming
Field keys must exactly match the field names in your constant.ts. TypeScript will warn you about mismatches.
2️⃣Descriptive Labels
Use clear, user-friendly labels. 'Assignee' is better than 'progressBy'. 'Due Date' is better than 'due'.
3️⃣Add Descriptions
Always add .desc() for fields that might need tooltips or additional context. It helps new developers and users.
4️⃣Toast Message Convention
Use pattern: [action]Loading, [action]Success, [action]Error. Example: sellLoading, sellSuccess.
Released under the MIT License
Official Akan.js Consulting onAkansoft
Copyright © 2025 Akan.js. All rights reserved.
System managed bybassman