Skip to content

Conversation

MauricioFauth
Copy link
Member

The Translator::setLocale() takes precedence over $GLOBALS['lang']. This makes possible to deprecate the usage of the $GLOBALS['lang'].

*/
public static function load()
{
if (! class_exists(Loader::class)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the guard needed now?

Copy link
Member Author

@MauricioFauth MauricioFauth Nov 15, 2024

Choose a reason for hiding this comment

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

Just because this method is public. But it should be private. And calling it directly without Loader will cause an error.
Maybe throwing an exception is better. Or annotating it as internal method, or both.

The Translator::setLocale() takes precedence over $GLOBALS['lang'].
This makes possible to deprecate the usage of the $GLOBALS['lang'].

Signed-off-by: Maurício Meneghini Fauth <[email protected]>
@MauricioFauth MauricioFauth merged commit 17167da into phpmyadmin:5.11.x Nov 19, 2024
19 checks passed
@MauricioFauth MauricioFauth deleted the translator-locale branch November 19, 2024 14:30
@MauricioFauth MauricioFauth self-assigned this Nov 19, 2024
@MauricioFauth MauricioFauth added this to the 5.11.0 milestone Nov 19, 2024
MauricioFauth added a commit that referenced this pull request Dec 8, 2024
[ci skip]

Signed-off-by: Maurício Meneghini Fauth <[email protected]>
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.

3 participants