Skip to content

Slow work without i18n #6

@floor12

Description

@floor12

I noticed what if the app does not use i18n at all and app has not any lang files, method ::getLabel() work really really slow, because it tries to find get label with Yii::t(). I noticed this problem in gridView.
I think the right solution is to change
public static $messageCategory = 'app';
to
public static $messageCategory;
and make a check in ::getLabel() method.

I noticed, if i have disabled i18n my yii2 app, much faster use Enum::$list[$id] instead if Enum::getLabel($id). The difference is hundreds of ms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions