Skip to content

Access resources as objects instead of strings #49

@renatoch

Description

@renatoch

Is there a way to access resource strings using object properties / keys instead of passing strings?

I've tried to get access to the resource bundle, but the variable is private, so I cannot even iterate to obtain list of keys.

This would make the code more readable, better syntax, and color coding in my text editor would be able to differentiate from regular strings in the code.

How I use today:

    var resourcePath = 'Document.Create';

    locale.getString(resourcePath + '.New');

How I would like to use:

    var resDocCreate = locale.keys('Document.Create');

    locale.getString(resDocCreate.New); 

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