Skip to content

[Translation] Fix example of using ICU message directly in code #16905

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

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

HypeMC
Copy link
Member

@HypeMC HypeMC commented Jun 22, 2022

@carsonbot carsonbot added this to the 5.4 milestone Jun 22, 2022
@carsonbot carsonbot changed the title [Translator] Fix example of using ICU message directly in code [Translation] Fix example of using ICU message directly in code Jun 22, 2022
'organizer_name' => 'Ryan',
'organizer_gender' => 'male',
],
// Don't forget to suffix the domain with +intl-icu
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Don't forget to suffix the domain with +intl-icu
// Appending MessageCatalogueInterface::INTL_DOMAIN_SUFFIX will add the required suffix “+intl-icu” to the domain

IMHO, “Don't forget” looks like I have something to do, but the suffix is already added on the line after, so we can just explain what it will do.

Copy link
Member Author

Choose a reason for hiding this comment

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

Works for me.

@javiereguiluz
Copy link
Member

Thanks @HypeMC!

While merging I did a minor tweak because the constant name is so long that the code looked a bit ugly: 2db0c59

@HypeMC HypeMC deleted the fix-icu-example branch October 26, 2022 16:06
@HypeMC
Copy link
Member Author

HypeMC commented Oct 26, 2022

Thanks @HypeMC!

While merging I did a minor tweak because the constant name is so long that the code looked a bit ugly: 2db0c59

@javiereguiluz Thanks, I like the improvement, but I'd suggest removing the use Symfony\Component\Translation\MessageCatalogueInterface; part in that case as well, as it is no longer needed.

@javiereguiluz
Copy link
Member

Good catch! Removed in the use import in c4ee64a

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.

[Translator] Unclear "Translate ICU messages directly in code"
4 participants