Skip to content

Option to pass in translator to tr! #20

@bk2204

Description

@bk2204

I like this crate and I'd like to use it to translate some of my own crates. However, some of them can be used as libraries and I don't want to hold global state per-module.

Instead, I'd prefer to pass in some translator in my code (probably in the logging structure I have) to let users choose this value themselves. They might do that using the environment, or they might decide that they prefer to acquire it from an HTTP request (i.e., Accept-Language), or some other way; I don't care very much, but I want it to not be a process global.

Is it possible that tr! could be expanded to do that, or that a similar macro could be added with that functionality? If you're generally positive on the idea, I'm happy to try my hand at such a change.

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