Skip to content

Make configurable callback exceptions #189

@rafa-suagu

Description

@rafa-suagu

I'm submitting a ... (check one with "x")

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
[x] Feature request
[ ] Documentation issue or request

Current behavior
Currently only two metas has the "exception" status, 'og:locale' and 'og:locale:alternate'

Expected/desired behavior
Configure the callback exceptions.

What is the motivation / use case for changing the behavior?
It's impossible or undesired, suppose or predict the metas that the projects wants to exclude from callback function. In our case, we have for example 'og:type' or 'og:image' that doesn't need translation (thought the callback function).
The workaround for this situation in our case it's the next:

callback: (key: string) => /^[^a-z\s]+$/.test(key) ? translateService.get(key) : key

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions