Fix translation key of changeComponentHint used in ModbusApiProps#3128
Merged
sfeilmeier merged 1 commit intoOpenEMS:developfrom May 26, 2025
Merged
Fix translation key of changeComponentHint used in ModbusApiProps#3128sfeilmeier merged 1 commit intoOpenEMS:developfrom
sfeilmeier merged 1 commit intoOpenEMS:developfrom
Conversation
Contributor
|
@fabian94533 Can you please review this? |
Contributor
|
Hi @anees-ps . You are right. The english translation key should actually be App.Api.ModbusTcp.changeComponentHint . I have actually never encountered this Exception. I guess this is because I mainly use OpenEMS in german. Thank you for highlighting this issue. |
fabian94533
approved these changes
May 22, 2025
sfeilmeier
approved these changes
May 26, 2025
Contributor
sfeilmeier
left a comment
There was a problem hiding this comment.
Thank you. I will add a separate PR that fixes the JUnit test that should have detected this error before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Key used in ModbusApiProps for translation of message:
<a class=\"warning\">Note</a>: When inserting a component, the Modbus table also changes!isApp.Api.Modbus.changeComponentHinthttps://github.com/OpenEMS/openems/blob/develop/io.openems.edge.core/src/io/openems/edge/app/api/ModbusApiProps.java#L51
I encountered this discrepancy while running unit tests — the testEnglishTranslation under TestTranslations failed with the following message:
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key App.Api.Modbus.changeComponentHint at java.base/java.util.ResourceBundle.getObject(ResourceBundle.java:567) at java.base/java.util.ResourceBundle.getString(ResourceBundle.java:523) at io.openems.edge.core.appmanager.TranslationUtil.getNullableTranslation(TranslationUtil.java:119) at io.openems.edge.core.appmanager.TranslationUtil$DebugTranslator.getTranslation(TranslationUtil.java:45) at io.openems.edge.core.appmanager.TranslationUtil.getTranslation(TranslationUtil.java:85)Interestingly, I didn’t observe this failure in the openems-fork repository. However, it appears that the key is mismatched in the translation_en.properties file. I believe the correct key (App.Api.Modbus.changeComponentHint) should be updated there to resolve the issue.