Skip to content

Lang.get("") returns whole object of translations #61

Open
@carestad

Description

@carestad

When adding an empty string to Lang.get(), it returns the whole translation object for your locale.

Would expect it to just return an empty string?

E.g. Lang.get("") => { key1: "foo" ... } (object)
Expected: Lang.get("") => "" (string)

I know there is code that checks if the first argument to Lang.get() is the key name for one of the translation files and returns that object, but I am not sure if this is the intended behaviour.

Simple fix/PR would probably just be a if (key === '') { return '' }. Can provide if bug is confirmed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions