ngx-meta icon indicating copy to clipboard operation
ngx-meta copied to clipboard

Make configurable callback exceptions

Open rafa-suagu opened this issue 6 years ago • 2 comments

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

rafa-suagu avatar Jan 10 '19 15:01 rafa-suagu

If you accept this suggestion and a PR is needed or wanted, I can do it.

rafa-suagu avatar Jan 10 '19 15:01 rafa-suagu

@rafa-as sorry for the delay, had busy times. feel free to fire a PR and i'll approve.

fulls1z3 avatar Nov 22 '19 00:11 fulls1z3