Skip to content

Conversation

@tsschmidt
Copy link
Contributor

Currently I18NCreator creates method signatures that only use String arguments regardless of any MessageFormat that may be present for an argument. This patch attempts to create more accurate interface signatures based on the MessageFormat and also includes some GWT specific formats such as {0,list},{0,localdatetime,..} and Plurals.

This patch also proposes to add the convention {0,safehtml} to mark that an argument to be of type SafeHtml. If an Argument is found to be of type SafeHtml the return type of the method will be set to SafeHtml.

Fixes #9049

Copy link
Member

@niloc132 niloc132 left a comment

Choose a reason for hiding this comment

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

This appears to be in the style of other existing Creator types, so I can't fault it there, but I would generally like the test to be a bit more than 'it can run and doesn't fail in obvious ways' - at a glance, it doesn't even check if the generated sources compile?

A few things to consider below - thank you for getting this patch going again, I'd be inclined to merge it without further additional delay. If you'd like a more rigorous review, I'd be happy to.

Currently I18NCreator creates method signatures that only use String
arguments regardless of any MessageFormat that may be present for
an argument. This patch attempts to create more accurate interface
signatures based on the MessageFormat and also includes some GWT
specific formats such as {0,list},{0,localdatetime,..} and Plurals.

This patch also proposes to add the convention {0,safehtml} to mark that
an argument to be of type SafeHtml.  If an Argument is found to be of
type SafeHtml the return type of the method will be set to SafeHtml.
tsschmidt and others added 2 commits October 23, 2025 08:16
Currently I18NCreator creates method signatures that only use String
arguments regardless of any MessageFormat that may be present for
an argument. This patch attempts to create more accurate interface
signatures based on the MessageFormat and also includes some GWT
specific formats such as {0,list},{0,localdatetime,..} and Plurals.

This patch also proposes to add the convention {0,safehtml} to mark that
an argument to be of type SafeHtml.  If an Argument is found to be of
type SafeHtml the return type of the method will be set to SafeHtml.
@tsschmidt
Copy link
Contributor Author

Updated with recommendations from comments above. I am not inclined to take on rewriting Creator tests. Let me know if anything else needs updating to current style or implementation guidelines.

Currently I18NCreator creates method signatures that only use String
arguments regardless of any MessageFormat that may be present for
an argument. This patch attempts to create more accurate interface
signatures based on the MessageFormat and also includes some GWT
specific formats such as {0,list},{0,localdatetime,..} and Plurals.

This patch also proposes to add the convention {0,safehtml} to mark that
an argument to be of type SafeHtml.  If an Argument is found to be of
type SafeHtml the return type of the method will be set to SafeHtml.
@niloc132 niloc132 added the ready This PR has been reviewed by a maintainer and is ready for a CI run. label Oct 23, 2025
Copy link
Member

@niloc132 niloc132 left a comment

Choose a reason for hiding this comment

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

Tests are passing - approving, will leave it up a day or so for other comment.

@niloc132 niloc132 merged commit c72bb7c into gwtproject:main Oct 28, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready This PR has been reviewed by a maintainer and is ready for a CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

I18NCreator only outputs String method arguments

2 participants