Internationalize PonderScenes text descriptions instead of using hardcoded strings
Shen-Ming-Hong opened this issue ยท 0 comments
๐ Suggestion: Internationalize PonderScenes Text Descriptions
๐ Issue Description
Currently, the PonderScenes.java class contains hardcoded English text strings for all Ponder scene descriptions, which prevents players from different countries/regions from enjoying these interactive tutorials in their native languages.
๐จ Current Problem
In src/main/java/com/mrh0/createaddition/ponder/PonderScenes.java, text descriptions are hardcoded:
scene.overlay().showText(50)
.text("Electric Motors are a compact and configurable source of Rotational Force")
.placeNearTarget()
.pointAt(util.vector().topOf(motor));scene.overlay().showText(70)
.text("Scrolling on the back panel changes the RPM of the motors' rotational output")
.placeNearTarget()
.pointAt(blockSurface);โ Proposed Solution
The project already has excellent localization support with language files in src/main/resources/assets/createaddition/lang/ including language keys like:
"createaddition.ponder.electric_motor.header": "Generating Rotational Force using Electric Motors",
"createaddition.ponder.electric_motor.text_1": "Electric Motors are a compact and configurable source of Rotational Force",
"createaddition.ponder.electric_motor.text_2": "Scrolling on the back panel changes the RPM of the motor's rotational output",
"createaddition.ponder.electric_motor.text_3": "The Electric Motor requires a source of energy",
"createaddition.ponder.electric_motor.text_4": "The motor's energy consumption is determined by the set RPM"However, the code doesn't use these language keys! Instead, it should use translation keys like:
scene.overlay().showText(50)
.text(Component.translatable("createaddition.ponder.electric_motor.text_1"))
.placeNearTarget()
.pointAt(util.vector().topOf(motor));๐ Benefits
- Better Player Experience: Players worldwide can enjoy Ponder tutorials in their native language
- Consistent Localization: The mod already supports 19+ languages, but Ponder scenes remain English-only
- Community Contribution: Translators can contribute to improving Ponder content for their regions
- Professional Polish: Complete internationalization demonstrates attention to detail
๐ Affected Files
src/main/java/com/mrh0/createaddition/ponder/PonderScenes.java- All text() method calls need to use translation keys- Language files already contain the necessary keys but aren't being used
๐ฏ Impact
This affects all international players who want to understand the Ponder tutorials. With Create Addition being such a popular mod with a global player base, proper internationalization would significantly improve accessibility.
๐ Technical Implementation
The change would involve replacing hardcoded strings with Component.translatable() calls using the existing language keys. The language files already exist and contain the translations - they just need to be connected to the code.
Would be happy to help implement this if needed! ๐ ๏ธ