model.dictionary.ts

Dictionary is supported in English and Korean by default, and the English and Korean order is used in the object structure of each key-value pair.
The declared dictionary is used for both the frontend and backend. On the frontend, it is used for implementing multi-language UI, and on the backend, it is used for generating error codes, API Docs, and DB schema tables.

1. Model dictionary

1.1. model translation
modelName

Model name

modelName: ['Drone', '드론']
modelDesc

Model description

modelDesc: [
  'drone is a flying robot...',
  '드론은 임베디드 시스템...'
]
<FIELD_NAME>

Field name of the domain full model

name: [&apos;Name&apos;, &apos;이름&apos;]
desc-<FIELD_NAME>

Field description of the domain full model

&apos;desc-name&apos;: [&apos;Name of the drone&apos;, &apos;드론의 이름&apos;]
1.2. insight translation
<FIELD_NAME>

Field name of the domain insight model

count: [&apos;Count&apos;, &apos;개수&apos;]
desc-<FIELD_NAME>

Field description of the domain insight model

&apos;desc-count&apos;: [&apos;Drone count in...&apos;, &apos;현재 쿼리 설정에...&apos;]
1.3. sort translation
<FIELD_NAME>

Field name of the domain sort

count: [&apos;Count&apos;, &apos;계수&apos;]
desc-<FIELD_NAME>

Field description of the domain sort

&apos;desc-count&apos;: [&apos;Drone count in...&apos;, &apos;현재 쿼리 설정에...&apos;]
1.4. etc translation
1.4.1. enum translation
enum<FIELD_NAME><ENUM_VALUE>

Field name of the domain enum

&apos;enum-status-active&apos;: [&apos;Active&apos;, &apos;활성&apos;]
enumdesc<FIELD_NAME><ENUM_VALUE>

Field description of the domain enum

&apos;enumdesc-status-active&apos;: [&apos;Active status&apos;, &apos;활성 상태&apos;]
1.4.2. custom translation
Custom translation is possible with the following examples.
Term definition: land: [&apos;Land&apos;, &apos;착륙&apos;]
Error message: noDroneError: [&apos;Drone does not exist&apos;, &apos;드론이 존재하지 않습니다&apos;]

2. Summary dictionary

Define the field name and description used in the Summary model.
<FIELD_NAME>

Field name of the domain summary model

totalDrone: [&apos;Total Drone&apos;, &apos;총 Drone 수&apos;]
desc-<FIELD_NAME>

Field description of the domain summary model

&apos;desc-totalDrone&apos;: [&apos;Total drone count...&apos;, &apos;데이터베이스에...&apos;]

3. Signal dictionary

3.1. api translation
Define the translation of the API endpoint and parameter.
api<SIGNAL_KEY>

Role of the API endpoint

&apos;api-droneListInPublic&apos;: [&apos;Drone List In Public&apos;, &apos;공개된 Drone 리스트&apos;]
apidesc<SIGNAL_KEY>

Description of the API endpoint

&apos;apidesc-droneListInPublic&apos;: [&apos;Get a list of...&apos;, &apos;공개된 Drone의...&apos;]
arg<SIGNAL_KEY><ARG_NAME>

Parameter of the API endpoint

&apos;arg-droneListInPublic-statuses&apos;: [&apos;Statuses&apos;, &apos;상태&apos;]
argdesc<SIGNAL_KEY><ARG_NAME>

Description of the API endpoint parameter

&apos;argdesc-droneListInPublic-statuses&apos;: [&apos;Statuses to filter&apos;, &apos;필터링할 상태&apos;]

4. Full Example

Complete example of the dictionary.ts file.
import { ModelDictionary, SignalDictionary, SummaryDictionary, baseTrans, getBaseSignalTrans } from '@core/base';
import type { Drone, DroneInsight, DroneSummary, droneSort } from './drone.constant';
import type { DroneSignal } from './drone.signal';
const modelDictionary = {
  ...baseTrans,
  modelName: ['Drone', '드론'],
  modelDesc: [
    'drone is a flying robot that can be remotely controlled or fly autonomously through software-controlled flight plans in their embedded systems, working in conjunction with onboard sensors and GPS.',
    '드론은 임베디드 시스템에서 작동하는 소프트웨어 제어 비행 계획을 통해 원격으로 제어되거나 자율적으로 비행할 수 있는 비행 로봇입니다.',
  ],
  // * --- Model --- * //
  name: ['Name', '이름'],
  'desc-name': ['Name of the drone', '드론의 이름'],
  wsUrl: ['Websocket URL', '웹소켓 URL'],
  'desc-wsUrl': ['Websocket URL of the drone', '드론의 웹소켓 URL'],
  // * --- Model --- * //
  // * --- Insight --- * //
  count: ['Count', '개수'],
  'desc-count': ['Drone count in current query setting', '현재 쿼리 설정에 맞는 Drone 수'],
  // * --- Insight --- * //
  // * --- Sort --- * //
  highPriority: ['High Priority', '높은 우선순위'],
  'desc-highPriority': ['High priority sort', '높은 우선순위 정렬'],
  // * --- Sort --- * //
  // * --- Etc --- * //
  'enum-status-active': ['Active', '활성'],
  'enumdesc-status-active': ['Active status', '활성 상태'],
  'enum-status-offline': ['Offline', '오프라인'],
  'enumdesc-status-offline': ['Offline status', '오프라인 상태'],
  land: ['Land', '착륙'],
  return: ['RTB', '복귀'],
  terminate: ['Terminate', '종료'],
} satisfies ModelDictionary<Drone, DroneInsight, typeof droneSort>;
export const droneSummaryDictionary = {
  // * --- Summary --- * //
  totalDrone: ['Total Drone', '총 Drone 수'],
  'desc-totalDrone': ['Total drone count in the database', '데이터베이스에 저장된 총 Drone 수'],
  // * --- Summary --- * //
} satisfies SummaryDictionary<DroneSummary>;
const signalDictionary = {
  ...getBaseSignalTrans('drone' as const),
  // * --- Endpoint --- * //
  'api-droneListInPublic': ['Drone List In Public', '공개된 Drone 리스트'],
  'apidesc-droneListInPublic': ['Get a list of public drone', '공개된 Drone의 리스트를 가져올니다'],
  'arg-droneListInPublic-statuses': ['Statuses', '상태'],
  'argdesc-droneListInPublic-statuses': ['Statuses to filter', '필터링할 상태'],
  // * --- Endpoint --- * //
} satisfies SignalDictionary<DroneSignal, Drone>;
export const droneDictionary = { ...modelDictionary, ...signalDictionary };
Released under the MIT License
Official Akan.js Consulting onAkansoft
Copyright © 2025 Akan.js. All rights reserved.
System managed bybassman