Skip to content
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

Replace {} placeholders to %% #320

Merged
merged 1 commit into from
Jun 3, 2024
Merged

Conversation

parijke
Copy link
Contributor

@parijke parijke commented Jun 3, 2024

Because this is not an actual translation, but a string replace in code, we keep the % sign as the placeholder.

This only goes for the challenge variable

Background:

ICU Translation Format:
We've switched to the ICU translation format because it supports pluralization, which is necessary for this project.
The ICU format is similar to the previous format but replaces support for pluralization (e.g., handling "1 token" versus "two tokens").

Variable Substitution Format Change:

In the ICU format, variables are expected to be enclosed in {} instead of the Symfony %variable% format used earlier. See https://symfony.com/doc/current/reference/formats/message_format.html

Specific Variable Handling:

The %challenge% variable, however, is not utilized within the translation files but is used for variable substitution directly within the code. Therefore, the %challenge% variable's format does not need to be changed to the ICU {} format. The main point is that while translation strings need to adhere to the new ICU format with {}, the specific variable %challenge% used in your code does not require any modification since it is not part of the translation process itself.

Because this is not an actual translation, but a string replace in code, we keep the % sign as the placeholder.
@parijke parijke requested a review from MKodde June 3, 2024 08:53
Copy link
Member

@MKodde MKodde left a comment

Choose a reason for hiding this comment

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

Looks good! Can you add a link to the discussion as to why this was rolled back? If not can you add a small writeup to this PR? That will help us in the future when we might be confronted with this again.

@parijke parijke merged commit b6f5d09 into main Jun 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants