-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix memory card tooltip not showing P2P frequency #7847
base: main
Are you sure you want to change the base?
Conversation
en_us.json is made using datagen, if there is something missing it means either the datagen code is wrong, or something is using the wrong string (or not using the constants at all). |
I'm not familiar with the datagen way to checking for translatable strings. The code using that translatable string is in MemoryCardItem.java, function appendHoverText: var p2pFreq = stack.get(AEComponents.EXPORTED_P2P_FREQUENCY);
if (p2pFreq != null) {
final String freqTooltip = ChatFormatting.BOLD + Platform.p2p().toHexString(p2pFreq);
lines.add(Tooltips.of(Component.translatable("gui.tooltips.ae2.P2PFrequency", freqTooltip)));
} |
the Strings are all explicitly registered to datagen (see https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/main/src/main/java/appeng/datagen/providers/localization/LocalizationProvider.java) the code should either re-use the existing constant, like this: var p2pFreq = stack.get(AEComponents.EXPORTED_P2P_FREQUENCY);
if (p2pFreq != null) {
final String freqTooltip = ChatFormatting.BOLD + Platform.p2p().toHexString(p2pFreq)
- lines.add(Tooltips.of(Component.translatable("gui.tooltips.ae2.P2PFrequency", freqTooltip)));
+ lines.add(Tooltips.of(Component.translatable(InGameTooltip.P2PFrequency.getTranslationKey(), freqTooltip)));
} or manually add the key, like the others here: Applied-Energistics-2/src/main/java/appeng/datagen/providers/localization/LocalizationProvider.java Lines 110 to 151 in 69c8d37
|
565a205
to
3736bd2
Compare
Thanks for your explanations! I've updated the branch according to your first suggestion. |
A missing translation text of gui.tooltips.ae2.P2PFrequency caused a messed up tooltip for a memory card with P2P information on it.
3736bd2
to
196bf0b
Compare
And a minor correction regarding the order of the imports |
A missing translation text of gui.tooltips.ae2.P2PFrequency caused a messed up tooltip for a memory card with P2P information on it.
Some notes for the review: The actual text is a copy of waila.ae2.P2PFrequency. Other duplicates in the translation file make me think that the duplication is the way to go, rather than to change the code in MemoryCardItem.appendHoverText() to use that translatable string as that would be the alternative.
Sidenote: With the 1.20.6 changes the memory card again works correctly with P2P-Tunnels.