This page documents the localization conventions used by PrototypeMachinery, so addon/script authors can provide their own language entries.
Note: this project targets Minecraft 1.12.2 and uses the legacy
.langformat (not the 1.13+ JSON format).
Chinese original:
Built-in language files:
src/main/resources/assets/prototypemachinery/lang/en_us.langsrc/main/resources/assets/prototypemachinery/lang/zh_cn.lang
Third-party addons should usually ship their own language files under:
assets/<modid>/lang/<locale>.lang
Different UI paths use different translation helpers:
TextComponentTranslation(key, args...)(chat messages, command feedback)I18n.format(key, args...)(client UI rendering)- ModularUI
IKey.lang(key)(GUI titles/widgets)
If a key is missing, Minecraft typically falls back to displaying the raw key.
Built-in attribute translation keys follow:
attribute.<namespace>.<path>
Example (from zh_cn.lang):
attribute.prototypemachinery.process_speed=...
Implementation detail:
StandardMachineAttributesbuilds keys as"attribute.${'$'}{id.namespace}.${'$'}{id.path}".
See also:
Blocks/items generally use translationKey and language files provide the .name entry.
One example pattern for controller blocks:
prototypemachinery.machine.<machine_id>_controller
Corresponding language entry:
prototypemachinery.machine.xxx_controller.name=...
(The exact keys are implementation-defined; you can always print the translationKey during debugging to verify.)
For structure preview, selective requirement errors, etc, the project tends to emit fixed keys, e.g.:
pm.preview.startederror.selective.invalid_selection
Keeping these keys centralized in language files makes translation maintenance easier.
- Prefer translation keys for any user-visible text (GUI titles/tooltips/errors) instead of hardcoded strings.
- Ship at least
en_us.langfor your<modid>, and add other locales as needed.