Public-Data Translation Cache and Preserving Source Text

Preserving public-data source text while applying reviewed translations and generated cache entries in order

Hangangjari translates fixed UI strings separately from public-data text that changes on each collection run. Buttons and tab names ship with the app, while event names, facility names, notices, and crowding messages start from stored Korean source text.

The display resolver checks official or curated translations, the machine-translation cache, and the Korean source in that order. The Korean source supports verification and retranslation when a translation is missing or incorrect.

Two Kinds of Translation

AreaSourceWhen it changesStorage
App UI stringsString CatalogApp releaseiOS resources
Public-data textKorean source textSource collectionPostgres
Curated/official translationHuman-reviewed fileReview timeJSON files
Machine translationKorean source-text hashTranslation job after collectionTranslation cache

UI code uses string keys, while the actual phrases live in the String Catalog.

For public data, Korean source text is preserved separately from translations. It supports source verification and fallback display and provides the reference for retranslation or curated overrides when a language is missing or incorrect.

Reviewed Translations First

Public-data translation selects a display value according to language-specific priorities.

flowchart TD
  Request["Korean source text and display language"] --> Official{"Official translation exists?"}
  Official -->|Yes| UseOfficial["Show official translation"]
  Official -->|No| Curated{"Curated/edited translation exists?"}
  Curated -->|Yes| UseCurated["Show curated translation"]
  Curated -->|No| Machine{"Cache has<br/>this language?"}
  Machine -->|Yes| UseMachine["Show cached translation"]
  Machine -->|No| Korean["Show Korean source text"]

Official or curated translations take priority over machine translation. Empty strings and keys are excluded; when no usable translation exists, the resolver returns the Korean source.

A Cache for Missing Languages

The machine-translation cache uses a hash of the Korean source text as the key. If the same string appears in events, facilities, parking lots, or parks, it only needs to be translated once.

One cache row contains the source text, translations by language, translation engine, success state, and created and updated times. Translation jobs inspect missing languages instead of a single row-level completion state.

If a string has English and Japanese filled but Traditional Chinese missing, the next translation job should translate only the missing language.

sequenceDiagram
  autonumber
  participant Collector as Missing-translation collector
  participant Store as Translation cache
  participant Provider as Translation provider

  Collector->>Store: Find Korean source text with missing languages
  Store-->>Collector: Source text to translate
  Collector->>Provider: Translate only missing languages
  Provider-->>Collector: Translations by language
  Collector->>Store: Store without deleting existing languages

The job preserves existing values and fills only missing languages.

Machine-Translation Validation Rules

Machine translations are stored only when they pass these checks.

  • Do not store it if the source language remains unchanged.
  • Leave very long source text as original instead of spending translation quota.
  • Do not delete existing values when a language has no value.
  • Proper nouns in curated/official files take priority over machine translation.

Machine translations that fail validation are not stored. Operators can override proper nouns such as place, facility, and event names in curated files.

Display-Text Selection in the API

The client does not read the translation DB directly. The backend receives a language hint and returns display text in a LocalizedText shape.

flowchart TB
  KRText["Korean source text"] --> Resolver["Choose translation"]
  Assets["Official/curated translation files"] --> Resolver
  Cache["Machine-translation cache"] --> Resolver
  Resolver --> DTO["API display field"]
  DTO --> Client["iOS app and widgets"]

iOS reads the display value selected by the backend and whether the source text was used as fallback; it does not access translation storage.

Korean Source Text Preserved to the End

The source text is both fallback display and evidence for revisiting the public-data source.

Public data preserves Korean source text and source metadata, while translations remain display values. A translation failure does not change the collection result.

If a translation is wrong, the translation cache and curated files are checked. If the source sentence changed, the collection and normalization records are checked.

API Display-Value Selection Order

The backend resolves official or curated translations, machine-translation cache entries, and Korean source text in order. Later jobs fill missing languages, and clients receive the selected text plus whether the source was used as fallback.

Comments

Comments

    Image preview