Class LabelRegistry
java.lang.Object
tools.pantheum.gaia.gs1.localization.LabelRegistry
Localized display labels for interpretation segments, keyed by the interpretation
type (e.g.
"GTIN_TYPE", "CHECK_DIGIT").
Each supported language ships a JSON catalogue under /localization/<LANG>/ mapping the
interpretation type to its human-readable label. English
(interpretation_labels_EN.json) is the canonical, complete catalogue and the
fallback for any type missing from another language's catalogue. The loader is
fail-open: a catalogue file that is absent or malformed yields an empty map, so the
English fallback (and ultimately the label the producer emitted) still applies.
Loaded lazily per language and cached; thread-safe.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionlabelFor(String type, GaiaConstants.Language language) Returns the localized label for the given interpretation type, ornullif the type is not catalogued in the requested language or in English.
-
Field Details
-
INSTANCE
The singleton instance.
-
-
Method Details
-
labelFor
Returns the localized label for the given interpretation type, ornullif the type is not catalogued in the requested language or in English. Callers should treatnullas "keep the label the producer already supplied".- Parameters:
type- the interpretation type (its key), e.g."GTIN_TYPE"language- the desired language; falls back to English when the language has no catalogue, or the type is missing from its catalogue- Returns:
- the label for.
-