Skip to content

How do I access current language outside setup? (Especially from a plugin!) #94

@SH1R3F

Description

@SH1R3F

Right now, I'm trying to build a plugin to do something depending on current language, so I need to get access to what current language is.
so, the idea that comes up on my mind now is to get useI18n().locale;
but it doesn't work leading to this error "Must be called at the top of a setup function"
Any help would be very appreciated !

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