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

FIX Finish removing deprecated i18n functionality. #11528

Conversation

GuySartorelli
Copy link
Member

This functionality was deprecated in #6558 and partially removed in #10594.

There's no chance anyone is still using the legacy %s in localisation strings today, as doing so would result in a hard error - so it's time to fully remove this legacy code.

Issue

This deprecated functionality was partially removed in silverstripe#10594. This
commit finishes the job.
Comment on lines +174 to 177
// Injection must be associative
if (!empty($injection) && !ArrayLib::is_associative($injection)) {
throw new InvalidArgumentException('Injection must be an associative array');
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Uses a more declarative condition than the previous one, but the result is the same.

Error moved here from below, as per the comment (see line 209)

// Pass args directly to handle deprecation
// Pass args directly as we allow variable args.
Copy link
Member Author

Choose a reason for hiding this comment

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

We still allow variable args because you can technically add a comment which should be but isn't used by the i18n text collector. Changing that is well outside the scope of this PR so leaving as is.

@emteknetnz emteknetnz merged commit 3871869 into silverstripe:6.0 Jan 7, 2025
13 checks passed
@emteknetnz emteknetnz deleted the pulls/6.0/i18n-deprecated-code branch January 7, 2025 20:46
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