Skip to content

Reports i18n #1216

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Reports i18n #1216

wants to merge 7 commits into from

Conversation

alicecaron
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?
#1206

What kind of change does this PR introduce?

Feature: allow internationalization of reports.
Refacto: remove usages of deprecated ReportNode::withMessageTemplate(String key, String messageTemplate) methode and use the new one instead, loading a new ResourceBundle for open loadflow translations.

What is the current behavior?
It is not possible to have report in another language.

What is the new behavior (if this is a feature change)?
It is possible to have a report in a given locale language.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

The third version of the report node API from powsybl-core introduces a mechanism for internationalizing messages (i18n).
For all users, when creating a new ReportNode root, the i18n bundles should be loaded. You can either:

  • Use the new ReportNode.newRootReportNode().withResourceBundles(String... bundleBaseNames) method, if you want to use specific bundles. To use this open load flow resource bundle, the bundle base name to use is PowsyblOpenLoadFlowReportResourceBundle.BASE_NAME
  • Or call ReportNode.newRootReportNode().withAllResourceBundlesFromClasspath(), if you want to use all the bundles present in your classpath.

SylvestreSakti
SylvestreSakti previously approved these changes Apr 4, 2025
@vidaldid-rte
Copy link
Collaborator

@alicecaron why is this PR a breaking change ? What does it break for OpenLoadFlow users if we merge this PR ? Can you detail ? The explenations you provided are about the already done change in Core.

@alicecaron
Copy link
Contributor Author

@alicecaron why is this PR a breaking change ? What does it break for OpenLoadFlow users if we merge this PR ? Can you detail ? The explenations you provided are about the already done change in Core.

For users using OpenLoadFlow and creating rootReportNode on their side, they now need to specified the OLF report bundle if they list them one by one to be able to have the messages of the OLF reports in their rootReportNode children generated within OLF.

Copy link
Collaborator

@vidaldid-rte vidaldid-rte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this migration ! Let's start with that as decided and improve as we go.

@jeandemanged jeandemanged changed the title I18n Reports i18n Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ReportNode] Enable internationalization
4 participants